Index by title

Architecture

Atlas is four services behind one gateway.

The gateway terminates TLS, authenticates the request, applies the tenant's rate limit and routes
to the service that owns the path. It holds no state beyond a short-lived token cache. The
identity service owns tenants, users, service accounts and API keys, and is the only thing that
writes to the identity database. The event bus carries every domain event; consumers are grouped
so that a slow consumer cannot hold up a fast one. The job runner executes anything that must not
happen inside a request: invoice generation, exports, webhook delivery.

Request path

  1. The gateway resolves the tenant from the host or the API key.
  2. It introspects the token against the identity service, with a cache keyed on the token hash.
  3. It applies the rate limit, which is a token bucket per tenant per route class.
  4. It forwards the request with a correlation id that every downstream log line carries.

Invariants


Coding standards

Formatting is not a matter of taste here: the formatter runs in CI and its output is the standard.
What a reviewer will actually ask about:


Release process

Two-week cycles. The version is cut on a Tuesday, spends two days on staging with the replay suite
running against it, and goes to production on Thursday morning behind a flag that is opened to 5 %,
then 50 %, then everyone, over the following day.

A fix that must not wait for the cycle goes out as a patch release, which skips staging only if the
change is a single-line configuration value. Anything larger waits for the next morning window.

Rollback is a flag flip and takes under a minute, which is why every release must be able to run
against the previous schema. That constraint is the reason migrations are split into an additive
change now and a destructive change two releases later.


Runbook: the gateway is unhealthy

  1. Check the gateway's own health endpoint per region. A single unhealthy region is a routing problem;
    all regions unhealthy is almost always the identity service or its database.
  2. Look at the token introspection latency graph. If it has climbed above 50 ms the cache is cold —
    usually because a key rotation invalidated everything at once.
  3. If the identity database is the cause, fail over to the replica. The runbook for that is in the
    infrastructure repository; it takes about ninety seconds and drops in-flight writes.
  4. If the event bus is lagging, the gateway will shed load by design. Do not disable the back-pressure
    signal to make the graph look better.
  5. Write what you did in the incident issue while you are doing it, not afterwards.

Atlas Platform

The shared services every Qasaur product builds on. Start here: