Advanced
Open
Pro
Naming the Consistency Guarantee
A social app's post-creation flow: POST /posts writes to a primary
Postgres database inside a SERIALIZABLE transaction that also
increments the author's post count. Reads (GET /posts) are served
from an asynchronously replicated read replica that can lag by up to
2 seconds.
- Is the write path linearizable? Is it serializable? Justify both answers separately.
- A user posts, then immediately refreshes their feed (routed to the replica) and does not see their new post. Which consistency property is violated, and is this a bug given the architecture as described?
- What single architectural change would make the read path linearizable, and what does it cost?
Share this question