Secondary index service
Your task
Design a secondary-index service for a sharded primary key-value store (sharded by user_id) that must answer queries by non-key attributes, 'all orders with status=PENDING' or 'all orders in region=EU', across 200 shards at 60k index reads/sec. The base table takes 40k writes/sec. How do you build and maintain global secondary indexes, and how consistent are they with the base data?
It covers
- Global secondary index
- Index consistency
- Fan out