Skip to content
PlatformMarkdown

Multi-site realms

Serve one realm from more than one site, each taking sign-ins and changes, all converging on the same realm.

AvailableAPI

A realm can be served from more than one site at once, for nearness to your users or to keep running when a site is lost. Every site takes sign-ins, issues tokens and accepts changes, and each change made at one site reaches every other. Your users, groups, apps, sessions, keys and settings are the same wherever a request lands.

There is nothing to switch on per realm: a realm is served from every site that serves your realm. What you choose is how users reach it, usually with a host name at each site.

  • Which sites, and where. The sites that serve your realm, and the regions they’re in, are agreed with Cvyūh when your realm is set up. Ask your Cvyūh contact to confirm them; no API lists them.
  • Privilege: none to use it. Giving the realm a host name at each site needs DELEGATE over the realm’s parent: see Host names.
  • Where: host names through the API; nothing else to set.

A change takes effect at the site that took it, and reaches the other sites in the background, encrypted on the way, usually within seconds. Until it arrives, the other sites answer from what they have.

WhatWhere it is
Users, groups, apps, policies, settings, host namesEvery site
Sessions, revocations, lockouts, one-time codesEvery site
Signing keys, storage keys, secretsEvery site
TLS certificates for the realm’s host namesEvery site
A sign-in in progressThe site where it started, until it finishes
The audit trailEach site keeps its own records of what it did

When two sites change the same thing at nearly the same moment, the later change wins. The earlier one is recorded, and Cvyūh can retrieve it on request. A deletion can’t be undone by an older change arriving late.

Every site already serves the realm, so there is no failover to wait for: the other sites keep taking sign-ins, issuing tokens and accepting changes. Users who reached the lost site by its own host name reach the realm at another site’s host name. What a user may notice:

  • A sign-in in progress at the lost site has to start again.
  • A change the lost site took in the seconds before it went, and hadn’t yet passed on, reaches the others only when that site returns.

Cvyūh doesn’t publish a recovery time or recovery point objective yet.

Give the realm a host name at each site, listing them all in its host names. If apps should see one issuer whichever site they reach, set a base URL. The guide Sign in at either site walks through it.

WhatDefaultCan it change
Time for a change to reach the other sitesUsually secondsNo
Time for a suspension to reach every siteUp to about a minuteNo
Sites a realm’s data is kept atEvery site that serves itChoosing sites per realm is planned
Recovery time and recovery point objectivesNot publishedNo
  • A user is asked to sign in again at the other site. Their session hadn’t reached it yet. It arrives within seconds; until then, the other site doesn’t know the session.
  • A change you just made doesn’t show in a read. The read was answered by another site. Read through the host name of the site you wrote at; see Read your own writes.
  • A refresh fails at the other site. Each host name is its own issuer unless you set a base URL, and a token refreshed under another host name than it was issued under is refused (invalid_grant). Set a base URL.
  • A one-time code was accepted twice. Each site spends a code at once, and the others once its first use has reached them, usually seconds. Keep a sign-in at one site.

Each site writes its own records of what it did, so a trail read at one site shows what that site recorded. To read every site’s records, make the same read on the host name that reaches each site and merge the answers by eventTime: see Read every site’s records. There’s no record of a change moving between sites.

  • A sign-in finishes where it started. A sign-in begun at one site can’t be finished at another.
  • A sign-out, a revoked token or a removed app takes effect at the other sites when it reaches them.
  • A realm doesn’t see the sites themselves. There is no realm API for which sites run or how far behind each is.

See What’s next for sites: data residency, and reading your own writes at every site.