SystemDesign
We learn System Design because there is a gap between Development and production phase, code run in our laptop but took more time or break when used by 100 user .If you want to learn then these is perfect article for you. explain Everything Clearly
Week01
Part A:- Rest API Design
Post/create user or post/Delete user is not Rest api but an RPC call over http. REST is Representational State Transfer It’s about resources, not actions:here we used get, post, put delete method making developer use to read and consistent with proper structure.Its not from client to server but from client to load balancer to Api server to Db to api server to client request flow like these.
Idempotent request are sending multiple request wont change the data like deleting or getting if applied multiple time for same id it will remain same where is in post it will add post is idempotent rest all are non idempotent
Status code method are very important part 4XX represent failure from client side while 5XX represent from Server side 2XX is for success side while 3XX is very famous for url shorter question do tell what 301 or 302 do in comment difference and when to use 301 and 302
Part B :- DataBase
Choosing between SQL and NoSQL isn’t about which is “better.”
use sql when you have structure data ,predictable .clear reltion between data
in single query in sql you can get many thing whereas in mangodb it will take many query
NoSQL is flexible, used for Horizontal scaling(adding more node or machine to the server) ,Simple query Evloving data
most company used both SQL for payment related,Order, keeping user while nosql For review, Logs, Analyatic. MongoDB handles high volume without slowing PostgreSQL
Part C:- Database index
suppose if your app work great with 100 but not with 1000 and db now taking more time to response then you might have missed index in db
for searching yash my name db normally run full scan but and then give respone with index it directly search yash and give us the respone which make it much faster its like index of book directly go to that page which matches the index
why not every data make index then ?
Index are notFree you need to pay price,it get loaded into your ram , it also store copy of colum Time also inserting take more time db
only put frequent data like name user email in index while biography, are not frequent you can keep without index , rare read all without index
MUST READ THE ARTICLE
MUST READ THE ARTICLE
MUST READ THE ARTICLE
MUST READ THE ARTICLE
MUST READ THE ARTICLE
MUST READ THE ARTICLE
NEW ARTICLE 📚
API & Database Design: From Code That Works to Systems That Scale
6,500 words covering:
✓ REST API design
✓ PostgreSQL vs MongoDB
✓ Database indexes (100x speedup)
✓ Production pagination
Week 1 of 90-Day System Design Series 👇
medium.com/@devxritesh/api-d…