# Failures and scaling

> What happens when storage, the database or scanning fails, and how Files grows.

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

For agents: Files failures: DB down (uploads/list/token downloads 503; public and signed URLs keep serving), storage down (503 Retry-After; cached served), partial uploads (resumable continue; abandoned expire 24 h, parts deleted), scanner down (scan buckets stay pending 423, never served unscanned, retries, notify after 1 h), transform failure (422; original available). Scaling with S3/CDN; stateless engine; streaming uploads.

| What fails       | Effect                                                       | What Files does                                                                              |
| ---------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------------------- |
| The database     | uploads, listing and private downloads by token fail (`503`) | public files and valid signed URLs keep being served by the CDN                              |
| Storage          | uploads and cache misses fail                                | cached files keep being served; uploads return `503` with `Retry-After`                      |
| An upload midway | nothing is visible                                           | resumable uploads continue; abandoned ones expire after 24 hours and their parts are deleted |
| The scanner      | new files in scanning buckets stay `pending` (`423`)         | files are never served unscanned; scans retry; you are notified past an hour                 |
| A transform      | `422` for that image                                         | the original stays available; broken images are reported in the log                          |

Files scale with S3 and the CDN. The engine is stateless; uploads stream without buffering whole files, so memory does not grow with file size.
