Multi-tenant mode (MTM)
By default every organization writes into one shared bucket. A larger install often wants more separation: one bucket per organization, so a quota, a lifecycle rule or a leaked URL only ever touches one tenant. Microwave Server calls the strict form multi-tenant mode (MTM).
MTM comes in two strengths:
- Per-organization buckets — an organization opts in with one map entry. Every other organization keeps using the shared bucket.
- Multi-tenant mode (MTM) — every organization must have its own bucket. The shared bucket is gone, so there is no silent fallback to the wrong target.
Both work against any plain S3 endpoint (AWS S3, Garage, MinIO). Bucket creation, quota and lifecycle stay with your own tooling; the server only routes, signs and probes.
What you need
Before you start, have the following ready:
- the
s3orgaragebackend — the map and MTM are rejected withlocal, - one bucket per organization, named with lowercase letters, digits,
-and., 3–63 characters, no leading or trailing-or., - a key pair per organization with
HeadBucket,PutObject,GetObjectandDeleteObjecton that bucket, - a health bucket for
/_statusin MTM, - an endpoint both the server and the clients can resolve.
The bucket name is the only per-organization value you configure; the key pair
never enters the config file. It lives in the secret store as
object_store.<org>.access_key and object_store.<org>.secret_key.
MTM and object quotas complement each other: the buckets hold the blobs, the quotas cap the metadata rows. Neither requires the other.
The smallest strict configuration looks like this:
[object_store]
backend = "garage"
endpoint = "https://cookbooks.example.com"
region = "garage"
path_style = true
require_org_bucket = true
health_bucket = "mw-health"
# no shared `bucket` in MTM
region, path_style and the shared credentials fall back to the global
values; every organization still needs its own bucket entry and both secrets.
The field reference is in
Deploying Microwave Server; this page stays on
the workflow.
Turning on multi-tenant mode
-
Create the health bucket and one bucket per organization with your own tooling.
-
Store the key pairs:
microwave-ctl set-secret object_store acme.access_key GK-acmemicrowave-ctl set-secret object_store acme.secret_key ... -
Add the entries and the strict block above to the configuration. Leave the shared
bucketout. -
Run
microwave-ctl check-config. It names every missing entry, missing secret, invalid bucket name and duplicate target before anything restarts. -
Start the server. On the way up it sends one
HEADper bucket; a bucket it cannot reach stops the start.
With verify_buckets = false the probe is skipped, so a typo surfaces on the
first request instead.
An empty organization table is fine, so a fresh strict install starts even
before the first tenant exists. The first org-create then needs its entry and
secrets immediately; the command prints the new organization id and the missing
steps.
Giving a single organization its own bucket
Outside MTM, prepare the bucket and credentials as above, add the map entry, and reload:
[object_store.organizations."acme"]
bucket = "mw-acme"
An entry without its own key pair inherits the shared keys. Hand out a separate pair where it matters: presigned URLs are signed with the tenant key, so a leaked URL stays inside that one bucket.
If you later turn on require_org_bucket, add an entry and both credentials for
every organization first. Until then they still use the shared bucket.
Applying a change without a restart
Configuration, map entries and secrets all apply live, through
microwave-ctl reload or a SIGHUP to the server. The reload builds and
probes the whole object-store block before it swaps; a rejected reload keeps
the previous routing and says so in microwave-ctl diagnostics.
The key layout does not change: organization-<org_id>/checksum-<md5> inside
every bucket. Keys and checksums never reach the log.
Moving an existing organization
The copy is not quiesced, so plan on two passes:
- Create the bucket and credentials,
set-secretthem and add the entry. - Copy
organization-<org_id>/from the shared bucket to the new one. - Reload. The organization routes to its own bucket with MTM still off.
- Copy again to catch writes that landed on the shared bucket in between.
- Turn on
require_org_bucketonly when the second copy is clean, then reload.
A rollback is the same copy in reverse before you turn on the flag; without it existing downloads break.
When something fails
- An organization without a bucket answers
500 NoOrgBucketand fails without writing into the shared bucket. Add the entry and credentials, then reload. check-configanddiagnosticslist missing entries, missing secrets, invalid names and duplicate(endpoint, bucket)pairs.- An entry for a deleted organization is only a warning on the server and stays
inactive;
check-configanddiagnosticsreport it andreloadrefuses to signal until it is removed. - A bucket that answers the startup
HEADwith403is usually a key withoutHeadBucket. Widen the key or setverify_buckets = falsewhile you fix it.
Deleting and re-creating an organization
Deleting an organization leaves its bucket and objects in place. The
organization id is part of the key prefix, so re-creating the same name
gets a new id and a new prefix: the old blobs stay where they are and the new
organization does not see them. org-create prints the id so your tooling can
move or clean them up.