# Failures and scaling

> What keeps working when a part of the registry fails, and how it grows.

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

For agents: API down: install --frozen still works (lock has versions + hashes; packages from CDN by immutable URL; local cache ~/.cache/sypnia/skills by sha256); new resolves fail clearly. CDN/storage down: installs from local cache; otherwise fail, never fall back to unverified sources. Checker failing: versions stay checking, retried 3 times, then DLQ + alarm; never listed unchecked. Signer/KMS unavailable: versions wait in checking; never published unsigned. Postgres down: API 503, CDN downloads of locked versions continue. Wrong package served: hash/signature mismatch → refused (exit 6). Scaling: downloads are CDN reads; API stateless; search in Postgres full text (enough for tens of thousands of skills); checker scales with the queue.

| When this fails                       | What still works                                                                                                         | What you see                                                                                                                        |
| ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| **The API**                           | `skills install --frozen`: the lock file has the versions and hashes, and packages come from the CDN or your local cache | new `add` and `update` fail with a clear message                                                                                    |
| **The CDN or storage**                | installs from the local cache, `~/.cache/sypnia/skills/`, kept by hash                                                   | other installs fail; the CLI never falls back to an unverified source                                                               |
| **The checker**                       | everything else                                                                                                          | new versions stay `checking`; after three tries they go to a dead-letter queue and the team is alerted. Nothing is listed unchecked |
| **The signer**                        | everything else                                                                                                          | new versions wait in `checking`. Nothing is published unsigned                                                                      |
| **Postgres**                          | downloads of versions your lock file already holds                                                                       | the API answers `503`                                                                                                               |
| **Something serves a different file** | nothing is installed                                                                                                     | the hash or the signature does not match, and the command exits with code `6`                                                       |

## Growing

- **Downloads** are reads from a CDN of files that never change, so they grow without the registry noticing.
- **The API** keeps no state between requests and adds instances with load.
- **Search** is Postgres full-text search, enough for tens of thousands of skills.
- **The checker** takes versions from a queue; more versions mean more workers, never a slower API.
