Build-up · 5 steps
Store one follow four ways
Two users, Asha (u1) and Ravi (u2), two orders Asha placed, and one follow. Watch each model arrange the same facts.
Step 1 of 5
Relational, three tables
Each fact is stored once, and an order row holds a user_id value, not a pointer. “Who follows Ravi?” is an index lookup on follows plus a join.
Deep dive 1 of 3
Interviewer
“Food-delivery orders. Today every read is “a customer’s orders, newest first”. Do you build a query-first wide-column table or use PostgreSQL?”
Your move. Pick an approach:
Deep dive 2 of 3
Interviewer
“Assume 200,000 riders online, each pinging every 4 seconds. Customers need free riders within 3 km. Where do the positions live?”
Your move. Pick an approach:
Deep dive 3 of 3
Interviewer
“Every product category has different attributes and is read as one record. A teammate says, “Let’s use MongoDB for everything.” Your call?”
Your move. Pick an approach:
Step 1 of 6
Start relational
Choose one slice of data at a time, core records first. The system of record starts in one relational database, PostgreSQL or MySQL.