Design Cross-Region Replication With Read-Your-Writes for Profile Edits
Last updated: November 29, 2026
Quick Overview
Design how Facebook profile data stored in a primary region is replicated to read replicas worldwide, while guaranteeing that a user who edits their profile immediately sees their own change.
Meta
November 29, 20260
0
0 solved
Design how Facebook profile data stored in a primary region is replicated to read replicas worldwide, while guaranteeing that a user who edits their profile immediately sees their own change.
Meta serves reads from replicas in many regions with writes going to a primary, so stale reads after writes are a well-known problem. Interviewers want concrete mechanisms such as write markers or version tokens rather than 'use strong consistency everywhere'.
What the Interviewer Expects
- Explain async primary-replica replication and lag
- Define read-your-writes and monotonic reads
- Propose a version token or recent-write marker
- Handle cache invalidation alongside replicas
- Discuss the cost of routing reads to the primary
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How does this work if the user's next request lands in a different region?
- What do friends see, and is that acceptable?
- How long do you keep the marker?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Requirements
Functional: edit profile fields; the editor sees the change on every subsequent read; others see it within seconds.
Non-functional: reads served locally in most regions; replication lag usual...
High-Level Design
Writes go to the primary database for the user's shard (possibly in another region). Replicas in each region apply the binlog asynchronously. A cache tier in each region sits in front of the replicas....