# Failures and scaling

> What happens when a render, the model, Git or the database fails, and how Design grows.

Applies to: the Sypnia engine (open source, self-hosted) and Sypnia Cloud (paid service).  
Source: https://design.docs.sypnia.com/architecture/failures-and-scaling/

For agents: Design failures: render fails → retried 3 times, then the state shows «picture unavailable» and the proposal can still be reviewed from files; Sypnia AI unavailable → proposals by hand or by the agent still work, AI help returns 503 ai_unavailable; Git unreachable → approval kept, pull request retried with backoff for 24 h, then the proposal shows the error; repository moved on (conflict) → Design rebases its branch, conflicts shown in the PR; database down → API 503, local tools unaffected; DLQ alarm. Scaling: stateless Lambdas, render jobs in parallel per proposal, gallery build cached per commit, renders reused by (commit, target, theme, width).

## Failures

| What fails                 | What happens                                                                                                     |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| A render                   | retried three times; then that picture shows «unavailable» and the proposal can still be reviewed from its files |
| Sypnia AI                  | proposals by hand or by your agent keep working; AI help answers `503 ai_unavailable`                            |
| Git (Sypnia Git or GitHub) | the approval is kept; the pull request is retried with backoff for 24 hours, then the proposal shows the error   |
| Your branch moved on       | Design rebases its branch; conflicts appear in the pull request for a person or the agent                        |
| The database               | the API answers `503`; the CLI, the check and the local gallery keep working                                     |
| A job keeps failing        | it goes to the dead-letter queue and an alarm fires                                                              |

Your app is never affected: Design changes reach it only through pull requests, and nothing in your app calls Design at run time.

## Scaling

- The API and the workers hold no state and scale with Lambda.
- A proposal's renders run in parallel.
- The gallery build of a commit is made once and reused by every render of that commit.
- A picture is reused for the same commit, target, theme and width.
