Architecture » History » Version 1
Mara Oyelaran, 08/08/2026 12:18 PM
| 1 | 1 | Mara Oyelaran | # Architecture |
|---|---|---|---|
| 2 | |||
| 3 | Atlas is four services behind one gateway. |
||
| 4 | |||
| 5 | The **gateway** terminates TLS, authenticates the request, applies the tenant's rate limit and routes |
||
| 6 | to the service that owns the path. It holds no state beyond a short-lived token cache. The |
||
| 7 | **identity service** owns tenants, users, service accounts and API keys, and is the only thing that |
||
| 8 | writes to the identity database. The **event bus** carries every domain event; consumers are grouped |
||
| 9 | so that a slow consumer cannot hold up a fast one. The **job runner** executes anything that must not |
||
| 10 | happen inside a request: invoice generation, exports, webhook delivery. |
||
| 11 | |||
| 12 | ## Request path |
||
| 13 | |||
| 14 | 1. The gateway resolves the tenant from the host or the API key. |
||
| 15 | 2. It introspects the token against the identity service, with a cache keyed on the token hash. |
||
| 16 | 3. It applies the rate limit, which is a token bucket per tenant per route class. |
||
| 17 | 4. It forwards the request with a correlation id that every downstream log line carries. |
||
| 18 | |||
| 19 | ## Invariants |
||
| 20 | |||
| 21 | * Every write emits exactly one event, in the same transaction as the write. |
||
| 22 | * Every consumer is idempotent on the event id: replaying a day must change nothing. |
||
| 23 | * No service reads another service's database. Ever. The event bus exists so that it does not have to. |