Multitenancy
sxs is a multi-tenant, multi-space SDMX endpoint: one running deployment can
serve many independent tenants, and inside a tenant many isolated workspaces.
Each (member, space) pair is fully separated — its own structures, datasets and
metadata — so tenants never see each other's data.
Principle
Terminology:
- a member (also called a tenant) is an organisation using the platform;
- a space is an isolated workspace inside a member (for example
collect,disseminate,qa-stable).
Isolation is physical: every (member, space) pair has its own databases.
Nothing is shared between them.
A member that has no space is itself a single tenant, stored in a member-level database:
This is exactly the .stat Suite model, where the tenant is injected upstream
(by the Proxy / config layer) on every request rather than chosen by the API
consumer.
How a request selects a tenant and a space
The space is the first segment of the request path. The member is injected by the proxy (or explicitly provided).
For example:
The member is resolved, in order, from:
- the
memberquery parameter (?member=orox); - the
x-memberrequest header; - the
tenantquery parameter or thex-tenantheader; - the
DEFAULT_MEMBERenvironment variable.
In a typical deployment the proxy injects the member (header or query) based on
the incoming host or user, so consumers only deal with /{space}/... URLs.
Where the configuration lives
Members and spaces are declared in a single tenants.json document served by the
config service (Confy) at {CONFIG_URL}/configs/tenants.json. It is keyed by
member id:
oroxhas two spaces → two isolated database pairs.mroxhas nospaces→ it is a single member-level tenant.
Each space carries its own properties (label, languages, access modes, feature flags). Read and write access are configured per space — see Authorization.
Loading and refreshing
- At boot sxs loads
tenants.jsonand keeps it in memory. If the config service is unreachable at boot, sxs fails to start. - At runtime the cache is refreshed:
- on the
configs.tenants.updatedevent pushed through the message broker, and - periodically (every 10 minutes) as a safety net.
- on the
- Editing an existing member or space (access, settings, feature flags) is picked up without a restart.
- Adding a new member or a new space should be done with a restart, so sxs creates and ensures the databases and indexes at boot.
How to use it
Add a space
Add an entry under the member's spaces in tenants.json, then define its
access:
Scope settings to a space
Any space-level setting (worker thresholds, formats, validation, …) is written as a property of the space object:
See Settings for the resolution order and the full reference.
Point a consumer at a space
Consumers always address a space by its id in the path: /{space}/sdmx/.... The
proxy (or the caller) supplies the member so the same deployment serves every
tenant.
Verify the loaded tenants
The health endpoints report the tenant cache (last update time and count). For
example GET /ready (or /healthcheck) returns a tenants section:
See also
- Settings — how space-level settings are resolved.
- Authorization — controlling access per space, agency and dataset.
- Configuration and settings —
CONFIG_URL,DEFAULT_MEMBERandMONGODB_DATABASE.
