Intermediate
Open
Pro
Uniqueness, Secondary Lookups and Joins Across Shards
An e-commerce backend has sharded users and orders by user_id. Three
requirements arrive:
- Email addresses must remain globally unique at sign-up.
- Support agents look up an order by
order_idalone. - The seller dashboard needs "all orders for seller S in the last 24 hours".
- For each requirement, explain why the current sharding makes it hard.
- Propose a design for each, stating consistency and cost trade-offs.
- Which of the three would you push back on as a product/architecture conversation rather than solve purely in the database?
Share this question