Now a days AI is able to write code at level of junior software engineer but its not good at one thing scalabilty, system which can handle at least 1M users. And the system design is the thing that you can out perform the AI as junior dev. This is my series of blog in which I will explain, what i have learn about SD and how to use it in my POV.
Lets start with basic terminology of it, and prerequisites for learing system design.
-
IPs (Internet Protocals)
IPs are the major components of the system design basically consider its as the location or address of any computer which is connected to the internet. Which help to connet the computer on internet and create connections with them.
There are two type of IPs:
- Private IPs : these IPs which are used in general connection between system in your own network (192.168.23.4).
- Public IPs : these IPs which are publically available in the world and anyone can connect with that computer which hold public IP (142.250.70.46 - google IP).
Just search 142.250.70.46 on your browser it will open google
-
DNS (Domain Name System)
As we get it from above we can access any website or server by its public IPs, and we can access them only by IPs not by any domain, Domains are just the wrappers for the IPs so that we don't have to remember the complex IPs.
DNS are the system which use to get the IPs of website from domain so that you can actully go to that website, its works like.
-
Servers
Servers are the computers which can have public IPs and are use to process or give service for a particular utility.
You can setup your own servers or can rent from services like AWS, Google cloud, Azure (the worst one) etc.
Those are only computers also where you can put your code in that and it will run whenever someone request it for.
IMP: this is just a generalized definition of servers, server do more that this also like CRON jobs, Ai agents, IOT proccessing etc. -
Serverless
Serverless doesn't means its does't have any server, it's a service provide by lots of cloud providers where servers will run only for the particular request and then it will sleeps, again the new request come it restart performs its job and then get sleeps. Its majorly use in Asynchronous Architecture will talk about it in upcoming blogs. In serverless you have to pay only for what you use, not like servers which runs whole time and pay for completely even it's in idle state.
-
Client Server Arch
It's a most simple architecture where the client calls the server, server process the client request and give out the result to user, connection between server and client can be simplex, half duplex and full duplex also, There are various architecture to make it more better and scalable.
-
Rate Limiter & Load Balancer
- Rate Limiter : Whenever you create a server which is publically available to anyone the N numbers of request can be come from user any, may be your server is not capable to cater all the request of all the user, but you have to response all the user, so you put the restrictions on users that how many request a user can send in per min, or per sec. And this is been done with the help of Rate limiter.
- Load Balancer : When ever you have 2 or more than that servers for same service to cater, you can send user request to different server every time so that pressure on one server reduces, and the decision of sending user request to which server is generately decided with help of Load balancer, LB uses diff algo to perform this, like round robin, random.
-
Redis
Redis is a DB in general which has high throughput, to save and get data from it, generally it's used for cacheing, and its uses RAM only to save the data, so it's not save data permanently like other DBs in disc, if you stop it, it will losses all it's complete data as it saved in RAM only.
-
Micro Service
When you divide your large system with complex business logic in to small sub system is called micro service.
Example
- Amazon divides its listing of products in different micro service.
- Its keep the cart and products in cart in different micro service.
- Handle payment and orders in different micro service.
- You can see its a completely same business but divided into multiple services, so it can be manange and maintain easily.
We will talk about it more, in future blogs.
-
API Gateway
You have seen in above example that all the above micro services works on same url as amazon.com even if they have different services and have different servers also. How its possible, all the request come to same server and that server distribuate the request to different respective servers as per there request type, the server which do this distrubutions is called API Gateways.
This are the bacis this need to know to learn system desgin, there are other lots of things remaining, so I may create a part 2 of this blog or continues it the system design only and whenever need I will give context of it at that time.



Top comments (0)