Estimate the scale of the system. Consider daily active users, read/write ratio, storage requirements, bandwidth, and any relevant QPS calculations...
GET flow: client > cache first (reduce db hits and latency) > then load balancer if need to go to server > designated server performs db lookup or gets code from generator > writes or reads from db > directly back to client
POST flow: client > cache > load balancer > server > db lookup to see if already exists (fail response to client if so) > code generator > server > db > server (server acting as middle man between code generator service and db) > response to client
PUT flow: client > cache > load balancer > server > attempt to update db > response to client (failed/success, etc)
DELETE flow: client > cache > load balancer > server > attempt delete from db > send response to client
Define the data model. Identify the main entities, their attributes, and relationships. Consider the choice of database type (SQL vs NoSQL) and justify your decision based on access patterns...
Deep dive into 2-3 key components. Explain how they work, how they scale, discuss tradeoffs, capacity, and any relevant algorithms or data structures.