<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rutuja Pole on Medium]]></title>
        <description><![CDATA[Stories by Rutuja Pole on Medium]]></description>
        <link>https://medium.com/@rutuja.pole_2022?source=rss-1e5756b9b0da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*H-Bjb17OiLSLX4lZ</url>
            <title>Stories by Rutuja Pole on Medium</title>
            <link>https://medium.com/@rutuja.pole_2022?source=rss-1e5756b9b0da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 01:47:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rutuja.pole_2022/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Getting Started With System Design]]></title>
            <link>https://medium.com/globant/getting-started-with-system-design-d185bfedf576?source=rss-1e5756b9b0da------2</link>
            <guid isPermaLink="false">https://medium.com/p/d185bfedf576</guid>
            <category><![CDATA[design-process]]></category>
            <category><![CDATA[architectural-design]]></category>
            <category><![CDATA[system-design-interview]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[distributed-systems]]></category>
            <dc:creator><![CDATA[Rutuja Pole]]></dc:creator>
            <pubDate>Thu, 15 Dec 2022 13:19:23 GMT</pubDate>
            <atom:updated>2022-12-26T13:56:46.068Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*YdwFlh6PzqSfXIReZv1n-Q.png" /></figure><p><strong>System Design</strong> is designing the architecture, components, and interfaces for a system to meet the end-user requirements. <strong>System Design </strong>is something that can’t be ignored! As a software developer, it is expected to understand system design concepts such as scalability, load-balancing, caching, etc., and how to apply them. This blog will help you to <strong>learn and master System Design</strong> concepts most efficiently from basics to advanced level.</p><h3><strong>Distributed Systems and their 3 Principles</strong></h3><p>Any system with multiple components residing on multiple machines coordinating through some mechanism, like sending messages to achieve a common goal, is a distributed system. Distributed systems are robust and scalable. Robust systems can cope with errors. Scalable systems can handle a growing amount of work by adding resources.</p><p>Let’s understand the three principles of designing such systems.</p><ol><li><strong>Single responsibility principle </strong>— Each component present in System Design should have a single job to perform. Always break down your components so that your component should perform only one responsibility.</li><li><strong>No single point of failure principle</strong> — The system should never have any component whose failure will result in the failure of the entire system. Identify failure points and add redundant copies of such components so if one component fails, others can take over. This will make your system robust.</li><li><strong>No bottleneck principle </strong>— Since we design for scalability, our system should not have performance bottlenecks. Identify slow components, and increase their performance vertically or horizontally. We call this process scaling.</li></ol><p><strong>Vertical scaling </strong>is upgrading existing hardware or software. <strong>Horizontal scaling </strong>is adding multiple systems to improve performance.</p><p>We should first try to scale up the system vertically but remember, vertical scaling will always have some limit, so once we reach that threshold we can think of horizontal scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*LM6vH59MVcRWPoR9bgnIPw.png" /><figcaption>Distributed System Design</figcaption></figure><p>The above diagram shows the general data flow of a distributed system. The clients connect to the server, which processes some data, saves that data in databases, and returns some response. Now let’s apply the above system design principles to this design one by one.</p><p>The load balancer’s only responsibility is to forward incoming requests to the server. This server can perform two tasks.</p><ol><li>Serve web pages.</li><li>Perform some processing and save data in a database.</li></ol><p>So let’s break down this server into two components to perform single responsibility.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYFb9CXqII74yh2cf96uww.png" /><figcaption>Single responsibility principle</figcaption></figure><p>We separated the app and web servers. The app server will process data and update the database. The web server will serve web pages.</p><p>Now let’s check the second principle. Suppose the client is sending some data. This data will flow through the load balancer to a web server, to the app server, and finally to the database. If any of the components fail, it will result in the failure of the entire system. Let’s add another replica of each component to have no single point of failure.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xN-HoSTXEfmPe9o4qUeibA.png" /><figcaption>No single point of failure</figcaption></figure><p>Let’s see the third principle, “no bottleneck”.</p><p>The web servers can be a bottleneck if many clients are accessing the system. Suppose each web server can handle 100 simultaneous clients. As per the above diagram, we can handle 200 clients. If we grow and hit 201 clients, web servers are a bottleneck. In such a scenario, we will have to add multiple copies of web servers and app servers so that system performance won’t be hampered and the client will get a response immediately. We can do some calculations to determine the number of additional servers needed and add those many app and web servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ejcBnlNKRWU0obLTetvY5Q.png" /><figcaption>No Bottleneck Principle</figcaption></figure><p>In the above diagram, we identified slow components and scaled them horizontally, i.e., we added multiple copies of an app and web servers.</p><p>There are two types of load balancers: external and internal. External balancers are used on external premises of the network to handle incoming traffic. Internal balancers can handle internal traffic between web servers and app servers. In the below diagram, we can add an extra load balancer at the app server point.</p><p>The load balancer can divide external and internal traffic. Typically we reuse the same load balancer as an external and internal load balancer, as buying different balancers will be expensive. So in the above diagram client will send a packet to the load balancer, and the load balancer forwards it to the web server; then web server forwards the packet to the load balancer, which will forward it to the app server, so there is no direct communication between web servers and app servers.</p><h3><strong>5-step guide for </strong>System Design</h3><p>Let’s consider the use case of Facebook and try to understand the 5 step guide for system design. Please note we are limiting our scope to only a few basic requirements of a Facebook-like app, sending friend requests, reading timelines, and chatting with friends.</p><ol><li><strong>Requirement Analysis</strong></li></ol><p>It includes functional and non-functional requirements.</p><p><strong>Functional requirements are what our system can do. </strong>In our case, functional requirements would be:</p><pre>1. Sending friend request<br>2. Reading timeline <br>3. Chatting with friends</pre><p><strong>Non-functional requirements are how the system should behave</strong></p><p>In our case, non-functional requirements would be:</p><pre>1. System should be highly available there should not be any downtime.<br>2. It should be secure in term of saving user data, should be tough for hackers to hack data<br>3. There should be no data loss</pre><p><strong>2. API design</strong></p><p>Here we define interfaces exposed to the outside world, using which they communicate with the outside world. They include API name, payload, and return value</p><p>For our Facebook-alike, the functional requirement was to send friend requests, so we will now have an API for sending friend requests:</p><pre>name: friendRequest<br>payload: userId of logged in person and person to whom we are sending request<br>response: Boolean to indicate if API is successful or not</pre><p>Another functional requirement was chatting with friends, so our API would be:</p><pre>name: sendMessage<br>payload: sender and receiver user id and message<br>response: If message was delivered or person is offline</pre><p>We would similarly define all the other needed APIs.</p><p><strong>3. Define the data model</strong></p><p>It represents object data, its association with different objects, and the rules it should follow. It defines what data fields are necessary for our system.</p><p>In our Facebook-like system, our objects are our users. Their association among users means one user can be friends with another.</p><p>When we upload pics, our pics are our objects which should be stored in some storage, and metadata information about pics can be saved in some table. The comments it has received can be stored in a separate table which can be there in SQL or NoSQL database.</p><p>Also, we need to maintain the information about the user’s chat history with friends; we can use JSON structure and save it in a NoSQL database. For social media applications, we usually have huge and growing data; thus, we choose the NoSQL database here.</p><p><strong>4. High-level design</strong></p><p>Once a data model is defined, we must create a high-level system design. Such high-level designs represent the required component blocks with arrows showing the data flow. In high-level design, we must ensure all our functional requirements are met.</p><p>The components can be load balancers, web servers, application servers, databases, message queues, caches, or custom components performing actions like filtering, reading, processing, etc. The high-level design shows how the data flows from an entry point to a database and vice versa.</p><p>The high-level design takes care of all the functional components; it also takes care of some of the non-functional requirements. For example, if we want our application to be secured, all security components should be added to the high-level design.</p><p><strong>5. Scale the design</strong></p><p>This covers non-functional requirements like high availability, scalability, and no data loss.</p><p>This is necessary because today’s systems are generally large-scale distributed systems, like our example of Facebook. Facebook must handle billions of users distributed across the globe. We need to add multiple machines since it is impossible for a single machine to handle everything. These multiple machines also ensure high availability, so another can take it over if one machine fails. We need to keep multiple copies of data to ensure no data loss. The data can be replicated across data centers, so that response time for the users is min.</p><p>In this section, we’ve seen a 5-step user guide used in system design. Using these five steps, you can design any system easily. Even if the client changes the in the middle of development, we can reiterate these five steps to modify our system and accommodate the changed requirements.</p><p>References:</p><p><a href="https://completedesigninterviewcourse.com/">https://completedesigninterviewcourse.com/</a></p><p><a href="https://www.geeksforgeeks.org/system-design-tutorial/">https://www.geeksforgeeks.org/system-design-tutorial/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d185bfedf576" width="1" height="1" alt=""><hr><p><a href="https://medium.com/globant/getting-started-with-system-design-d185bfedf576">Getting Started With System Design</a> was originally published in <a href="https://medium.com/globant">Globant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>