17 Nov 2026 · Pacific time · spend: 0 US dollars

Multi-region design, per app class

MEASURED we ran it · FROM DOCS vendor page · MY ESTIMATE a guess, stated · NOT TESTED

The 6 answers

1YugabyteDB "write anywhere, copy later"?

Yes, it exists. It silently loses writes.

20 of 20 same-moment updates were lost. No error. MEASURED

Its own docs: "not recommended for YSQL". Keep our design.

Details

2Can quests, groups, friends be class 2?

Yes. All of them. Drop class 3.

Every row has one home. Only small pieces cross.

Left for everyone: public search cards, unique names.

Details

3Will copies cost a ton in transfer?

No. About 5 US dollars a month at 1 million users.

Copy all, 2 landscapes, normal use. Likely 0 inside free allowances.

The real cost is disk: about 200 a month after a year, growing.

Details + calculator

4Cache invalidation?

Read copies need "wait, then tombstone", not just a delete.

Plain delete: 83 keys stuck. Wait-then-tombstone: 0. MEASURED

Class 2 keeps the decided delete-on-write.

Details

5Read-after-write?

Class 2: free. Class 1: a commit token.

No token: 500 of 500 missed their own write. Token: 0 of 500. MEASURED

The library does it. Developers write nothing.

Details

6One card per class

Class 1 one writer. Class 2 home region (default).

Plus one switch inside class 2: "copy all public rows".

See the cards
On this page
  1. YugabyteDB multi-master
  2. Re-cut the classes, feature by feature
  3. Transfer cost + calculator
  4. Cache invalidation
  5. Read-after-write
  6. One card per class
  7. Not tested, vendor check, sources

1 · YugabyteDB: "multi-master, eventual consistency"

Yes, it has one: xCluster active-active. It does not fit us.It swaps slow writes for silent lost writes.

What it is FROM DOCS

Sources: xCluster docs, global app patterns (checked 17 Nov 2026).

What we measured MEASURED

Our Yugabyte spike, 17 Nov 2026. Two regions, 180 ms apart.

TestResult
Copy delay, one way181 ms
Singapore +10 and US +20 on one row, at once0 of 20 rows correct
Balance 100; pay 30 and pay 50 at onceboth "succeed"; both show 70
Same new name claimed on both sidesboth accepted; one claim vanished
Errors the app sawnone

Why writes were slow in the first place

  1. That test kept every row safe from a region loss.
  2. A safe write must reach a second region: 256 ms in Singapore. MEASURED
  3. Yugabyte can keep a row in one region only: 0.8 ms. MEASURED But the row is gone while that region is down.
  4. So you pick per table: fast and not region-safe, or safe and slow. That is physics.
Our Postgres design does not wait for a second region. A home write stays home: about 3 ms. MEASURED Region safety comes from the standby copy instead (cost: about 0.7–3 s of writes on a network cut, MEASURED).

When xCluster two-way would fit MY ESTIMATE

PointYugabyte two-wayOur Postgres copies (B2)
Local writefast, in regionabout 3 ms MEASURED
Same row from 2 regionslast write wins, silentrefused; owner decides
Unique namesnot guaranteed20 of 20 races, one winner
What we runa new database systemPlanetScale / Neon, already chosen

2 · Re-cut the classes, feature by feature

Everything you listed fits class 2: a home region per person or group.Class 3 should not exist.

One rule for all features: each row has one owner landscape. Only the owner writes it.

Others get a copy, fetch it, or send a command to the owner.

Class 2: each landscape owns its rows. Cards are copied, the rest is fetched or sent as a command. Singapore landscape Mia's rows: posts, edges, quest progress, messages copies of US cards writes stay here, about 3 ms US landscape Ben's rows: posts, edges, quest progress, messages copies of Singapore cards writes stay here, about 3 ms cards (copied) fetch / command about 0.2 s
Class 2. Each landscape writes only its own rows.

Who owns what

FeatureWho owns the rowWhat crosses regions
Friendseach person owns their half of the edgethe edge, to the friend's landscape only
Private groupthe group's home landscapeposts and members, only where members live
Public groupthe group's home landscapea small card (name, count, last active), to all
Friend questthe creator's landscapeeach person's "finished" fact
Feedeach post's author's homefriends' posts, fetched per page
Commentsthe commenter's hometo the post's home only
Likesthe liker's homeper-landscape totals
Public searcheach card's ownercards, to all landscapes
Unique handleone directory, one regionone call at claim time
Direct messagesthe sender's homeeach message, to the receiver's home

Which class, and how much crosses

FeatureClassHow much crosses
Friends2a few rows per friendship
Private group20 bytes if all members are local MEASURED
Public group2 + cardcard updates, batched every 250 ms MEASURED
Friend quest2about 7 messages, 3 KB per quest MEASURED
Feed2one fetch per page, about 184 ms MEASURED
Comments2one row per comment
Likes244 messages for 4,950 clicks MEASURED
Public search2 + cardone card per person or group
Unique handledirectoryone call per claim, about 190 ms MEASURED
Direct messages2one row per message

What is left for "every region writes the same thing"?

Final class list MY ESTIMATE

ClassForIn one line
1 One writerread-mostly appsone primary, read copies everywhere
2 Home regioneverything else (the default)your data at home, plus a small sharing kit
2 + "copy all public rows"apps needing rich search or feeds over everythinga switch, not a class: B2 copies of all public tables

Class 2 sharing kit (the developer declares; the library does it):

  1. Card: copied to every landscape by the database.
  2. Fetch: read a far thing through your own landscape. 184 ms cold, 0.1 ms cached. MEASURED
  3. Command: ask the owner for a one-answer decision. Exactly once. MEASURED
  4. Directory: unique names.

3 · What does data transfer really cost?

Not much. Database copies cost single or low double digits of US dollars a month at 1 million users.The real cost of "copy all" is disk, not transfer.

Prices, fetched 17 Nov 2026 FROM DOCS

ItemUS dollars per GB
AWS Singapore → other AWS region0.09
AWS US East → other AWS region0.02
AWS Singapore → internet (first 10 TB)0.12
AWS US East → internet (first 10 TB)0.09
PlanetScale egress, Asia0.096
PlanetScale egress, US East0.06
PlanetScale cross-region read copy, Singapore0.11
Neon egress, after the free amount0.10
ItemFree amount
AWS internet egress100 GB a month, whole account
PlanetScale production database100 GB a month
Neon paid project500 GB a month (database copies count)
Cloudflare R2egress always free
Tigrisegress always free
Upstash (pay as you go)200 GB a month, then 0.03 per GB

Disk: Neon 0.35 US dollars per GB a month. FROM DOCS

The model (every assumption)

InputValueTag
Wire bytes per copied row, per peer360MEASURED
Disk bytes per copied row400MY ESTIMATE
Daily users ÷ monthly users0.3MY ESTIMATE
Far reads already in your region50 %MY ESTIMATE
Far reads that miss the 30 s cache50 %MY ESTIMATE
Bytes per fetch4,000MY ESTIMATE
Searches per daily user per day2 (8,000 bytes each)MY ESTIMATE
Price per GB (worst list price)0.12FROM DOCS
ActivityPublic rows written per user per monthFar reads per daily user per day
Light3010
Normal12040
Heavy1,200200

Results, normal activity, US dollars per month (transfer)

2 landscapes

Monthly usersCopy allSmall surfaceCopy nothing
10,0000.050.220.39
100,0000.522.173.89
1,000,0005.1821.7338.88

3 landscapes

Monthly usersCopy allSmall surfaceCopy nothing
10,0000.100.290.63
100,0001.042.916.34
1,000,00010.3729.0663.36

Same in GB per month, 2 landscapes

Monthly usersCopy allSmall surfaceCopy nothing
10,0000.41.83.2
100,0004.318.132.4
1,000,00043.2181.1324.0

GB per month, 3 landscapes

Monthly usersCopy allSmall surfaceCopy nothing
10,0000.92.45.3
100,0008.624.252.8
1,000,00086.4242.2528.0

Heavy activity, 1 million users: copy all 52 (2 landscapes) or 104 (3); copy nothing 125 or 179 US dollars a month.

Extra disk for the copies, after one year (US dollars per month)

Monthly usersCopy all, 2 landscapesCopy all, 3 landscapesSmall surface, 3 landscapes
10,000240
100,00020400.03
1,000,0002024030.28
Try it: same model as the tables
GB a month across regions
US dollars a month, transfer
US dollars a month, extra disk after 1 year

Where the money really goes

  1. Disk for copies ("copy all"). It grows every month. At 1 million users after one year it is about 40 times the transfer cost.
  2. Fetching moves more bytes than copying. People read far more than they write. Still small.
  3. One-time copies. Adding a landscape, or a resync after a region loss, sends all public data once. 1 million users, one year: about 518 GB, about 62 US dollars. MY ESTIMATE
  4. Photos and video are not in this. They go through Tigris or R2: 0 egress. Never copy files between regions.
  5. Answers sent to phones cost the most, but every class pays that, single region too.
  6. Class 1 read copies stream the whole database log: about 1.6 KB per write (19 MB a minute at 195 writes a second MEASURED). PlanetScale charges 0.11 per GB for that in Singapore, with no free amount.

How to cap it

  1. Default to the small surface. Turn on "copy all" only when the app needs it.
  2. Copy a time window, for example the last 90 days of posts. Fetch older ones.
  3. Row filters and column lists keep private rows and columns home. MEASURED
  4. Alert on egress per database and on held-back log per copy link.
  5. Stay inside free amounts: 100 GB (PlanetScale), 500 GB (Neon) per database.
Your worry, "a ton for data transfer": not for database copies. Watch disk instead, and never copy media. MY ESTIMATE from MEASURED bytes and today's prices.

4 · Cache invalidation

Keep the decided rules. Add one thing for read copies: each region waits for its own copy, then sets a versioned tombstone.A plain delete is not enough when the cache fills from a read copy.

Already decided (design corpus)

The trap with read copies (class 1)

Timeline: the delete arrives before the read copy has the new row, so the cache refills with the old row. Primary (region Y) Cache (region X) Read copy (region X) 1 write v2 2 delete 3 fill reads v1 4 stores v1 5 copy gets v2 old v1 stays until TTL
Plain delete-on-write with a read copy. Step 4 puts the old row back.

Local proof MEASURED

17 Nov 2026. Postgres 17.6 primary + read copy that applies 300 ms late. Valkey 8 as region X's cache. Own containers, removed after.

Event to region X after 90 ms. 50 writes a second, 8 readers, 80 % of traffic on 20 hot keys. 20 s per strategy.

StrategyReads stale over 1 sKeys stuck after settlingCache misses
TTL only (30 s)54,996117208
Delete on write12,461831,216
Wait, then delete001,199
Versioned tombstone0017,837
Wait, then tombstone (run 2)001,177

Each run: about 63,000–67,000 reads, about 900 writes. Run 2 repeated delete-on-write (12,228 stale, 77 stuck) and tombstone (0, 0, 17,805 misses).

The strategies in plain words

StrategyWhat it doesVerdict
TTL onlywait for expirywrong for up to the TTL
Delete on writedelete when the event arrivesrefills from the late copy
Wait, then deletedelete only once the local copy has the writeworks; needs a waiter per region
Versioned tombstone at oncemark "needs version N"; older fills are refusedworks; about 15 times more cache misses
Wait, then tombstoneonce the local copy has the write, mark "needs version N"works, normal load: pick this

Class 1 rule (proposed)

  1. Every write sends (key, new version, database position). The library does it from the outbox.
  2. A small waiter in each region checks its own read copy's position. Measured wait: about 215 ms after the event, for a 300 ms copy delay. MEASURED
  3. Once the copy has the write, the cache gets a tombstone: "this key needs version N or newer".
  4. A fill is stored only if it is not older (the decided versioned-fill script). This blocks a slow fill that read the old row.
  5. Single-flight per key (decided) keeps a hot key from flooding the copy.
  6. TTL stays as the backstop. If the waiter cannot reach the copy for 5 s, it sets the tombstone anyway.

Who clears region X's cache when region Y wrote?

ClassWho clears it
1the write event (tombstone), sent to every region
2, own datanobody else: only the home caches it; delete on write
2, fetched far data30 s TTL, plus the owner's change event (unfriend hid data 283 ms later MEASURED)
2, copied cardsa database trigger on copy apply, or no cache at all (local read is 0.4–9 ms MEASURED)

Per store

StoreClass 1Class 2
Cache (Upstash)per region; tombstones from the write eventper landscape; own data
Key-value (Upstash)one primary; fresh reads go to itper landscape, never synced
Files (Tigris / R2)new name per upload; nothing to clearsame
CDN (public docs)60 s header + purge twice (decided)same

Upstash Global read regions bill each copied write as a command: 100K writes with one read region = 0.4 US dollars. FROM DOCS

5 · Read-after-write

Class 2: nothing to do for your own data. Class 1: a commit token.The library does both. Developers write nothing.

Database level

FixHowCost
Commit token (pick this)keep the write's database position; read the copy once it has passed itwaits about the copy's delay
Route to primary for N secondsafter a write, this session reads the primaryfar reads (about 180 ms) for N seconds
Synchronous apply on copiesevery commit waits for far copiesevery write pays the ocean again
Pin the sessionkeep a person on one databasedoes not help across regions

Local proof MEASURED

A person in region X writes (through the primary), then reads their own row at once. Copy applies 300 ms late. 500 runs each.

Read pathOwn write missing (of 500)Wait, middleWait, slowest 1 %
No token500n/an/a
Token, position checked in the same statement3305 ms311 ms
Token, position checked first, then read0304 ms311 ms

0 fallbacks to the primary were needed (limit 1 s).

Lesson MEASURED: check the copy's position in its own statement, then read. Checking inside the same statement as the read let an older snapshot through.

Per database

DatabaseRead-after-write toolTag
Postgres 17 / 18 (PlanetScale, Neon)compare the copy's replay positionMEASURED (17.6)
Postgres 19a built-in WAIT FOR LSN commandFROM DOCS (development docs)
PlanetScaleread copies only with the "replica" login suffix, not via its poolerFROM DOCS
YugabyteDBnormal reads are always fresh; follower reads are old by a set boundMEASURED
B2 copies (class 2 cards)the copy's progress per source landscape vs the writer's positionNOT TESTED

Cache level

FixHow
Write-through in the writer's regionafter commit, put the new version in the local cache
Bypass windowthe writer's session skips the cache for keys it just wrote
Version stampsthe session keeps "min version"; an older cached value counts as a miss

Per class

ClassYour own write, then readSomeone else's write
1commit token + version check in the cacheafter about the copy's delay
2free: you read where you writeabout 0.1 s plus distance (93 ms with 90 ms added MEASURED)
2, command to a far ownerthe answer goes into your local view at oncesame

What the developer writes: nothing. The library returns the token in a response header. The app sends it back. The read path checks it.

6 · One card per class

Class 1 · One writer

PartDesign
Databaseone primary; read copies in each region
Cacheper region; versioned tombstones from the write event
Key-valueone primary; fresh reads go there
Filesone bucket; new name per upload; served by the CDN
Migrationsonce, on the primary
Read-after-writecommit token
Transfer costwhole log to each copy region, about 1.6 KB per write
Developer writesnothing extra
Testedcache + token MEASURED locally; vendor copies NOT TESTED

Class 2 · Home region (the default)

PartDesign
Databaseone per landscape; public cards copied (B2)
Cacheper landscape, own data; fetched data 30 s
Key-valueper landscape, never synced
Filesbucket per landscape; read anywhere via the CDN
Migrationsper landscape; copied tables: add first, remove later
Read-after-writefree for your own data
Transfer cost1 million users, normal: about 22 (2 landscapes) to 29 (3) US dollars a month
Developer writesdeclares each table: private, card, fetch or command
Testedcopies, commands, fetch MEASURED locally; real vendors: separate check

Class 2 with "copy all public rows"

PartDesign
Databaseevery public row copied to every landscape (B2)
Transfer cost1 million users, normal: about 5 (2 landscapes) to 10 (3) US dollars a month
Disk costabout 200 (2) to 400 (3) US dollars a month after one year, growing
Limitabout 5 landscapes (every pair needs its own link)
Why pick itplain SQL search, joins and feeds over everything

Not tested, vendor check, sources

Not tested

Real-vendor check

Running. A separate check is testing database copies both ways on real PlanetScale and Neon (your "confirm this"). Its result was not ready when this page was published. Until then, every vendor line here is FROM DOCS.

Sources (fetched 17 Nov 2026)