Preparing your design workspace

Loading the problem and your latest saved attempt…

Design a Region-Aware User Record Store

Design a replicated user-record store that supports point access, regional pagination, and safe region changes at read-heavy scale.

Problem statement

For this exercise, assume clients create or update a user record by globally unique user_id, fetch one user by ID, and page through users assigned to one region.

The store holds 50 million user rows and must make user_id lookups and region-filtered scans efficient while supporting sharding, partition pruning, and replication.

Every update supplies an expected record version, a successful write is read-your-writes by user_id, and a region change is one logical versioned mutation rather than a delete followed by an unrelated create. Acknowledged data must survive one replica failure, and retries must return one durable outcome.

Design the data model, indexes, APIs, partition and shard strategy, replica topology, consistency boundary, region-move workflow, rebalancing, failure recovery, and observability. Authentication, profile-media storage, analytics, recommendations, and cross-region data-sovereignty policy are outside scope.

What to build

  1. A client can idempotently create or update a user record by user_id using an expected version and receive one authoritative versioned outcome.
  2. A client can fetch the current user record by globally unique user_id with read-your-writes behavior after a successful update.
  3. A client can page through a stable, bounded ordering of users assigned to one region without scanning unrelated regions.
  4. A client can change a user's region as one versioned mutation without making two active copies or losing the record during retries or replica failure.

At scale

  • For this exercise, assume 50 million active user rows distributed unevenly across regions.
  • For this exercise, assume peaks of 20,000 point reads, 2,000 writes, and 500 regional-page reads per second.
  • For this exercise, target 200 milliseconds p95 for healthy point and first-page reads and 99.95 percent monthly API availability.
  • For this exercise, acknowledged records and their versions must survive one replica failure, and capacity can be added without changing the client contract.