انتقل إلى المحتوى
#0437
Containers

Signup picks the server

A customer signs up and ticks "EU". Your provisioning code does one thing with that checkbox: it sets target_server_id.

POST /api/v1/containers/{template}/copy with the customer's project and the Frankfurt server's ID, and the customer's container comes up on that machine, from the same template every other customer gets. Tick "US" and the ID points at the New York box. The application code is identical on both. There is no region column in the users table, no conditional storage client, no feature flag deciding which bucket to write to.

On a shared-database SaaS, residency is a branch in every code path and a bucket per region. Here it is the address of the machine a container was copied to, a fact the platform holds rather than one your code has to remember.

The region is an argument to a copy, and the app never learns it.