Subscribe free
Morning Merge Architecture · Friday, November 20, 20263 min read

PostgreSQL 19 lets reads wait for replica replay

"Also: Zerodha's SQLite blob store, Iceberg V4, Aurora VPC moves"

PostgreSQL 19 lets standbys wait until a write is replayed before serving a read. If you route reads to replicas, check which follow-up queries you still pin to the primary.

The main thing

A fuchsia drafting compass spans two racks of stacked ledger blocks.

PostgreSQL 19 gives standby reads a way to catch up. You save a user's settings on the primary; the next request reads from a replica and shows the old settings.

You can send both requests to the primary, or run WAIT FOR LSN in the standby session before querying. The command waits for the standby to replay the write-ahead log through a specified log sequence number.

Pass a position that covers the committed write, and the follow-up read can see it without going back to the primary. The trade-off moves into the request path. A replica that's behind will make the caller wait, and the app needs to carry the log position from writer to reader.

Put the wait on reads that promise to show the user's own change, and leave reads that tolerate stale results alone. If you're sizing a primary around read-after-write traffic, test one path with replica lag in staging. Measure how much time the wait adds at the tail.

Then decide when you'd rather fall back to the primary. Test that fallback under load, too: when a replica falls behind, a lot of callers can make the same decision at once.

Two other reasons to plan the upgrade: REPACK (CONCURRENTLY) reclaims table bloat while reads and writes continue, and creating the first logical replication slot can raise the effective WAL level without a server restart.

Rehearse repacking a churn-heavy table and watch disk headroom and replica lag before you schedule production work.

Storage under load

A fuchsia drawer slides from a cabinet beneath a drafting compass.

Zerodha runs a distributed blob store on SQLite. The team wanted to keep its existing Redis clients while replacing SSDB, a single-node store it says struggled with larger blobs. It built Blobasaur, a Rust server that speaks the Redis protocol, shards data across nodes and uses SQLite as its storage engine.

Zerodha reports single-digit millisecond latency at thousands of reads and writes per second on commodity hardware. That's on its workload of frequently overwritten, compressible settings blobs. If your workload looks similar, reproduce the overwrite and expiry mix and test what happens when a shard is unavailable.

Iceberg V4 proposes a shorter path to commit. At QCon, Iceberg co-creator Daniel Weeks described a metadata tree that can point directly to data files, replacing several I/O operations for a file addition with one metadata write. He says that could make subsecond commits practical. It's a proposal, and older readers can't consume the proposed metadata. Check reader compatibility before budgeting for faster ingestion.

Moving without rebuilding

A fuchsia rail carriage moves stacked modules between two foundations.

Aurora clusters can move to another VPC. AWS says the cluster endpoint and data stay put while connectivity drops briefly. Moving out of an overlapping address range no longer means copying the database. You'll still need to turn off VPC-bound features such as RDS Proxy and Aurora Global Database before the move, then set them up again afterward.

GKE previews in-place Dataplane V2 migration. Eligible VPC-native clusters can move to Google's eBPF and Cilium dataplane without building a parallel cluster. The nodes still get recreated, so check spare Pod IPs and maintenance windows first. Routes-based clusters and clusters running Calico aren't supported; rollback is available before finalization.

Route 53 can health-check private endpoints. Private hosted zones can use managed health checks for DNS failover instead of a custom alarm-and-Lambda loop. AWS designed detection and DNS failover to take seconds rather than minutes. Time it from a real client, too: a DNS record can change while the client is still using a cached answer.

← All Morning Merge Architecture issues

Get this in your inbox every morning.

Free. Five minutes. Unsubscribe in one click.

Subscribe free →