Posts

Showing posts from February, 2022

Cache | System Design Part - 6

Image
In the last part of the SYSTEM DESIGN SERIES, we have gone through HIGH-LEVEL DESIGN , which gave us a clear picture of how a web request traverse from client to database layer, In this part we will be focusing on Cache, which helps in reducing the response time of the web requests. Cache is in-memory storage in which it will store results of frequently accessed data in the memory so that the response time for the upcoming requests will be drastically reduced Every time a web request is made, there will be a couple of database calls that will be done to fetch the data, Having frequent database calls can impact the response time and user experience, Hence to mitigate this problem we are introducing Cache in the web layer Cache Tier Cache tier is a temporary storage layer that can provide a quick response compared to the database. some of the benefits of having a cache tier are  System Performance. it can be scaled independently. It reduces the workload of databases. Every time we ge...

High Level Design | System Design Part - 5

Image
 In the last few parts of the SYSTEM DESIGN SERIES, we have discussed multiple concepts from web servers to databases and load balancing to data replication.  In this article, we are going to put all our learnings together and see how architecture is developed so far. Let's try to traverse and see how a  user request reaches down to the database layer and goes back Whenever a user requests for a website [let's say linkedIn.com] it gets a respective IP address of LinkedIn's load balancer from DNS. Users can connect to the load balancer with the given IP address. Loadbalancer routers the user request to either of the webservers based on the availability or load The web server routes the reads operations to the slave database. It routers all the data-modifying operations like write, update, and delete to the master database. Now we have a solid understanding of how web and data tiers work, Now let's focus on reducing the load/response time for each request. This can be don...

Database Replication | System Design Part - 4

Image
In the previous article, we have discussed about  LoadBalancer and how it plays a key role in web servers scalability, Now in this part 4 of SYSTEM DESIGN SERIES , we will be talking about database replication which provides high performance, availability, and reliability for databases The definition of database replication is very precisely quoted by Wikipedia, so let's see that first  “ Database replication can be used in many database management systems, usually with a master/slave relationship between the original (master) and the copies (slaves )” The master database generally deals with all the modifying operations like [write, update, delete], on the other hand, the slave database will deal with reading operations, All the modifications happening in the master database will be synced with salve databases in real-time. In any application the number of read operations will be twice or thrice more compared to write / update operations hence we will be having more slave da...

LoadBalancer | System Design Part - 3

Image
This is part 3 of the SYSTEM DESIGN SERIES . where we will be discussing about  LoadBalancer. From the previous parts ( Single Server Setup / Databases ), we have had an understanding of how the request traverse from user to a web server and to the database, Now let's check whether our system is capable of providing failover or how it handles if the webserver goes down With the increase in the traffic, the load on the server will be drastically increased and it leads to more latency in the requests. which will impact the user experience or the server gets crashed because of a high bump in the traffic.  If the server is offline in that case, the user will not be able to access the website. To avoid this we can add multiple servers, but how come can we route the user requests to the servers which we have added?  Here comes the LoadBalancer, It will help us in routing the user requests to the right server based on the availability and load on the server. After introducing a...

Databases | System Design Part - 2

Image
This is part 2 in the SYSTEM DESIGN SERIES , where we are going to discuss each and every topic which helps the system to withhold zero to million users at any point in time without breaking down In the previous part, we have discussed the Single Server Setup where web and data tiers lie in the same server. However with the increase in the demand for our website, it would be tough to scale by keeping both on the same server, Hence we need multiple servers where we store the web/mobile traffic [web tier] in one server and other for database [data tier]. One of the major advantages in separating them is, we can scale the web and data tiers independently From the above figure, we can clearly depict that there are few requests between server and database for data that will be further moved to the user for rendering purpose I personally know a lot of people who are confused in choosing the right database for their project, Mostly it is because of lack of understanding of the basic idealogy...

Single Server Setup | System Design Part - 1

Image
With the increase in the data-centric world, it is vital in building a scalable system that can handle millions of users, Building such systems require vast knowledge in multiple areas. Any individual who aspired to learn about building scalable systems will be overwhelmed by tons and tons of articles over the internet. But it is very important to understand or learn in a sequential manner rather than reading those topics in random. In this SYSTEM DESIGN series, we will discuss each and every topic from the beginning and why those are being used in the first place and what challenges were faced, and how they were replaced by other concepts and tools over the period of time Let's get started with a Single Server Setup, Even the big giants like Facebook, Amazon started their business with single server setup.  Single servers are nothing but everything is running on the same server like the web app, database, cache, etc.., Let's look at the above picture and try to understand the ...