A call recording in Colombia, its transcript in Brazil and an agent’s record in the United States have different legal rules. All three live in Qomni. The design question was where to store them, and the answer defines almost everything else: one cell per country.
The problem
A single database for the whole world is the simplest option to operate. It forces you to pick one country for every customer’s data and to explain that choice to each of them. With voice recordings and customer conversations, that explanation does not always convince.
The usual alternative is one region per customer, chosen at sign-up. It puts the decision in the hands of whoever has the least context. And it makes it show up everywhere: in the API URL, in the client’s configuration, in every SDK.
What we did
Every workspace is born in a cell (us1, co1 or br1): a complete copy
of the platform in one region. In front of all the cells there is a single
entry point, the edge, a Cloudflare Worker that receives every request
and takes it to the right cell.
The cell never appears in a URL. It goes inside the API key
(sk_agents_live_co1_…), and the edge reads it from there without looking anything up. For
the web app, it comes from the workspace you signed in to. Your code is the
same for a customer in Bogotá and for one in São Paulo.
What it cost
- An origin cannot trust anyone but the edge. That is why the edge signs every request with an Ed25519 token. It is valid for 10 seconds, serves a single request and is bound to the host, the cell and the client’s IP. An origin rejects anything that does not carry that token, so nobody can skip the edge by calling a cell directly.
- A key is only valid in its cell. Using it in another one responds
421 wrong_cell. In practice it does not happen, because the key’s cell is the one of the workspace that created it, but the rule exists so that a configuration mistake never crosses data between countries. - Data does not move. A workspace stays in its cell. Moving one would mean moving customer recordings from one country to another, and we would rather not have that tool than have it and use it badly.
What we gained
Complying with each country’s rules is a property of the architecture, not a process. A request travels less. And a customer never has to choose a region or remember it.
If you want to see the full journey of a request, it is in The edge and the cells.
Get a note with every new post
One engineering note each time we publish; nothing else.