Part 2: System design for PMs - scaling, load balancing, data
Module 9 · Sun 13 Sep, evening
Hinglish mein suno
NFRs product decisions hain. PM ko define karna chahiye: expected scale aur growth, read-heavy vs write-heavy, kaunsa data kabhi lose nahi hona chahiye vs kahan thodi inconsistency chal sakti hai, har journey ke latency targets, aur kaunse external APIs use hote hain aur unki cost kya hai.
- Vertical scaling = badi machine. Horizontal scaling = zyada machines. Vertical se shuru karo; horizontal tab jao jab load extra complexity ko justify kare.
- Load balancer health checks ke saath traffic ko servers par baant-ta hai - round robin, least connections ya weighted.
- Stateless servers user state ko shared storage mein rakhte hain; sticky sessions workaround hain, goal nahi. Critical state ek server par mat rakho.
Bandwidth (volume) aur latency (delay) alag bottlenecks hain - ek fix karne se doosra fix nahi hota. DNS domain ko IP mein badalta hai; HTTPS traffic encrypt karta hai.
Data modelling: data ko tables mein baanto (class example: users, photos, likes, comments, follows), jo primary aur foreign keys se jude hon. Indexing badi tables mein lookups fast karti hai (sab kuch index mat karo); caching baar-baar hone wale hot reads jaldi serve karti hai. Us step ko optimise karo jahan users ke chhodne ke chances sabse zyada hain.