multi-region-active-active
Skill0 starsChanged 5 months agoApache-2.0View on GitHub
Design multi-region and active-active systems — data-plane
In this repository128 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibility-implementationSkill
- accessibility-reviewSkill
- api-changelogSkill
- api-designSkill
- auth-designSkill
- caching-strategiesSkill
- chaos-experiment-designSkill
- ci-cd-pipelinesSkill
- cli-designSkill
- cloudformation-reviewSkill
- codebase-orientationSkill
- code-commentsSkill
- code-reviewSkill
- commit-messagesSkill
- container-reviewSkill
- database-indexingSkill
- database-migrationsSkill
- debuggingSkill
- dependency-upgradesSkill
- design-system-contributionSkill
- design-tokensSkill
- desktop-releaseSkill
- error-handlingSkill
- feature-flagsSkill
- finops-reviewSkill
- frontend-performanceSkill
- git-conflict-resolutionSkill
- graphql-schema-designSkill
- helm-chart-scaffoldingSkill
- i18n-reviewSkill
- kubernetes-reviewSkill
- load-test-planningSkill
- logging-observabilitySkill
- message-queue-designSkill
- migration-playbooksSkill
- mobile-releaseSkill
- observability-alertsSkill
- openapi-spec-designSkill
- partner-api-integrationSkill
- performance-reviewSkill
- pr-descriptionsSkill
- prompt-injection-hardeningSkill
- pulumi-reviewSkill
- rate-limitingSkill
- refactor-planningSkill
- secrets-managementSkill
- security-reviewSkill
- sql-query-reviewSkill
- terraform-reviewSkill
- test-generationSkill
- threat-modelingSkill
- webhook-designSkill
- websocket-designSkill
- ab-test-analysisSkill
- anomaly-detectionSkill
- cost-anomaly-investigationSkill
- csv-analysisSkill
- data-cleaningSkill
- data-contract-designSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 50
Gaps: Every unverified lag, RPO, TTL, or vendor claim.
- Distinctive: line 88
Never invent measured RPO/RTO, replica lag, DNS TTL, or last failover evidence.
- Distinctive: line 90
Never invent vendor replication syntax, cluster flags, or "just enable Aurora Global / Spanner / Cockroach multi-region" as a substitute …
- Distinctive: line 93
Never claim RPO 0 without a synchronous path and its cost (commit latency, availability coupling).
- Distinctive: line 95
Never treat DNS as instant failover.
- Distinctive: line 97
Never use wall-clock last-writer-wins for money, inventory, or unique constraints.
- Distinctive: line 102
If they die with the site, the "active" replica cannot serve.
- Distinctive: line 104
Do not silently copy them "for HA".
- Distinctive: line 117
"Just make the database global": ask which keys may be written in two regions at once.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Multi-Region Active-Active
Compute is easy to put in two regions. The data plane is the design. Active-active is a consistency, conflict, and steering problem — not a replica count.
Restore-from-backup and "can we restore" are disaster-recovery. Live
region-down command is incident-command. Manifest probes, PDBs, and
YAML are kubernetes-review. Availability wording alone is
sla-slo-writing. Fault-injection hypotheses are chaos-experiment-design.
Workflow
- Why multi-region. Latency, residency, or availability. These pick different topologies. "All three, RPO 0, no app changes" is not a design — it is a wish.
- What is written where. Classify each store: session, identity, catalog, inventory, money, audit. Reads everywhere is cheap. Dual writers on the same row is not.
- Pick a topology and say why (see below). Default is home-region writes, not "any region writes any key".
- Data plane per store. Replication direction, lag tolerated, uniqueness / money / inventory owner, cache as local only.
- Conflict policy in one sentence. LWW loses data. CRDTs only for mergeable types. Business merge (cart, stock) needs explicit rules. Silence is a defect.
- Steering. How a client finds a region, how it stays after a write (read-your-writes), what health check removes a region.
- Failure + failback. Region loss, inter-region partition (split-brain), stale replica, poison global config. Failback names the source of truth.
- Gaps. Every unverified lag, RPO, TTL, or vendor claim.
Topologies (pick one)
| Shape | Writes | Honest cost |
| Active-passive | One writer region | Failover is a cutover; often a DR event |
| Read-local / write-primary | All writes go home | Replica lag; pin after write |
| Home-region (partitioned AA) | Each key has a home | Best real-world AA; forward foreign writes |
| True multi-primary | Any region, any key | Consensus tax or defined data loss |
Output format
## Multi-region design: <system>
**Goal:** latency | residency | availability (pick; rank the rest)
**Topology:** active-passive | read-local | home-region | multi-primary
**Why this shape:** …
### Data plane
| Store | Writer | Replica | Lag tolerated | Conflict / uniqueness | Residency |
### Client path
Steering, sticky-after-write, health that removes a region.
### Failure
| Event | User-visible | RPO accepted | Who fences the writer | Failback source of truth |
### Do not
…
### Gaps (unverified)
- …Rules
- Never invent measured RPO/RTO, replica lag, DNS TTL, or last failover evidence. Ask or mark UNVERIFIED.
- Never invent vendor replication syntax, cluster flags, or "just enable Aurora Global / Spanner / Cockroach multi-region" as a substitute for naming the consistency model.
- Never claim RPO 0 without a synchronous path and its cost (commit latency, availability coupling). Async replica = nonzero RPO.
- Never treat DNS as instant failover. Resolvers cache; name the TTL and the fallback (anycast, app redirect, or accept minutes).
- Never use wall-clock last-writer-wins for money, inventory, or unique constraints. Clocks skew; LWW drops a write.
- Caches and CDNs are not sources of record. Region-local cache after a remote write is a stale-read bug unless pinned or invalidated.
- Identity, IdP, KMS, and DNS are often a hidden single region. If they die with the site, the "active" replica cannot serve.
- Data residency: some rows cannot leave a region even in failover. Do not silently copy them "for HA".
- Split-brain: if both regions can write the same keys during a partition, require fencing (lease, quorum, or disable writes).
- Restore drills →
disaster-recovery. YAML →kubernetes-review. Live outage →incident-command.
Good: tenant_id 0–49 home eu-west-1, 50–99 home us-east-1;
foreign writes forwarded; unique email enforced in the home region.
Bad: "active-active Postgres in both regions, last write wins,
Route53 will fail over instantly."
Edge cases
- "Just make the database global": ask which keys may be written in two regions at once. If the answer is "all of them", you do not have a topology yet.
- Read-your-writes after signup: pin the session to the writer region or read from the primary until lag is known.
- Global uniqueness (email, SKU, handle): one owner region or a reservation protocol. Dual INSERT is a race, not HA.
- Inventory / balances: reservation or single writer. Do not decrement stock independently in two regions.
- One AZ vs one region: multi-AZ is not multi-region. Do not upgrade the claim.
- SaaS with no cross-region export: vendor RPO is a claim;
require their evidence (
disaster-recoveryfor restore proof). - "Are we active-active?" with async replicas and one writer: say no; name the actual shape (read-local or active-passive).
- Region is on fire now: hand the bridge to
incident-command.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

