<?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 Rajdeep Mudiar on Medium]]></title>
        <description><![CDATA[Stories by Rajdeep Mudiar on Medium]]></description>
        <link>https://medium.com/@rajdeepmudiar02?source=rss-24ca01f93c57------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*-gaXXV_XI6c9FwN1iSCEhA.jpeg</url>
            <title>Stories by Rajdeep Mudiar on Medium</title>
            <link>https://medium.com/@rajdeepmudiar02?source=rss-24ca01f93c57------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 20:57:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rajdeepmudiar02/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[Scalability]]></title>
            <link>https://medium.com/@rajdeepmudiar02/scalability-749ff4976e33?source=rss-24ca01f93c57------2</link>
            <guid isPermaLink="false">https://medium.com/p/749ff4976e33</guid>
            <category><![CDATA[scalability]]></category>
            <category><![CDATA[design-systems]]></category>
            <dc:creator><![CDATA[Rajdeep Mudiar]]></dc:creator>
            <pubDate>Tue, 25 Aug 2026 15:06:08 GMT</pubDate>
            <atom:updated>2026-08-25T15:06:08.958Z</atom:updated>
            <content:encoded><![CDATA[<p>As an application grows, the number of users, requests, and amount of data also increases. A system that works perfectly for 1,000 users may struggle when it reaches 1 million users.</p><p>This is where <strong>scalability</strong> becomes important. A scalable system can handle increasing demand by adding resources without requiring a complete redesign.</p><h3>1. What is Scalability?</h3><p><strong>Scalability</strong> is the ability of a system to handle increased load by adding resources.</p><p>The goal isn’t simply to make a system faster. The goal is to make sure the system can <strong>continue performing reliably as the number of users, requests, and data grows</strong>.</p><p>For example, an application handling 1,000 requests per second today might need to handle 100,000 requests per second in the future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89qSJoqmaL4ehrv12ZpGZQ.png" /></figure><h3>Process</h3><ol><li>Users send requests to the application.</li><li>The system measures the current workload.</li><li>Traffic starts increasing.</li><li>The system identifies the bottleneck.</li><li>Additional resources are added.</li><li>Traffic is distributed efficiently.</li><li>The system continues serving users without major performance degradation.</li></ol><h3>Example</h3><p>Imagine <strong>JK, Jyotirmoy, and Bishal</strong> launch a university notes application.</p><p>Initially, only 100 students use it, so one server is enough.</p><p>But when 50,000 students start using it simultaneously, the server becomes overloaded.</p><p>Instead of letting the application crash, they scale the system by adding more resources and distributing the workload.</p><h3>2. Measuring Scalability</h3><p>Before scaling a system, we need to understand <strong>how much load it is currently handling</strong>.</p><p>Important metrics include:</p><ul><li><strong>Requests Per Second (RPS)</strong> → Number of requests handled per second.</li><li><strong>Concurrent Users</strong> → Users active at the same time.</li><li><strong>Data Volume</strong> → Amount of stored or processed data.</li><li><strong>Throughput</strong> → Amount of data processed per unit of time.</li><li><strong>Query Rate</strong> → Database queries per second.</li><li><strong>Message Rate</strong> → Messages processed through a queue per second.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MMmDArA5NFAipJgEUOPO9Q.png" /></figure><h3>Process</h3><ol><li>Measure the current traffic.</li><li>Measure response time.</li><li>Monitor CPU and memory usage.</li><li>Monitor database queries.</li><li>Identify the bottleneck.</li><li>Increase the load gradually.</li><li>Observe how the system behaves.</li></ol><h3>Example</h3><p>Suppose:</p><p><strong>JK</strong> sends 100 requests/sec.<br><strong>Jyotirmoy</strong> sends 200 requests/sec.<br><strong>Bishal</strong> sends 300 requests/sec.</p><p>The system now needs to handle <strong>600 requests/sec</strong>.</p><p>If response time suddenly increases from 50 ms to 500 ms, we know that the system is approaching a scalability bottleneck.</p><h3>3. Vertical Scaling</h3><p><strong>Vertical Scaling</strong>, also called <strong>Scaling Up</strong>, means making an existing server more powerful instead of adding more servers.</p><p>We can increase:</p><ul><li>CPU</li><li>RAM</li><li>Storage</li><li>Network capacity</li></ul><p>For example, we can upgrade a server from <strong>4 CPU cores and 16 GB RAM</strong> to <strong>16 CPU cores and 64 GB RAM</strong>.</p><h3>Process</h3><ol><li>Start with one server.</li><li>Traffic increases.</li><li>Monitor resource usage.</li><li>Identify insufficient CPU/RAM/storage.</li><li>Upgrade the server.</li><li>The server can now handle more traffic.</li><li>Continue until the hardware limit is reached.</li></ol><h3>Example</h3><p>Suppose JK, Jyotirmoy, and Bishal’s notes application initially runs on:</p><p><strong>4 CPU + 8 GB RAM</strong></p><p>As more students join, they upgrade it to:</p><p><strong>16 CPU + 32 GB RAM</strong></p><p>The same server can now handle more requests.</p><p>However, eventually the server reaches its maximum capacity.</p><h3>Advantages</h3><ul><li>Simple</li><li>No major architectural changes</li><li>Lower network complexity</li><li>Easy to implement</li></ul><h3>Disadvantages</h3><ul><li>Hardware has limits</li><li>Expensive at higher capacities</li><li>Single point of failure</li><li>Upgrades may require downtime</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*28HEwCiW143PxxKYpqtNNQ.png" /></figure><h3>4. Horizontal Scaling</h3><p><strong>Horizontal Scaling</strong>, also called <strong>Scaling Out</strong>, means adding more servers instead of making one server more powerful.</p><p>For example:</p><pre>              Load Balancer<br>             /      |      \<br>        Server 1  Server 2  Server 3</pre><p>Instead of one powerful server handling everything, multiple servers share the workload.</p><h3>Process</h3><ol><li>Start with one application server.</li><li>Traffic increases.</li><li>One server approaches its capacity.</li><li>Add additional servers.</li><li>Place a load balancer in front.</li><li>Distribute requests across servers.</li><li>Add more servers whenever traffic increases.</li></ol><h3>Example</h3><p>JK, Jyotirmoy, and Bishal’s university app becomes popular.</p><p>Instead of upgrading one massive server, they deploy:</p><ul><li>Server 1</li><li>Server 2</li><li>Server 3</li><li>Server 4</li></ul><p>The load balancer distributes students among them.</p><p>If Server 2 crashes, the remaining servers continue handling requests.</p><h3>Advantages</h3><ul><li>Better fault tolerance</li><li>Can keep adding servers</li><li>Better handling of traffic spikes</li><li>Geographic distribution is possible</li></ul><h3>Disadvantages</h3><ul><li>More architectural complexity</li><li>Data synchronization becomes harder</li><li>Network communication introduces overhead</li><li>Applications usually need to be stateless</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9qcI6apuIEEpPZhTQfwPEg.png" /></figure><h3>5. Stateless vs Stateful Services</h3><p>For horizontal scaling to work effectively, application servers should ideally be <strong>stateless</strong>.</p><p>A stateless server does not keep a user’s session data locally. Therefore, any server can handle the next request.</p><p>Session information can instead be stored in a shared system such as <strong>Redis</strong>.</p><h3>Process</h3><ol><li>User sends a request.</li><li>Load balancer selects any server.</li><li>Server retrieves session information from Redis.</li><li>Server processes the request.</li><li>Response is returned.</li><li>The next request can go to another server.</li></ol><h3>Example</h3><p>Suppose:</p><ul><li>JK’s first request → Server 1</li><li>JK’s second request → Server 3</li><li>JK’s third request → Server 2</li></ul><p>Because his session is stored in Redis, all three servers can understand who JK is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*au40XyL8qZC2vFpg4xAHRg.png" /></figure><h3>6. Database Scaling</h3><p>Databases are usually harder to scale than application servers because they manage <strong>state, consistency, durability and transactions</strong>.</p><p>Different database bottlenecks require different solutions:</p><ul><li>Read-heavy → <strong>Read Replicas</strong></li><li>Write-heavy → <strong>Sharding</strong></li><li>Read + write heavy → <strong>Sharding + Replicas</strong></li><li>Flexible large-scale workloads → <strong>NoSQL</strong></li></ul><h3>Process</h3><ol><li>Monitor database performance.</li><li>Identify whether reads or writes are the bottleneck.</li><li>If reads dominate → add replicas.</li><li>If data/write volume becomes huge → shard the database.</li><li>Consider NoSQL for suitable workloads.</li><li>Continuously monitor performance.</li></ol><h3>Example</h3><p>JK, Jyotirmoy, and Bishal notice that students mostly <strong>read notes</strong> rather than upload them.</p><p>Instead of increasing the primary database’s power, they add multiple <strong>read replicas</strong>.</p><p>Now read requests can be distributed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F1xE1k01yAmQvVxx0ybT0A.png" /></figure><h3>7. Read Replication</h3><p>In a read-heavy system, we can create copies of the primary database called <strong>read replicas</strong>.</p><p>The primary handles writes while replicas handle reads.</p><h3>Process</h3><ol><li>Application sends a write request.</li><li>Primary database processes it.</li><li>Changes are replicated.</li><li>Users send read requests.</li><li>Read requests are distributed among replicas.</li><li>Primary handles critical writes.</li></ol><h3>Example</h3><p>JK uploads a new note.</p><pre>JK → Primary Database<br>          ↓<br>    Replication<br>       ↙     ↘<br>Replica 1   Replica 2</pre><p>Jyotirmoy and Bishal can retrieve notes from the replicas without overloading the primary database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtyQREFzcfrBI5DtAj1sBw.png" /></figure><h3>8. Database Sharding</h3><p>When a database becomes extremely large, we can split the data across multiple databases.</p><p>This technique is called <strong>Sharding</strong>.</p><p>For example:</p><pre>Users A-H → Shard 1<br>Users I-P → Shard 2<br>Users Q-Z → Shard 3</pre><p>Each shard stores only a portion of the total data.</p><h3>Process</h3><ol><li>Choose a sharding key.</li><li>Divide data according to that key.</li><li>Route requests to the correct shard.</li><li>Each shard handles its own data.</li><li>Add more shards as data grows.</li></ol><h3>Example</h3><p>Suppose the university application has millions of students.</p><p>The team decides to shard by <strong>student ID</strong>:</p><ul><li>IDs 1–1,000,000 → Shard 1</li><li>IDs 1,000,001–2,000,000 → Shard 2</li><li>IDs 2,000,001+ → Shard 3</li></ul><p>Now the workload is distributed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GyjMPM8uV-d3L_GM_m8qZQ.png" /></figure><h3>9. Caching</h3><p><strong>Caching</strong> stores frequently accessed data in memory so applications don’t repeatedly retrieve it from the database.</p><p>A common approach is the <strong>Cache-Aside Pattern</strong>.</p><h3>Process</h3><ol><li>User requests data.</li><li>Application checks the cache.</li><li><strong>Cache hit</strong> → return data immediately.</li><li><strong>Cache miss</strong> → query the database.</li><li>Store the result in cache.</li><li>Return the data.</li><li>Future requests use the cached copy.</li></ol><h3>Example</h3><p>JK opens the same popular mathematics note repeatedly.</p><p>The first request:</p><pre>Application → Redis ❌<br>                 ↓<br>              Database<br>                 ↓<br>              Redis ✅</pre><p>The next request:</p><pre>Application → Redis ✅ → User</pre><p>The database doesn’t need to process the same request repeatedly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j-DF4N4NkC8dXd5_WJ3mOA.png" /></figure><h3>10. Message Queues</h3><p>A <strong>message queue</strong> allows services to communicate asynchronously.</p><p>Instead of one service waiting for another service to finish, it places a message in a queue and continues working.</p><p>The consumer processes the message when it is ready.</p><h3>Process</h3><ol><li>Producer creates a message.</li><li>Message enters the queue.</li><li>Queue temporarily stores it.</li><li>Consumer retrieves the message.</li><li>Consumer processes it.</li><li>More consumers can be added when traffic increases.</li></ol><h3>Example</h3><p>Suppose JK uploads a large video.</p><p>Instead of making him wait while the video is processed:</p><pre>JK<br> ↓<br>Upload Service<br> ↓<br>Message Queue<br> ↓<br>Video Processing Service</pre><p>The upload service can immediately respond while the processing service handles the video in the background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bAXNrFYpkgooyUl1cSLL1w.png" /></figure><h3>11. Scaling a Real Application</h3><p>Scalability usually happens <strong>step by step</strong>.</p><p>We don’t immediately build a massive distributed architecture. We identify the current bottleneck and introduce the simplest solution that solves it.</p><p>The source demonstrates a social media application growing from <strong>0 to millions of users</strong> through multiple stages.</p><h3>Process</h3><p><strong>Stage 1 — Single Server</strong></p><pre>Users → Application + MySQL</pre><p>Good for small applications.</p><p><strong>Stage 2 — Separate Database</strong></p><pre>Users → App Server → MySQL</pre><p>Application and database can now scale independently.</p><p><strong>Stage 3 — Add Cache</strong></p><pre>Users → App → Redis → MySQL</pre><p>Frequently accessed data is served from memory.</p><p><strong>Stage 4 — Multiple App Servers</strong></p><pre>Users<br>  ↓<br>Load Balancer<br> ↙  ↓  ↘<br>App App App<br>  ↓<br>Redis<br>  ↓<br>MySQL</pre><p>Application traffic is distributed.</p><p><strong>Stage 5 — Read Replicas</strong></p><pre>             ┌→ Replica 1<br>App → Primary ┤<br>             └→ Replica 2</pre><p>Reads are distributed across replicas.</p><p><strong>Stage 6 — Sharding</strong></p><pre>              Shard Router<br>             /     |      \<br>         Shard 1 Shard 2 Shard 3</pre><p>Data and workload are distributed across multiple databases.</p><h3>Example</h3><p>Imagine <strong>JK, Jyotirmoy, and Bishal</strong> build a social media platform for their university.</p><p>At first: <strong>100 users → Single Server</strong></p><p>Then the application grows: <strong>10,000 users → Separate Database</strong></p><p>Then: <strong>100,000 users → Redis Cache</strong></p><p>Then: <strong>1 million users → Multiple App Servers + Load Balancer</strong></p><p>Then: <strong>10 million users → Read Replicas</strong></p><p>Finally: <strong>Millions of users + huge data → Sharding</strong></p><p>The important lesson is that <strong>they don’t scale everything at once</strong>.</p><p>They identify the bottleneck and solve that bottleneck.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FiqXMtcb_QD4nj1YVjYM3Q.png" /></figure><h3>Final Takeaway</h3><p>Scalability isn’t about blindly adding more servers.</p><p>It’s about understanding <strong>where the bottleneck is</strong> and choosing the right solution.</p><ul><li><strong>Vertical Scaling</strong> → Make one machine more powerful.</li><li><strong>Horizontal Scaling</strong> → Add more machines.</li><li><strong>Stateless Services</strong> → Allow requests to reach any server.</li><li><strong>Read Replicas</strong> → Scale database reads.</li><li><strong>Sharding</strong> → Distribute huge datasets and workloads.</li><li><strong>Caching</strong> → Serve frequently accessed data from memory.</li><li><strong>Message Queues</strong> → Process asynchronous workloads independently.</li><li><strong>Load Balancing</strong> → Distribute traffic across servers.</li></ul><p>The most important principle is:</p><blockquote><strong><em>Always identify the bottleneck first before deciding how to scale.</em></strong></blockquote><p>Adding more application servers won’t help if the real problem is your database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JnbBSC1blfR0lG5R7km0Yw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=749ff4976e33" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[30 system design concepts explained through one project, four friends, and a lot of things breaking…]]></title>
            <link>https://medium.com/@rajdeepmudiar02/30-system-design-concepts-explained-through-one-project-four-friends-and-a-lot-of-things-breaking-eecca5ffc35d?source=rss-24ca01f93c57------2</link>
            <guid isPermaLink="false">https://medium.com/p/eecca5ffc35d</guid>
            <category><![CDATA[horizontal-scaling]]></category>
            <category><![CDATA[design-systems]]></category>
            <category><![CDATA[vertical-scaling]]></category>
            <category><![CDATA[load-balancer]]></category>
            <dc:creator><![CDATA[Rajdeep Mudiar]]></dc:creator>
            <pubDate>Tue, 25 Aug 2026 13:50:18 GMT</pubDate>
            <atom:updated>2026-08-25T13:51:32.872Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong><em>30 system design concepts explained through one project, four friends, and a lot of things breaking along the way.</em></strong></h3><p>When I first started learning System Design, it felt like a collection of unrelated terms.</p><p><strong>Load balancer. Cache. Sharding. CDN. WebSockets. Message queues. CAP theorem.</strong></p><p>I understood each definition individually, but I couldn’t understand how they actually fit together.</p><p>Then I started looking at System Design differently.</p><p>Instead of asking, <em>“What does this concept mean?”</em></p><p>I started asking, “What problem does this solve, and what happens when our application becomes bigger?”</p><p>So let’s imagine something simple.</p><p>Four friends: <strong>JK, Jyotirmoy, Bishal, and me </strong>decide to build a university platform where students can upload notes, share resources, chat with each other, watch lectures, and manage assignments.</p><p>At the beginning, everything is simple. Then more students join. Then the application gets slower. Then the database struggles. Then users start uploading huge PDFs and videos. Then thousands of people start using the app simultaneously. And suddenly, we’re doing System Design without even realizing it.</p><p>This article follows that journey through <strong>30 important System Design concepts</strong>.</p><h3>1. Client-Server Architecture</h3><p>Client-server architecture is one of the fundamental ideas behind modern applications.</p><p>The <strong>client</strong> is the application the user interacts with, for example, a web browser or mobile app.</p><p>The <strong>server</strong> is responsible for processing requests, applying business logic, communicating with databases, and returning responses.</p><p>The client doesn’t need to know how everything works internally. It simply asks the server for something and receives a response.</p><h3>Process</h3><ol><li>A user performs an action.</li><li>The client creates a request.</li><li>The request is sent to the server.</li><li>The server processes the request.</li><li>The server may communicate with a database.</li><li>The server creates a response.</li><li>The response is sent back.</li><li>The client displays the result.</li></ol><h3>Example</h3><p>Suppose <strong>Jyotirmoy</strong> opens our university app and clicks <strong>“My Notes.”</strong></p><p>His phone is the client.</p><p>The backend server receives the request, finds Jyotirmoy’s notes, and sends them back.</p><p>Jyotirmoy → Mobile App — -&gt; Backend Server → Database → Backend Server → Mobile App</p><p>The moment we understand this flow, we’ve already understood the basic idea behind most web applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Qp8s8vP2D9jmiUZSAsenw.png" /></figure><h3>2. IP Address</h3><p>Once we have a client and server, an obvious question appears:</p><p><strong>How does the client find the server?</strong></p><p>That’s where an IP address comes in.</p><p>An IP address identifies a device or network interface and allows network traffic to be routed toward it.</p><p>The problem is that IP addresses aren’t particularly friendly for humans to remember.</p><h3>Process</h3><ol><li>Our server is connected to a network.</li><li>The server has an IP address.</li><li>The client needs the server’s network address.</li><li>Network packets are sent toward that address.</li><li>Routers forward the packets.</li><li>The server receives the request.</li><li>The response travels back.</li></ol><h3>Example</h3><p>Suppose our university backend is hosted at:</p><pre>203.0.113.25</pre><p>When <strong>Bishal</strong> wants to communicate with our server, his application ultimately needs to reach that server’s network address.</p><p>But asking Bishal to remember a random sequence of numbers isn’t exactly great UX.</p><p>That’s why we need DNS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m6_6qEKsAAFUZO4hxstMaw.png" /></figure><h3>3. DNS</h3><p>DNS stands for <strong>Domain Name System</strong>.</p><p>It translates human-friendly domain names into IP addresses.</p><p>Instead of asking users to remember:</p><pre>203.0.113.25</pre><p>we can give them something memorable:</p><pre>ouruniversityapp.com</pre><p>DNS finds the corresponding IP address.</p><p>Think of it as the internet’s directory service.</p><h3>Process</h3><ol><li>Bishal enters the domain name.</li><li>His device checks its local cache.</li><li>If necessary, it contacts a DNS resolver.</li><li>The resolver finds the appropriate DNS record.</li><li>The IP address is returned.</li><li>Bishal’s browser connects to that IP.</li><li>The application loads.</li></ol><h3>Example</h3><p>Bishal types:</p><pre>ouruniversityapp.com</pre><p>Behind the scenes:</p><pre>Bishal → DNS → 203.0.113.25 → University Server</pre><p>Bishal never needs to know the actual server address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRr-X3cd8wPK8cZJPO8RkQ.png" /></figure><h3>4. Proxy and Reverse Proxy</h3><p>When we use the internet, our request does not always travel directly from our device to the destination server.</p><p>Sometimes, another server sits in the middle and acts as an <strong>intermediary</strong>. This intermediary is called a <strong>proxy</strong>.</p><p>There are two common types:</p><h3>Forward Proxy</h3><p>A <strong>forward proxy</strong> acts on behalf of the <strong>client</strong>.</p><p>Instead of the client communicating directly with the internet, the request first goes through the proxy.</p><p>For example:</p><p><strong>JK → Forward Proxy → Website</strong></p><p>The website sees the proxy as the source of the request rather than directly communicating with JK’s device.</p><p>Forward proxies are commonly used for:</p><ul><li>Controlling internet access</li><li>Filtering requests</li><li>Hiding client IP addresses</li><li>Monitoring network traffic</li><li>Enforcing organizational policies</li></ul><h3>Reverse Proxy</h3><p>A <strong>reverse proxy</strong> works in the opposite direction.</p><p>It sits in front of one or more <strong>backend servers</strong> and receives requests on their behalf.</p><p>Instead of users directly communicating with backend servers:</p><p><strong>User → Backend Server</strong></p><p>the architecture becomes:</p><p><strong>User → Reverse Proxy → Backend Server</strong></p><p>The user doesn’t need to know which backend server is actually handling the request.</p><p>A reverse proxy can also do much more than simply forward requests. It can provide:</p><ul><li><strong>Security</strong> by hiding backend servers</li><li><strong>Request routing</strong> by sending requests to the appropriate service</li><li><strong>TLS termination</strong> by handling HTTPS connections</li><li><strong>Caching</strong> frequently requested content</li><li><strong>Load balancing</strong> across multiple servers</li><li><strong>Server protection</strong> by acting as a controlled entry point</li></ul><p>This makes a reverse proxy an important component when applications start growing beyond a single server.</p><h3>Process</h3><p>Let’s understand what happens when a user accesses an application behind a reverse proxy.</p><h3>Step 1: Client sends a request</h3><p>A user opens the application and requests some resource.</p><p>For example:</p><p><em>JK wants to open his university notes.</em></p><p>His application sends a request to the university app.</p><h3>Step 2: Request reaches the reverse proxy</h3><p>Instead of reaching a backend server directly, the request first reaches the <strong>reverse proxy</strong>.</p><blockquote>JK → Request → Reverse Proxy</blockquote><p>The reverse proxy becomes the public-facing entry point of the application.</p><h3>Step 3: Reverse proxy examines the request</h3><p>The reverse proxy checks information such as:</p><ul><li>Requested URL</li><li>HTTP method</li><li>Headers</li><li>Authentication information</li><li>Requested service</li><li>Current server availability</li></ul><p>For example, it might receive:</p><blockquote>GET /notes/database-systems</blockquote><h3>Step 4: It chooses an appropriate backend</h3><p>Suppose the university application has three backend servers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*cmQFE6MX5okZoeiKrf_yNg.png" /></figure><p>The reverse proxy decides which server should handle JK’s request.</p><p>It could use strategies such as:</p><ul><li>Round Robin</li><li>Least Connections</li><li>Server health</li><li>Routing rules</li><li>Server capacity</li></ul><h3>Step 5: Request is forwarded</h3><p>The reverse proxy forwards JK’s request to the selected backend.</p><p>For example:</p><blockquote>JK → Reverse Proxy → Server 2</blockquote><p>JK doesn’t need to know that Server 2 exists.</p><h3>Step 6: Backend processes the request</h3><p>Server 2 receives the request and performs the required operation.</p><p>For example, it may:</p><ol><li>Authenticate JK.</li><li>Query the database.</li><li>Find the requested notes.</li><li>Prepare the response.</li></ol><h3>Step 7: Response returns to the proxy</h3><p>After processing the request, Server 2 sends the response back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*0yx06l3SRx5d8fmXZSuaWQ.png" /></figure><h3>Step 8: Proxy sends the response to the client</h3><p>Finally, the reverse proxy sends the response back to JK.</p><blockquote>Server 2 → Reverse Proxy → JK</blockquote><p>From JK’s perspective, he simply communicated with the university application.</p><p>He doesn’t need to know:</p><ul><li>Which server handled his request</li><li>Where that server is located</li><li>How many backend servers exist</li><li>Whether another server handled a different request</li></ul><p>That’s the power of having a reverse proxy in front of your application.</p><h3>Example: Our University Notes App</h3><p>Let’s imagine <strong>we built a university notes application</strong> where students can upload, view, and download class notes.</p><p>At the beginning, we only have one server:</p><blockquote>JK → University App → Server</blockquote><p>This works perfectly when only a few students are using the application.</p><p>But then our friends start using it.</p><p><strong>JK</strong> opens Database Management System notes.</p><p><strong>Jyotirmoy</strong> uploads Operating Systems notes.</p><p><strong>Bishal</strong> downloads Computer Networks notes.</p><p>And I open the application to check DSA notes.</p><p>Suddenly, hundreds or thousands of students start using the application.</p><p>One server may struggle to handle all these requests.</p><p>So we add more backend servers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/396/1*Nutqd2CzZxUThPH5XBQFHA.png" /></figure><p>Now the reverse proxy acts like a <strong>traffic controller</strong>.</p><h3>JK’s request</h3><p>JK opens the DBMS notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/317/1*Y3MP1Kyk3r9_h3siiHtsHA.png" /></figure><p>Server 1 handles the request.</p><h3>Jyotirmoy’s request</h3><p>At almost the same time, Jyotirmoy uploads Operating Systems notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*jLDn34uXmRDuKGBXMnwnqA.png" /></figure><p>The proxy sends his request to Server 2.</p><h3>Bishal’s request</h3><p>Bishal wants to download Computer Networks notes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/233/1*vd1dNryDedMGAAi1PnJzTA.png" /></figure><p>Server 3 handles his request.</p><h3>My request</h3><p>Meanwhile, I open the DSA section.</p><p>The reverse proxy might decide that Server 1 currently has the least traffic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*RyX7LhtAbbkT59I5FmeusQ.png" /></figure><p>So different users can be handled by different servers.</p><p>The students don’t have to think about any of this.</p><p>They simply access:</p><blockquote>universitynotes.com</blockquote><p>The reverse proxy handles the complicated part behind the scenes.</p><h3>Why Is This Useful?</h3><p>Imagine that <strong>Server 2 suddenly crashes</strong>.</p><p>Without a reverse proxy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/275/1*52uNy1BhtkjhoYSaDyfUZA.png" /></figure><p>Users depending on that server could experience failures.</p><p>With a reverse proxy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*MneubGRWSbcy-dVzLboKUA.png" /></figure><p>The reverse proxy can detect that Server 2 is unhealthy and stop sending new requests to it.</p><p>Requests can instead be routed to Server 1 or Server 3.</p><p>This gives our university application better:</p><p><strong>Availability + Scalability + Security + Performance</strong></p><p>And this is one of the reasons reverse proxies become extremely useful as applications grow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sZwBkeCbUYdXKDtInvC0Q.png" /></figure><h3>5. Latency</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xHIov9Kwb1oCThVeQlKjog.png" /></figure><p>Imagine this.</p><p>You open your university notes app and click on <strong>“Database Management Systems”</strong>.</p><p>You expect the notes to appear almost instantly.</p><p>But instead…</p><p><strong>Loading…</strong></p><p><strong>Loading…</strong></p><p><strong>Loading…</strong></p><p>You start wondering: <em>“Is the app broken?”</em></p><p>Maybe the application isn’t broken at all. The problem could simply be <strong>latency</strong>.</p><h3>What is Latency?</h3><p><strong>Latency is the time taken for data to travel from one point to another and for the required response to come back.</strong></p><p>Whenever a client communicates with a server, there is some amount of delay.</p><p>For example:</p><blockquote>Client → Server</blockquote><p>The request takes some time to reach the server.</p><p>Then:</p><blockquote>Server → Client</blockquote><p>The response takes some time to return.</p><p>The complete journey can therefore be thought of as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*616YJvyUp-FjrTkwE2eNqQ.png" /></figure><p>That delay is what we experience as <strong>latency</strong>.</p><h3>Why Does Latency Happen?</h3><p>Latency isn’t caused by just one thing.</p><p>Several factors can contribute to it:</p><h3>1. Physical Distance</h3><p>This is one of the easiest factors to understand.</p><p>If your user is in <strong>India</strong> and your server is in <strong>New York</strong>, the request has to travel a very long distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/295/1*UTn7yBOq2L-utF_YmbuwfQ.png" /></figure><p>The response then has to travel back.</p><p>The farther the client is from the server, the greater the potential network delay.</p><h3>2. Network Congestion</h3><p>Imagine a road with only a few cars.</p><p>Traffic moves quickly.</p><p>Now imagine thousands of cars entering the same road.</p><p>Everything slows down.</p><p>Networks can behave similarly.</p><p>When there is heavy traffic on a network, packets may experience delays while traveling between the client and server.</p><h3>3. Server Processing Time</h3><p>Not all latency comes from the network.</p><p>The server itself might take time to process a request.</p><p>For example:</p><blockquote>Request<br> ↓<br>API<br> ↓<br>Database Query<br> ↓<br>Complex Processing<br> ↓<br>Response</blockquote><p>If the database query takes 500 ms, the user has to wait for that processing to finish.</p><h3>4. Database Latency</h3><p>Suppose JK opens his notes.</p><p>The application receives his request but then needs to retrieve the notes from the database.</p><p>If the database is slow, the entire request becomes slow.</p><blockquote>JK → Server → Database → Server → JK</blockquote><p>So even if the network is fast, a slow database can still increase the overall response time.</p><h3>Process</h3><p>Let’s see what actually happens when a user requests something from a server.</p><h3>Step 1: User performs an action</h3><p>JK opens our university notes application and clicks:</p><blockquote><strong><em>DBMS → Unit 1 Notes</em></strong></blockquote><p>His device generates a request.</p><h3>Step 2: Request travels through the network</h3><p>The request leaves JK’s device and travels through multiple network devices and links toward the server.</p><blockquote>JK’s Device → Local Network → Internet → Data Center</blockquote><p>The physical distance and network conditions affect how long this journey takes.</p><h3>Step 3: Server receives the request</h3><p>The server receives JK’s request.</p><p>For example:</p><blockquote>GET /notes/dbms/unit-1</blockquote><h3>Step 4: Server processes the request</h3><p>The backend might need to:</p><ul><li>Authenticate JK</li><li>Check permissions</li><li>Query the database</li><li>Find the requested notes</li><li>Prepare the response</li></ul><h3>Step 5: Server sends the response</h3><p>Once the server has the required data, it sends the response back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/229/1*9-DU2RlvvPeo5pRqMf8NiA.png" /></figure><h3>Step 6: User receives the result</h3><p>JK finally sees his DBMS notes.</p><p>The total time depends on several components:</p><blockquote>Total Response Time = Network Delay + Server Processing + Database Processing + Network Return</blockquote><p>This is why system designers care so much about latency.</p><h3>Example: JK, Jyotirmoy, Bishal and Me</h3><p>Let’s imagine we have built our <strong>University Notes App</strong>.</p><p>The application is becoming popular.</p><p><strong>JK</strong> is in India.</p><p><strong>Jyotirmoy</strong> is also in India.</p><p><strong>Bishal</strong> is studying in another country.</p><p>And I’m using the application from India.</p><p>Initially, we deploy only one backend server in <strong>New York</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*MQ9-LF6_XSoR3t9WxmvjLw.png" /></figure><p>Now imagine JK requests his DBMS notes.</p><p>His request has to travel from India to New York.</p><p>Then the response has to travel back to India.</p><p>So JK might experience noticeably higher latency than a user located close to the server.</p><h3>The Problem Gets Bigger</h3><p>Now imagine <strong>10,000 students</strong> are using our application.</p><p>Students from:</p><ul><li>India 🇮🇳</li><li>Japan 🇯🇵</li><li>Germany 🇩🇪</li><li>USA 🇺🇸</li><li>Australia 🇦🇺</li></ul><p>are all connecting to our New York server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*Z1UGVIiUW1h3bcyAy6yv0w.png" /></figure><p>We’re forcing users from all over the world to communicate with one location.</p><p>That’s not ideal.</p><h3>The Solution: Multiple Data Centers</h3><p>Instead of putting our application in only one location, we can deploy it across multiple regions.</p><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/428/1*Mot_AAd5rTENRlE5VyQ87A.png" /></figure><p>Now users can potentially be routed to a server closer to them.</p><p>For example:</p><h3>JK</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*PUWSkBpyIQaPukJd43jb0w.png" /></figure><h3>Jyotirmoy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/313/1*_jSqbuZVP7jjNST-QS6j0w.png" /></figure><h3>Bishal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*swESrlVM2dIDSUA1vd8GPQ.png" /></figure><h3>Me</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/333/1*oXFoqhJArai6PB-UOXlRbA.png" /></figure><p>Instead of everyone traveling to New York, requests can be handled closer to the users.</p><p>This can significantly improve the user experience.</p><h3>Latency in a Real Application</h3><p>Let’s say our university notes application has this architecture:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/1*2P1dfdBruZWboGfC9_BIDA.png" /></figure><p>When JK opens his notes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/342/1*Ic3O7ngsZFt-dzDw7DBzhw.png" /></figure><p>When another student in Europe opens the same application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*dYLsJ32K7ITKDZSuOfgr2w.png" /></figure><p>The routing layer can direct users toward an appropriate regional server.</p><p>This is one of the fundamental ideas behind <strong>globally distributed applications</strong>.</p><h3>Latency vs Speed</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTGMf_lnWkxU0rLEPCLGMA.png" /></figure><p>One important distinction:</p><p><strong>Latency is not exactly the same thing as bandwidth.</strong></p><p>Think about a highway.</p><ul><li><strong>Latency</strong> = how long it takes a car to reach its destination.</li><li><strong>Bandwidth</strong> = how many cars the highway can carry at once.</li></ul><p>A connection can have high bandwidth but still have relatively high latency.</p><p>For example, downloading a large file might eventually be very fast, while the initial response to a small request could still take noticeable time.</p><p>Understanding this difference becomes extremely important when designing distributed systems.</p><h3>Why Latency Matters in System Design</h3><p>Latency directly affects user experience.</p><p>Imagine our notes application takes <strong>50 ms </strong>to open a page.</p><p>It feels almost instant.</p><p>Now imagine it takes <strong>3–5 seconds </strong>for every click.</p><p>Even if the application technically works, users will feel that it is slow.</p><p>This becomes even more important for applications such as:</p><ul><li>Online gaming</li><li>Video calls</li><li>Stock trading</li><li>Search engines</li><li>Online payments</li><li>Chat applications</li><li>Ride-sharing applications</li></ul><p>In these systems, even small delays can significantly affect the experience.</p><h3>How Can We Reduce Latency?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DC916N4iBdSO99fZt_4WOQ.png" /></figure><p>There isn’t one magic solution.</p><p>System designers use several techniques.</p><h3>1. Deploy servers closer to users</h3><blockquote>India User → India Server<br>USA User → USA Server</blockquote><h3>2. Use caching</h3><p>Frequently requested data can be stored closer to the application or user.</p><blockquote>User → Cache → Database</blockquote><p>If the data is already in the cache, the application doesn’t need to query the database every time.</p><h3>3. Use a CDN</h3><p>Static resources such as:</p><ul><li>Images</li><li>Videos</li><li>CSS</li><li>JavaScript</li><li>Documents</li></ul><p>can be distributed through edge locations closer to users.</p><h3>4. Optimize database queries</h3><p>A slow database query can add significant delay.</p><p>Techniques such as:</p><ul><li>Indexing</li><li>Caching</li><li>Query optimization</li><li>Replication</li></ul><p>can help reduce database-related latency.</p><h3>5. Reduce unnecessary network requests</h3><p>Instead of making five separate requests:</p><blockquote>Request 1<br>Request 2<br>Request 3<br>Request 4<br>Request 5</blockquote><p>we may be able to design the API so that the client gets the required information more efficiently.</p><h3>The Bigger Picture</h3><p>So far, we’ve discussed how far the request has to travel and how long it takes to get a response.</p><p>But there’s another important question:</p><blockquote><strong><em>Once the request reaches the server, how do the client and server actually communicate?</em></strong></blockquote><p>A browser can’t simply send random data to a server and expect the server to understand it.</p><p>They need a common set of rules for communication.</p><p>That’s where <strong>HTTP and HTTPS</strong> come into the picture.</p><p>And that’s what we’ll explore next.</p><h3>6. HTTP/HTTPS</h3><p>So far, we’ve seen how a user reaches a server and how latency can affect that journey.</p><p>But there’s another important question:</p><blockquote><strong><em>Once the client reaches the server, how do they actually communicate with each other?</em></strong></blockquote><p>That’s where <strong>HTTP</strong> comes in.</p><p>HTTP stands for <strong>Hypertext Transfer Protocol</strong>. It is a set of rules that allows clients and servers to communicate over a network.</p><p>Whenever you:</p><ul><li>Open a website</li><li>Log into an account</li><li>Upload a file</li><li>Submit a form</li><li>Load an image</li><li>Fetch data from an API</li></ul><p>there is usually a HTTP request involved.</p><p>A simple interaction looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/330/1*JbJZej3q5M1TyD5UdV3nZQ.png" /></figure><p>For example, when <strong>JK</strong> opens our university notes application, his browser might send:</p><blockquote>GET /notes/dbms</blockquote><p>The server processes the request and sends the requested data back.</p><h3>HTTP Request</h3><p>An HTTP request generally contains several important parts.</p><h3>1. Method</h3><p>The method tells the server what the client wants to do.</p><p>Common methods include:</p><ul><li><strong>GET</strong> → Retrieve something</li><li><strong>POST</strong> → Create/send something</li><li><strong>PUT</strong> → Replace/update something</li><li><strong>PATCH</strong> → Partially update something</li><li><strong>DELETE</strong> → Delete something</li></ul><h3>2. URL</h3><p>The URL tells the server which resource the client wants.</p><p>For example:</p><pre>https://universitynotes.com/notes/dbms</pre><h3>3. Headers</h3><p>Headers contain additional information about the request.</p><p>For example:</p><pre>Content-Type: application/json</pre><pre>Authorization: Bearer ...</pre><pre>User-Agent: Chrome</pre><p>Headers can tell the server things such as:</p><ul><li>What type of data is being sent</li><li>Authentication information</li><li>Browser/client information</li><li>Cookies</li><li>Preferred response formats</li></ul><h3>4. Body</h3><p>Some requests also contain a body.</p><p>For example, when Jyotirmoy uploads a note:</p><pre>{<br>  &quot;title&quot;: &quot;Operating Systems Unit 1&quot;,<br>  &quot;subject&quot;: &quot;Operating Systems&quot;<br>}</pre><p>The server can process this information and store it.</p><h3>HTTP Response</h3><p>After receiving the request, the server sends an HTTP response.</p><p>A response generally contains:</p><ul><li>Status code</li><li>Headers</li><li>Response body</li></ul><p>For example:</p><pre>200 OK</pre><p>means the request was successfully processed.</p><p>Some common status codes are:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*76UqroGWPEnFaNNL8N9mdA.png" /></figure><p>So the complete communication might look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/338/1*oir_bv6ml15DDHGdsH_CBw.png" /></figure><h3>HTTP’s Problem: Security</h3><p>There’s a major problem with plain HTTP.</p><p>Traditional HTTP does not encrypt the data being transmitted.</p><p>Imagine JK logs into our university application using:</p><pre>Username: jk<br>Password: ********</pre><p>If sensitive information is transmitted without encryption, someone capable of intercepting the traffic could potentially read it.</p><p>That’s obviously a problem for:</p><ul><li>Passwords</li><li>Banking information</li><li>Personal information</li><li>Authentication tokens</li><li>Private messages</li></ul><p>This is where <strong>HTTPS</strong> comes in.</p><h3>HTTPS</h3><p>HTTPS stands for <strong>Hypertext Transfer Protocol Secure</strong>.</p><p>It uses <strong>TLS (Transport Layer Security)</strong> to protect communication between the client and server.</p><p>Instead of:</p><pre>Client ──────── HTTP ────────► Server</pre><p>we have:</p><pre>Client ─────── HTTPS/TLS ─────► Server</pre><p>The important idea is that the communication is cryptographically protected.</p><p>Even if someone intercepts the traffic, they should not be able to simply read the encrypted application data.</p><p>HTTPS provides important security properties such as:</p><h3>Confidentiality</h3><p>Others shouldn’t be able to read the protected data being transmitted.</p><h3>Integrity</h3><p>Data should not be silently modified during transmission.</p><h3>Authentication</h3><p>TLS certificates help the client establish that it is communicating with the intended server.</p><h3>Process</h3><p>Let’s see what happens when <strong>JK opens our university notes application</strong>.</p><h3>Step 1: JK enters the website</h3><p>JK opens:</p><pre>https://universitynotes.com</pre><p>His browser needs to communicate with the application’s server.</p><h3>Step 2: A secure connection is established</h3><p>Because the application uses HTTPS, the browser establishes a secure TLS connection with the server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/377/1*ipYxgs5taTpu2yoQaHZi0g.png" /></figure><h3>Step 3: Browser sends an HTTP request</h3><p>The browser sends a request such as:</p><pre>GET /notes/dbms</pre><p>along with relevant headers.</p><h3>Step 4: Server receives the request</h3><p>The server receives and processes the request.</p><p>It might:</p><ol><li>Authenticate JK.</li><li>Check whether he has permission.</li><li>Query the database.</li><li>Find the DBMS notes.</li><li>Prepare the response.</li></ol><h3>Step 5: Server sends an HTTP response</h3><p>The server might return:</p><pre>200 OK</pre><p>along with the requested data.</p><h3>Step 6: Browser displays the result</h3><p>JK’s browser receives the response and displays his DBMS notes.</p><p>The overall flow is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*UG1kfxH62ULIL1MMI47rSg.png" /></figure><h3>Example: JK, Jyotirmoy, Bishal and Me</h3><p>Let’s use our <strong>University Notes App</strong> again.</p><h3>JK opens notes</h3><p>JK clicks:</p><blockquote><em>DBMS → Unit 1</em></blockquote><p>His browser sends:</p><pre>GET /api/notes/dbms/unit-1</pre><p>The server finds the notes and responds:</p><pre>200 OK</pre><p>JK sees the notes.</p><h3>Jyotirmoy uploads notes</h3><p>Jyotirmoy wants to upload his Operating Systems notes.</p><p>His application might send:</p><pre>POST /api/notes</pre><p>with information about the note in the request body.</p><p>The server processes it and returns:</p><pre>201 Created</pre><h3>Bishal deletes a note</h3><p>Suppose Bishal has permission to delete one of his uploaded notes.</p><p>His application could send:</p><pre>DELETE /api/notes/482</pre><p>The server processes the request and may return:</p><pre>200 OK</pre><h3>I update a note</h3><p>If I edit an existing note, the application could use:</p><pre>PATCH /api/notes/482</pre><p>The server updates the required fields and returns the updated result.</p><p>So our friends are performing completely different operations, but they’re all communicating with the backend using HTTP-based requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VwxsXFFh9Bc8DxoUjWVQuQ.png" /></figure><h3>HTTP vs HTTPS</h3><p>A simple way to remember it:</p><pre>HTTP --&gt; Communication without TLS protection<br><br>HTTPS --&gt; HTTP + TLS security</pre><p>For modern public-facing applications, <strong>HTTPS should be the default</strong>.</p><h3>A Small but Important Connection</h3><p>At this point, we have a slight problem.</p><p>We’ve learned that HTTP defines the <strong>communication protocol</strong>.</p><p>But how does the client know:</p><ul><li>Which URL to call?</li><li>Which endpoint retrieves notes?</li><li>Which endpoint creates notes?</li><li>What data should be sent?</li><li>What format will the response have?</li></ul><p>For example, how does JK’s application know that:</p><pre>GET /api/notes</pre><p>means:</p><blockquote><em>“Give me the notes”</em></blockquote><p>while:</p><pre>POST /api/notes</pre><p>means:</p><blockquote><em>“Create a new note”</em></blockquote><p>We need a structured way for applications to expose functionality to other applications.</p><p>That’s where <strong>APIs</strong> enter the picture.</p><h3>7. APIs</h3><p>An <strong>API (Application Programming Interface)</strong> is a defined way for different software components to communicate with each other.</p><p>Think of an API as a <strong>contract between a client and a server</strong>.</p><p>The client doesn’t need to know how the server internally works.</p><p>It only needs to know:</p><blockquote><em>“If I send this type of request to this endpoint, I’ll receive this type of response.”</em></blockquote><p>For example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*rnzNFy5IkVYrqyx6LphUFQ.png" /></figure><p>The frontend doesn’t need to know:</p><ul><li>Which database is being used</li><li>How the query is written</li><li>Where the data is physically stored</li><li>How authentication is implemented internally</li></ul><p>It simply communicates through the API.</p><p>That’s called <strong>abstraction</strong>.</p><h3>Process</h3><p>Let’s say JK wants to view his DBMS notes.</p><h3>Step 1: Client makes a request</h3><p>The university app sends:</p><pre>GET /api/notes/dbms</pre><h3>Step 2: API receives the request</h3><p>The API receives the request and determines what operation is required.</p><h3>Step 3: Backend processes it</h3><p>The backend might:</p><ul><li>Authenticate JK</li><li>Validate the request</li><li>Query the database</li><li>Apply business logic</li></ul><h3>Step 4: Database returns data</h3><p>The backend asks the database for the requested notes.</p><pre>API --&gt; Backend --&gt; Database --&gt; DBMS Notes</pre><h3>Step 5: API prepares the response</h3><p>The server converts the result into a format the client understands.</p><p>A common format is <strong>JSON</strong>.</p><p>For example:</p><pre>{<br>  &quot;title&quot;: &quot;DBMS Unit 1&quot;,<br>  &quot;subject&quot;: &quot;Database Management Systems&quot;,<br>  &quot;uploadedBy&quot;: &quot;JK&quot;<br>}</pre><h3>Step 6: Client receives the response</h3><p>The application receives the JSON and displays the notes to JK.</p><pre>Database --&gt; Backend --&gt;  API --&gt; University App --&gt; JK</pre><h3>Example: Our University Notes API</h3><p>Imagine we build the backend for our university notes application.</p><p>We might expose endpoints like:</p><pre>GET    /api/notes<br><br>GET    /api/notes/123<br><br>POST   /api/notes<br><br>PATCH  /api/notes/123<br><br>DELETE /api/notes/123</pre><p>Now look at what our friends are doing.</p><h3>JK</h3><p>JK wants to <strong>view</strong> notes:</p><pre>GET /api/notes/123</pre><h3>Jyotirmoy</h3><p>Jyotirmoy wants to <strong>upload</strong> a new note:</p><pre>POST /api/notes</pre><h3>Bishal</h3><p>Bishal wants to <strong>update</strong> one of his notes:</p><pre>PATCH /api/notes/123</pre><h3>Me</h3><p>I want to <strong>delete</strong> one of my notes:</p><pre>DELETE /api/notes/123</pre><p>The frontend doesn’t directly manipulate the database.</p><p>Instead:</p><pre>Student --&gt; Frontend --&gt; API --&gt;Backend --&gt; Database</pre><p>This separation makes the application easier to maintain and scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8Isz5HAx37jnyQrZR76m4Q.png" /></figure><h3>Why APIs Matter</h3><p>APIs allow different parts of a system to communicate without tightly coupling their internal implementation.</p><p>For example, we could have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/318/1*XZC-2T4kWc50RuHeJ-cDdQ.png" /></figure><p>All these clients can communicate with the same backend through APIs.</p><p>That’s why APIs are everywhere in modern software.</p><p>But there’s another interesting question:</p><blockquote><strong><em>What style should we use when designing our API?</em></strong></blockquote><p>Two popular approaches we’ll encounter are <strong>REST</strong> and <strong>GraphQL</strong>.</p><h3>8. REST API</h3><p><strong>REST</strong>, or <strong>Representational State Transfer</strong>, is an architectural style commonly used for designing web APIs.</p><p>The core idea is to treat things in our system as <strong>resources</strong>.</p><p>For our university application, resources could be:</p><pre>/users<br>/notes<br>/courses<br>/comments<br>/subjects</pre><p>Clients interact with these resources using standard HTTP methods.</p><h3>GET</h3><p>Retrieve data.</p><pre>GET /notes</pre><h3>POST</h3><p>Create something.</p><pre>POST /notes</pre><h3>PUT/PATCH</h3><p>Update something.</p><pre>PATCH /notes/123</pre><h3>DELETE</h3><p>Remove something.</p><pre>DELETE /notes/123</pre><h3>Process</h3><p>Suppose Jyotirmoy uploads a new DBMS note.</p><h3>Step 1</h3><p>The frontend collects the note information.</p><h3>Step 2</h3><p>It sends:</p><pre>POST /api/notes</pre><h3>Step 3</h3><p>The REST API receives the request.</p><h3>Step 4</h3><p>The backend validates the data.</p><h3>Step 5</h3><p>The backend stores the note in the database.</p><h3>Step 6</h3><p>The API returns a response.</p><pre>{<br>  &quot;id&quot;: 123,<br>  &quot;title&quot;: &quot;DBMS Unit 1&quot;,<br>  &quot;status&quot;: &quot;created&quot;<br>}</pre><h3>Step 7</h3><p>Jyotirmoy’s application displays:</p><blockquote><strong><em>Note uploaded successfully!</em></strong></blockquote><h3>REST Example With Our Friends</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*02O-s77MMs4Z5HuWAvETyQ.png" /></figure><p>REST is popular because it is relatively simple, predictable, and works naturally with HTTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1H4ZSalyiVng0YIXrtvCgQ.png" /></figure><p>However, REST can become inconvenient when the client needs a <strong>very specific combination of data</strong>.</p><p>And that’s where GraphQL becomes interesting.</p><h3>9. GraphQL</h3><p>Imagine JK opens a student’s profile.</p><p>He wants:</p><ul><li>Name</li><li>Profile picture</li><li>Department</li><li>Last 5 uploaded notes</li></ul><p>With a traditional REST design, the application may need to call multiple endpoints.</p><p>For example:</p><pre>GET /users/123<br>GET /users/123/profile<br>GET /users/123/notes</pre><p>That can result in multiple network requests.</p><p><strong>GraphQL</strong> takes a different approach.</p><p>Instead of the server deciding exactly which fields each endpoint returns, the client can describe the data it needs.</p><p>Think of it like ordering food.</p><p>With REST:</p><blockquote><em>“Give me Meal A.”</em></blockquote><p>With GraphQL:</p><blockquote><em>“Give me exactly these ingredients from the data.”</em></blockquote><h3>Process</h3><h3>Step 1: Client sends a GraphQL query</h3><p>For example, JK’s application might request:</p><pre>student {<br>    name<br>    department<br>    recentNotes {<br>        title<br>    }<br>}</pre><h3>Step 2: GraphQL server receives it</h3><p>The GraphQL server examines the requested fields.</p><h3>Step 3: Server fetches the required data</h3><p>The backend may retrieve information from:</p><ul><li>Database</li><li>Other APIs</li><li>Microservices</li><li>Caches</li></ul><h3>Step 4: Server builds the response</h3><p>It returns only the requested fields.</p><pre>{<br>  &quot;student&quot;: {<br>    &quot;name&quot;: &quot;JK&quot;,<br>    &quot;department&quot;: &quot;Computer Science&quot;,<br>    &quot;recentNotes&quot;: [<br>      {<br>        &quot;title&quot;: &quot;DBMS Unit 1&quot;<br>      }<br>    ]<br>  }<br>}</pre><h3>Step 5: Client displays the information</h3><p>JK receives exactly what his application requested.</p><h3>REST vs GraphQL — Our University App</h3><p>Suppose Bishal wants:</p><blockquote><em>His name + department + latest three notes.</em></blockquote><p>With REST, we might need several endpoints depending on how the API is designed.</p><p>With GraphQL:</p><pre>Bishal<br>  │<br>  │ One GraphQL Query<br>  ▼<br>GraphQL API<br>  │<br>  ├── User Data<br>  ├── Department Data<br>  └── Notes Data<br>  │<br>  ▼<br>Response</pre><p>This can reduce unnecessary data transfer and multiple client requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tRmAjaAQtuNqmiQG_Yb0OA.png" /></figure><p>But GraphQL isn’t automatically better than REST.</p><p>It also introduces trade-offs such as:</p><ul><li>More complex server implementation</li><li>More complex caching</li><li>Query-cost management</li><li>More processing on the server</li></ul><p>So the choice depends on the application’s requirements.</p><h3>10. Databases</h3><p>We’ve now reached an important part of our architecture.</p><p>Our clients can communicate with our API.</p><p>Our API can process requests.</p><p>But where do we actually <strong>store the data</strong>?</p><p>That’s where a <strong>database</strong> comes in.</p><p>A database is a system designed to store, organize, retrieve, and manage data.</p><p>For our university notes application, we might need to store:</p><pre>Students<br>Notes<br>Courses<br>Subjects<br>Comments<br>Bookmarks<br>Uploads</pre><p>Instead of keeping everything in application memory, we use persistent storage.</p><p>Our architecture now looks like:</p><pre>Student<br>   │<br>   ▼<br>Frontend<br>   │<br>   ▼<br>API<br>   │<br>   ▼<br>Backend<br>   │<br>   ▼<br>Database</pre><h3>Process</h3><p>Let’s say JK uploads a new note.</p><h3>Step 1</h3><p>JK selects:</p><blockquote><em>DBMS Unit 2.pdf</em></blockquote><h3>Step 2</h3><p>The frontend sends the information to our backend API.</p><h3>Step 3</h3><p>The backend validates JK’s request.</p><h3>Step 4</h3><p>The application stores the appropriate information.</p><p>For example:</p><pre>Note ID: 482<br>Title: DBMS Unit 2<br>Uploaded By: JK<br>Subject: DBMS</pre><h3>Step 5</h3><p>The database stores the structured information.</p><h3>Step 6</h3><p>Later, when Bishal searches for DBMS notes:</p><pre>Bishal<br>  ↓<br>API<br>  ↓<br>Database<br>  ↓<br>DBMS Notes<br>  ↓<br>API<br>  ↓<br>Bishal</pre><p>The database retrieves the relevant records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q9q6EX_q46IwUh960x02Vg.png" /></figure><h3>Example: Our University Notes Database</h3><p>Suppose our application has four users:</p><pre>JK<br>Jyotirmoy<br>Bishal<br>Me</pre><p>And hundreds of notes are being uploaded.</p><p>The database might contain information about:</p><pre>Users<br> ├── JK<br> ├── Jyotirmoy<br> ├── Bishal<br> └── Me<br><br>Notes<br> ├── DBMS Unit 1<br> ├── OS Unit 2<br> ├── DSA Arrays<br> ├── Computer Networks<br> └── ...</pre><p>Now imagine <strong>10,000 students</strong> using our application and uploading millions of notes.</p><p>Keeping all this information efficiently becomes a serious system-design problem.</p><p>And that’s why choosing the <strong>right type of database</strong> matters.</p><h3>SQL vs NoSQL</h3><p>Two major categories we’ll frequently encounter in system design are:</p><p><strong>SQL</strong> and <strong>NoSQL</strong>.</p><h3>SQL Databases</h3><p>SQL databases generally organize data into structured tables with relationships between them.</p><p>For example:</p><pre>Students<br>-------------------<br>ID | Name   | Email<br>1  | JK     | ...<br>2  | Bishal | ...</pre><p>and:</p><pre>Notes<br>-------------------<br>ID | StudentID | Title<br>1  | 1         | DBMS<br>2  | 2         | DSA</pre><p>Popular SQL databases include:</p><ul><li>MySQL</li><li>PostgreSQL</li><li>SQLite</li></ul><p>They are particularly useful when we need structured relationships and strong transactional guarantees.</p><h3>NoSQL Databases</h3><p>NoSQL databases use different models and are often chosen when flexible schemas, large-scale distribution, or specific access patterns are important.</p><p>For our application, a document database could represent a note like:</p><pre>{<br>  &quot;title&quot;: &quot;DBMS Unit 1&quot;,<br>  &quot;subject&quot;: &quot;DBMS&quot;,<br>  &quot;uploadedBy&quot;: &quot;JK&quot;,<br>  &quot;tags&quot;: [&quot;database&quot;, &quot;sql&quot;, &quot;university&quot;]<br>}</pre><p>Popular NoSQL technologies include:</p><ul><li>MongoDB</li><li>Cassandra</li><li>DynamoDB</li><li>Redis</li></ul><p>The important lesson isn’t:</p><blockquote><em>“SQL is better.”</em></blockquote><p>or:</p><blockquote><em>“NoSQL is better.”</em></blockquote><p>The better question is:</p><blockquote><strong><em>What does our system actually need?</em></strong></blockquote><h3>The Bigger Picture</h3><p>Look how far we’ve come:</p><pre>User<br>  │<br>  ▼<br>Client<br>  │<br>  ▼<br>HTTP / HTTPS<br>  │<br>  ▼<br>API<br>  │<br>  ├──── REST<br>  │<br>  └──── GraphQL<br>  │<br>  ▼<br>Backend<br>  │<br>  ▼<br>Database</pre><p>And now we have another problem.</p><p>Imagine our university app becomes extremely popular.</p><p>Yesterday we had:</p><p><strong>100 users</strong></p><p>Today:</p><p><strong>10,000 users</strong></p><p>Next month:</p><p><strong>1,000,000 users</strong></p><p>Our single backend server and single database may no longer be enough.</p><p>So the next question becomes:</p><blockquote><strong><em>How do we scale our system when the number of users keeps growing?</em></strong></blockquote><p>That’s where <strong>vertical scaling and horizontal scaling</strong> come into the picture.</p><h3>11. SQL vs NoSQL</h3><p>Choosing a database is one of those decisions that looks simple from the outside:</p><blockquote><em>“Just pick a database and store the data.”</em></blockquote><p>But once an application starts growing, the choice of database can have a huge impact on <strong>performance, scalability, consistency, and how easily the system can evolve</strong>.</p><p>There isn’t one database that is perfect for every application.</p><p>The real question is:</p><blockquote><strong><em>What kind of data are we storing, and what does our application need from that data?</em></strong></blockquote><p>Two of the most common database categories you’ll encounter in system design are <strong>SQL</strong> and <strong>NoSQL</strong>.</p><h3>SQL Databases</h3><p>SQL databases organize information into <strong>tables made up of rows and columns</strong>.</p><p>They generally use a predefined schema, meaning we decide the structure of our data before inserting it.</p><p>For example, our university application could have:</p><pre>Students<br>--------------------------------<br>student_id | name      | department<br>--------------------------------<br>101        | JK        | CSE<br>102        | Bishal    | CSE<br>103        | Jyotirmoy | CSE</pre><p>We could have another table for courses:</p><pre>Courses<br>--------------------------<br>course_id | course_name<br>--------------------------<br>101       | DBMS<br>102       | Operating Systems</pre><p>The tables can then be connected through relationships.</p><p>This makes SQL databases particularly useful when our application contains <strong>structured and related data</strong>.</p><h3>ACID Properties</h3><p>SQL databases are also commonly associated with <strong>ACID transactions</strong>.</p><h4>1. Atomicity</h4><p>A transaction should be <strong>all-or-nothing</strong>.</p><p>If a banking transaction transfers money from one account to another, we don’t want the money to disappear halfway through.</p><p>Either:</p><pre>Debit successful + Credit successful</pre><p>or the entire transaction fails.</p><h4>2. Consistency</h4><p>The database should always maintain valid data according to its rules.</p><p>For example, our university system shouldn’t suddenly allow a student to have an invalid course ID.</p><h4>3. Isolation</h4><p>Multiple transactions happening at the same time shouldn’t incorrectly interfere with each other.</p><p>Imagine hundreds of students submitting assignments simultaneously.</p><p>The database should handle those operations safely.</p><h4>4. Durability</h4><p>Once a transaction is successfully committed, the data should remain stored even if the system crashes afterward.</p><h3>NoSQL Databases</h3><p>NoSQL databases take a more flexible approach.</p><p>Instead of always organizing information into traditional relational tables, NoSQL systems can use different models such as:</p><ul><li><strong>Document databases</strong></li><li><strong>Key-value stores</strong></li><li><strong>Graph databases</strong></li><li><strong>Wide-column databases</strong></li></ul><p>For example, a document database might store a note like this:</p><pre>{<br>  &quot;title&quot;: &quot;DBMS Unit 1&quot;,<br>  &quot;author&quot;: &quot;Jyotirmoy&quot;,<br>  &quot;tags&quot;: [&quot;DBMS&quot;, &quot;Exam&quot;],<br>  &quot;semester&quot;: 3<br>}</pre><p>Another note could contain completely different fields without requiring the entire database schema to be redesigned.</p><p>This flexibility can be useful when the structure of data changes frequently or when an application needs to scale across many machines.</p><h3>SQL vs NoSQL — The Simple Difference</h3><p>Instead of memorizing dozens of differences, remember this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/844/1*cuvlm23l-Jb8qqSm-cLbAg.png" /></figure><p>This doesn’t mean:</p><blockquote><strong><em>SQL = small applications</em></strong></blockquote><p>or</p><blockquote><strong><em>NoSQL = large applications</em></strong></blockquote><p>That’s an oversimplification.</p><p>Large systems can use <strong>both</strong>.</p><h3>Process</h3><h3>When using SQL</h3><ol><li>Application sends a request.</li><li>Backend validates the request.</li><li>Backend creates an SQL query.</li><li>Database checks the relevant tables.</li><li>Relationships and constraints are evaluated.</li><li>Transaction is executed.</li><li>Database returns the result.</li><li>Backend sends the response to the user.</li></ol><h3>When using NoSQL</h3><ol><li>Application sends a request.</li><li>Backend validates the request.</li><li>Backend identifies the required document/key/data.</li><li>NoSQL database searches the appropriate collection or partition.</li><li>Data is retrieved or updated.</li><li>Database returns the result.</li><li>Backend sends the response to the user.</li></ol><h3>Example: Our University Notes App</h3><p>Let’s imagine that <strong>we are building a university platform</strong> where students can:</p><ul><li>Register for courses</li><li>Upload notes</li><li>Search notes</li><li>Comment on notes</li><li>Bookmark resources</li><li>Get personalized recommendations</li></ul><p>Now the database decision becomes interesting.</p><h3>Course Enrollment</h3><p>Suppose <strong>JK</strong> registers for DBMS.</p><p>We might have:</p><pre>Students<br>Courses<br>Enrollments</pre><p>These entities have clear relationships.</p><p>For example:</p><pre>JK<br> ↓<br>Enrollment<br> ↓<br>DBMS</pre><p>A relational SQL database can handle these relationships very naturally.</p><h3>Notes</h3><p>Now consider the notes uploaded by <strong>Jyotirmoy</strong>.</p><p>One note might contain:</p><pre>Title<br>Author<br>Subject<br>Tags<br>Semester<br>PDF<br>Upload Date</pre><p>Another note might contain:</p><pre>Title<br>Author<br>Subject<br>Tags<br>Video<br>References</pre><p>The structure isn’t necessarily identical.</p><p>A document-oriented NoSQL database can provide more flexibility here.</p><h3>Recommendations</h3><p>Suppose <strong>Bishal</strong> frequently reads:</p><pre>DBMS<br>Operating Systems<br>Computer Networks</pre><p>Our recommendation system could generate a large amount of flexible user-interaction data.</p><p>NoSQL can be useful for workloads where we need flexible structures and large-scale access patterns.</p><h3>So could we use both?</h3><p>Absolutely.</p><p>Our architecture could look something like:</p><pre>                 University App<br>                       │<br>              ┌────────┴────────┐<br>              │                 │<br>             SQL              NoSQL<br>              │                 │<br>       Students/Courses      Notes<br>       Enrollments           Activity<br>       Relationships         Recommendations</pre><p>This is an important system-design lesson:</p><blockquote><strong><em>Don’t choose a technology because it’s popular. Choose it because it fits the problem.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TkgqY-LhLYzrKaSLAEiaJg.png" /></figure><h3>12. Vertical Scaling</h3><p>So far, our application has been relatively simple.</p><p>We have:</p><pre>Users<br> ↓<br>Server<br> ↓<br>Database</pre><p>But what happens when our application becomes popular?</p><p>Imagine we initially have only <strong>10 students</strong> using our university notes app.</p><p>Our server might handle everything comfortably.</p><p>Then suddenly:</p><pre>10 users<br>   ↓<br>100 users<br>   ↓<br>1,000 users<br>   ↓<br>10,000 users</pre><p>The number of requests starts increasing.</p><p>Eventually, our server begins struggling.</p><p>CPU usage goes up.</p><p>Memory usage increases.</p><p>Response times become slower.</p><p>So what can we do?</p><p>One of the simplest solutions is <strong>Vertical Scaling</strong>.</p><p><strong>Vertical Scaling</strong>, also called <strong>Scaling Up</strong>, means making an existing server more powerful.</p><p>Instead of adding more servers, we upgrade the current machine.</p><p>For example:</p><pre>Before<br><br>Server<br>4 CPU<br>8 GB RAM<br><br><br>After<br><br>Server<br>16 CPU<br>32 GB RAM</pre><p>We’re still using <strong>one server</strong>.</p><p>We’re simply giving that server more resources.</p><h3>Why is it useful?</h3><p>Vertical scaling is attractive because it’s relatively simple.</p><p>We don’t need to redesign our entire architecture.</p><p>We can often:</p><ul><li>Increase CPU</li><li>Increase RAM</li><li>Increase storage</li><li>Upgrade the machine type</li></ul><p>This can provide a quick performance improvement.</p><h3>But there’s a catch</h3><p>A single machine has physical limits.</p><p>You can’t keep upgrading forever.</p><p>Eventually, we reach:</p><h3>Hardware limitations</h3><p>There is a maximum amount of CPU, RAM, and storage a machine can support.</p><h3>Cost</h3><p>Extremely powerful machines can become very expensive.</p><h3>Single Point of Failure</h3><p>This is perhaps the biggest problem.</p><p>If our entire application runs on one server and that server crashes:</p><pre>Server ❌<br>   ↓<br>Application ❌</pre><p>Everyone is affected.</p><h3>Process</h3><ol><li>Monitor server performance.</li><li>Identify the bottleneck.</li><li>Determine whether CPU, RAM, or storage is the problem.</li><li>Upgrade the server resources.</li><li>Restart or migrate the application if required.</li><li>Monitor performance again.</li><li>Repeat until the server reaches its practical limits.</li></ol><h3>Example</h3><p>Initially, our university application is used only by:</p><p><strong>JK and Jyotirmoy.</strong></p><p>A small server is enough.</p><p>Then our college starts using the application.</p><p>Now:</p><p><strong>JK + Jyotirmoy + Bishal + hundreds of students</strong></p><p>are accessing notes simultaneously.</p><p>Our server starts struggling.</p><p>Instead of immediately adding more machines, we upgrade it:</p><pre>Before<br>2 CPU + 4 GB RAM<br><br>        ↓<br><br>After<br>8 CPU + 16 GB RAM</pre><p>The application becomes faster and can handle more users.</p><p>But eventually, we might reach a point where even our upgraded machine isn’t enough.</p><p>That’s when we need to think differently.</p><p>Instead of making <strong>one machine stronger</strong>, why not use <strong>multiple machines</strong>?</p><p>And that takes us to Horizontal Scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7wa0T6SRKnryuWCf588e_A.png" /></figure><h3>13. Horizontal Scaling</h3><p>Vertical scaling eventually reaches a wall.</p><p>If one server isn’t enough, instead of continuing to upgrade it, we can add <strong>more servers</strong>.</p><p>This is called <strong>Horizontal Scaling</strong>, or <strong>Scaling Out</strong>.</p><p>Horizontal scaling means distributing our workload across multiple machines.</p><p>Instead of:</p><pre>Users<br>  ↓<br>Server</pre><p>we have:</p><pre>        ┌── Server 1<br>Users ──┼── Server 2<br>        └── Server 3</pre><p>Now the workload doesn’t have to be handled by one machine.</p><p>If traffic increases, we can add additional servers.</p><h3>Why is Horizontal Scaling Powerful?</h3><h4>More capacity</h4><p>Adding servers allows us to handle more requests.</p><h4>Better fault tolerance</h4><p>If one server fails, other servers can continue serving users.</p><h4>Easier growth</h4><p>Instead of buying one extremely powerful machine, we can add machines as demand increases.</p><h4>Better availability</h4><p>The application doesn’t necessarily go down just because one server fails.</p><p>But there’s a new problem, now imagine we have:</p><pre>Server 1<br>Server 2<br>Server 3<br>Server 4</pre><p>A user sends a request.</p><p>Which server should receive it?</p><p>Should JK always go to Server 1?</p><p>Should Bishal go to Server 3?</p><p>What if Server 1 is already overloaded?</p><p>We need something to make that decision.</p><p>That’s where the <strong>Load Balancer</strong> enters the picture.</p><h3>Process</h3><ol><li>Start with one application server.</li><li>Traffic increases.</li><li>Add additional servers.</li><li>Distribute application instances across them.</li><li>Place a load balancer in front.</li><li>Load balancer distributes incoming requests.</li><li>If a server fails, traffic is redirected.</li><li>Add more servers as traffic continues growing.</li></ol><h3>Example</h3><p>Our university notes app has become extremely popular.</p><p>Instead of one server:</p><pre>              Server<br>                ↓<br>         Too many requests</pre><p>we deploy three:</p><pre>       ┌── Server 1<br>Users ─┼── Server 2<br>       └── Server 3</pre><p>Now requests can be distributed.</p><p>For example:</p><pre>JK          → Server 1<br>Jyotirmoy   → Server 2<br>Bishal      → Server 3</pre><p>Suppose Server 2 suddenly crashes.</p><p>Instead of taking the whole application down:</p><pre>Server 1 ✅<br>Server 2 ❌<br>Server 3 ✅</pre><p>the remaining servers continue handling requests.</p><p>This is one of the major advantages of horizontal scaling.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywHQaoRrEpmjUPRHSQtDdg.png" /></figure><h3>14. Load Balancers</h3><p>Now we’ve solved one problem:</p><blockquote><em>We have multiple servers.</em></blockquote><p>But we’ve created another:</p><blockquote><strong><em>How do we decide which server should receive each request?</em></strong></blockquote><p>Imagine thousands of students opening our university application at the same time.</p><p>We can’t manually assign every request.</p><p>That’s where a <strong>Load Balancer</strong> becomes essential.</p><p>A <strong>Load Balancer</strong> sits between users and backend servers.</p><p>It acts like a <strong>traffic controller</strong>.</p><pre>                    ┌── Server 1<br>Users               |<br>   ↓                |<br>Load Balancer ──────┼── Server 2<br>                    └── Server 3</pre><p>The load balancer receives incoming requests and decides where to send them.</p><p>It can also monitor server health.</p><p>If a server becomes unavailable, the load balancer can stop sending new traffic to it.</p><h3>Common Load Balancing Algorithms</h3><h4>1. Round Robin</h4><p>Requests are distributed sequentially.</p><pre>Request 1 → Server 1<br>Request 2 → Server 2<br>Request 3 → Server 3<br>Request 4 → Server 1</pre><p>It’s simple and works well when servers have similar capacity and workloads.</p><h4>2. Least Connections</h4><p>The load balancer checks which server currently has the fewest active connections.</p><p>For example:</p><pre>Server 1 → 50 connections<br>Server 2 → 20 connections<br>Server 3 → 35 connections</pre><p>The next request could go to Server 2.</p><h4>3. IP Hashing</h4><p>The client’s IP address is used to determine the destination server.</p><p>This can help maintain a degree of session consistency because requests from the same client can repeatedly reach the same server.</p><h4>Process</h4><ol><li>User sends a request.</li><li>Request reaches the load balancer.</li><li>Load balancer checks available backend servers.</li><li>It applies a balancing algorithm.</li><li>Request is forwarded to the selected server.</li><li>Server processes the request.</li><li>Response travels back through the load balancer.</li><li>Load balancer returns the response to the user.</li></ol><h4>Example</h4><p>Let’s say:</p><p><strong>JK, Jyotirmoy, and Bishal</strong> open our notes application at almost the same time.</p><p>Using Round Robin:</p><pre>JK<br> ↓<br>Server 1<br><br><br>Jyotirmoy<br> ↓<br>Server 2<br><br><br>Bishal<br> ↓<br>Server 3</pre><p>Now imagine Server 2 crashes.</p><pre>Server 1 ✅<br>Server 2 ❌<br>Server 3 ✅</pre><p>The load balancer detects that Server 2 is unhealthy and sends new requests to the healthy servers.</p><p>From the user’s perspective, the application can continue working normally.</p><p>That’s the real value of a load balancer:</p><blockquote><strong><em>Users don’t need to care which server is handling their request.</em></strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGxBWykTURaBI2OOXM8lHw.png" /></figure><h3>15. Database Indexing</h3><p>Now let’s move from <strong>application servers</strong> to the <strong>database</strong>.</p><p>Our university app might start with only a few notes.</p><pre>10 notes</pre><p>Then:</p><pre>1,000 notes<br>       ↓<br>10,000 notes<br>       ↓<br>100,000 notes<br>       ↓<br>1,000,000 notes</pre><p>At some point, searching through all those records becomes expensive.</p><p>Suppose <strong>Bishal</strong> searches:</p><blockquote><em>“DBMS notes uploaded by Jyotirmoy”</em></blockquote><p>How can the database find the correct records quickly?</p><p>This is where <strong>indexing</strong> helps.</p><p>A database index is similar to the <strong>index at the back of a textbook</strong>.</p><p>Imagine you have a 1,000-page book and want to find the topic:</p><blockquote><em>“Database Normalization”</em></blockquote><p>You wouldn’t start from page 1 and read every page.</p><p>You’d check the index, find the topic, and jump directly to the relevant page.</p><p>A database index works with a similar idea.</p><p>Instead of scanning every row, the database can use an index to quickly locate relevant records.</p><h3>Without an Index</h3><p>Suppose we have:</p><pre>100,000 notes</pre><p>Bishal searches for:</p><pre>author = &quot;Jyotirmoy&quot;</pre><p>Without an appropriate index, the database may need to examine many rows to find matching records.</p><p>Conceptually:</p><pre>Note 1   → Check<br>Note 2   → Check<br>Note 3   → Check<br>Note 4   → Check<br>...<br>Note 100000 → Check</pre><p>That’s obviously inefficient at scale.</p><h3>With an Index</h3><p>Now suppose we create an index on the author field.</p><p>The database can use the index to locate the relevant records much more efficiently.</p><p>Conceptually:</p><pre>Index<br> ↓<br>Jyotirmoy<br> ↓<br>Matching records<br> ↓<br>Required notes</pre><p>The exact implementation depends on the database and index type, but the fundamental idea remains:</p><blockquote><strong><em>Use additional data structures to make frequently needed lookups faster.</em></strong></blockquote><h3>Where Should We Create Indexes?</h3><p>Indexes are commonly useful on fields that are frequently searched or used for filtering.</p><p>For example:</p><pre>student_id<br>course_id<br>author<br>email<br>created_at</pre><p>But that doesn’t mean:</p><blockquote><em>“Index every column.”</em></blockquote><p>That’s usually a bad idea.</p><h3>The Trade-off</h3><p>Indexes make <strong>reads faster</strong>, but they aren’t free.</p><p>When we insert or update data, the database may also need to update the relevant indexes.</p><p>So:</p><pre>More indexes<br>     ↓<br>Faster certain reads<br>     +<br>More storage<br>     +<br>More work during writes</pre><p>That’s why indexes should be created based on actual query patterns.</p><h3>Process</h3><ol><li>Application sends a database query.</li><li>Database examines the query.</li><li>Database determines whether a suitable index exists.</li><li>If available, the index is used to locate relevant records.</li><li>Database retrieves the required data.</li><li>Results are returned to the application.</li><li>When data changes, the associated index is updated.</li></ol><h3>Example</h3><p>Our university notes database now contains:</p><pre>100,000 notes</pre><p>Bishal frequently searches:</p><pre>author = &quot;Jyotirmoy&quot;</pre><p>We notice that this query is executed thousands of times.</p><p>So we create an index on the author field.</p><p>Now instead of repeatedly searching through a huge dataset, the database has a dedicated lookup structure for that field.</p><p>The result?</p><pre>Bishal<br>   ↓<br>Search &quot;Jyotirmoy&quot;<br>   ↓<br>Index<br>   ↓<br>Matching notes</pre><p>Much better.</p><p>But there’s another problem.</p><p>What happens when <strong>millions of students</strong> are reading notes simultaneously?</p><p>Even with indexing, our database could become overloaded.</p><p>That’s where our next concept comes in <strong><em>Database Replication.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2F7qSr-BTeJqb6iJT6_J3A.png" /></figure><h3>16. Replication</h3><p>Imagine our university app has become popular.</p><p>At first, we have only one database. Every time someone opens notes, uploads a file, or searches for something, the same database has to handle the request.</p><p>That works fine when there are a few users.</p><p>But what happens when <strong>thousands of students start using the app at the same time?</strong></p><p>The database can become overloaded.</p><p>One solution is <strong>Replication</strong>.</p><p>Replication means creating <strong>multiple copies of the same database</strong> and distributing requests between them.</p><p>Usually, we have:</p><ul><li><strong>Primary Database</strong> → Handles write operations.</li><li><strong>Read Replicas</strong> → Handle read operations.</li><li>Data written to the primary is replicated to the read replicas.</li></ul><p>The main advantage is that read traffic doesn’t have to hit one database constantly.</p><h4>Process</h4><ol><li>A user sends a request to the application.</li><li>The application determines whether the request is a <strong>read or write</strong>.</li><li>A write request goes to the <strong>primary database</strong>.</li><li>The primary database stores the new data.</li><li>The updated data is replicated to the read replicas.</li><li>Read requests can be distributed among the replicas.</li><li>If the primary database fails, a replica can potentially be promoted to become the new primary.</li></ol><h4>Simple architecture</h4><pre>                    ┌── Read Replica 1<br>                    │<br>Users → Application ├── Read Replica 2<br>                    │<br>                    └── Read Replica 3<br>                           ↑<br>                           │<br>                     Primary DB<br>                           ↑<br>                       Writes</pre><p>The important idea is:</p><p><strong>One database handles the writes, while multiple copies help handle the reads.</strong></p><h4>Example: Our University Notes App</h4><p>Let’s say <strong>JK, Jyotirmoy, and Bishal</strong> are using our university notes application.</p><p>JK uploads a PDF called <em>DBMS Unit 3.pdf</em></p><p>That is a <strong>write operation</strong>.</p><p>The application sends JK’s upload to the <strong>Primary Database</strong>.</p><pre>JK<br> ↓<br>University App<br> ↓<br>Primary Database</pre><p>The database now contains JK’s notes.</p><p>The updated data is then replicated to the read replicas.</p><p>Later:</p><ul><li><strong>Jyotirmoy</strong> searches for DBMS notes.</li><li><strong>Bishal</strong> opens JK’s uploaded PDF.</li><li>Other students search for the same subject.</li></ul><p>These are mostly <strong>read operations</strong>, so the application can distribute them across different replicas.</p><pre>                ┌→ Read Replica 1 → Jyotirmoy<br>                │<br>University App ─┼→ Read Replica 2 → Bishal<br>                │<br>                └→ Read Replica 3 → Other students<br><br>                         ↑<br>                    Primary DB<br>                         ↑<br>                         JK uploads</pre><p>So instead of forcing every student to query the same database, we have multiple copies helping handle the read traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wJFBjfrVDRPKZkaxc5H_ow.png" /></figure><h4>The simple takeaway</h4><blockquote><strong><em>Replication = Keep multiple copies of your database so that the system can handle more reads and remain available when a database server fails.</em></strong></blockquote><h3>17. Sharding</h3><p>Replication gives us multiple copies of our database.</p><p>But there is another problem.</p><p>What if the <strong>database itself becomes enormous</strong>?</p><p>Imagine our university application now has:</p><ul><li>10 million students</li><li>Millions of notes</li><li>Years of academic records</li><li>Huge numbers of daily requests</li></ul><p>At some point, putting everything into one database server becomes difficult.</p><p>This is where <strong>Sharding</strong> comes in.</p><p>Sharding means <strong>splitting a large database into smaller pieces called shards</strong> and distributing those shards across different servers.</p><p>Each shard contains only a portion of the overall data.</p><p>A common way to distribute data is using a <strong>sharding key</strong>, such as user_id.</p><h4>Process</h4><ol><li>Identify a suitable sharding key.</li><li>Receive a request from the application.</li><li>Determine which shard contains the required data.</li><li>Route the request to that shard.</li><li>The shard processes the request.</li><li>The result is returned to the application.</li><li>Other shards continue handling their own data independently.</li></ol><p>For example:</p><pre>                 University Database<br>                         │<br>          ┌──────────────┼──────────────┐<br>          ↓              ↓              ↓<br>       Shard 1        Shard 2        Shard 3<br>      Users 1–1M     Users 1M–2M    Users 2M–3M</pre><p>Instead of one giant database handling everything, the workload is distributed.</p><h4>Example: Our University App</h4><p>Suppose our application has millions of users.</p><p>We decide to shard users based on their user_id.</p><p>For example:</p><pre>Shard 1 → JK<br>Shard 2 → Jyotirmoy<br>Shard 3 → Bishal</pre><p>Now imagine JK logs into the application.</p><p>The system checks JK’s user_id and determines: <em>“JK’s data belongs to Shard 1.”</em></p><p>The request is sent directly there.</p><p>Later, Jyotirmoy accesses his notes.</p><p>His request is routed to another shard.</p><pre>JK ─────────→ Shard 1<br><br>Jyotirmoy ──→ Shard 2<br><br>Bishal ─────→ Shard 3</pre><p>The database workload is no longer concentrated on one machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8XCMackCNHQ3VkTcJTwv6g.png" /></figure><h4>The simple takeaway</h4><blockquote><strong><em>Sharding = Split a huge database into smaller pieces and distribute those pieces across multiple servers.</em></strong></blockquote><h3>18. Vertical Partitioning</h3><p>Sometimes the problem isn’t the <strong>number of rows</strong> in our database.</p><p>The problem is that each row contains <strong>too many columns</strong>.</p><p>Imagine our Users table contains everything:</p><pre>Name<br>Email<br>Profile Picture<br>Login History<br>IP Address<br>Billing Address<br>Payment Details</pre><p>A simple request such as:</p><blockquote><em>“Give me the student’s name and profile picture.”</em></blockquote><p>shouldn’t necessarily need to deal with all the other information.</p><p><strong>Vertical Partitioning</strong> solves this by splitting a table into smaller tables based on columns.</p><p>For example:</p><pre>User_Profile<br>User_Login<br>User_Billing</pre><h4>Process</h4><ol><li>Identify columns that are frequently accessed together.</li><li>Group related columns.</li><li>Create separate tables.</li><li>Move the relevant columns into those tables.</li><li>Keep a common identifier such as user_id.</li><li>Query only the table containing the information required.</li></ol><h4>Example: Our University App</h4><p>Suppose JK’s profile contains:</p><pre>Name<br>Email<br>Profile Picture<br>Login History<br>IP Address<br>Billing Information</pre><p>Instead of keeping everything together, we could create:</p><pre>User_Profile<br>----------------<br>user_id<br>name<br>email<br>profile_picture<br><br><br>User_Login<br>----------------<br>user_id<br>last_login<br>ip_address<br><br><br>User_Billing<br>----------------<br>user_id<br>billing_address<br>payment_details</pre><p>Now, when Jyotirmoy simply opens someone’s profile, the application doesn’t need to load billing or login information.</p><p>It can retrieve only the required profile data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Zegs6ca5gScnMT9NPPIbw.png" /></figure><h4>The simple takeaway</h4><blockquote><strong><em>Vertical Partitioning = Split a table by columns so different types of information can be stored and accessed separately.</em></strong></blockquote><h3>19. Caching</h3><p>Let’s say JK opens the same DBMS notes every morning.</p><p>Without caching, the application might repeatedly do this:</p><pre>User<br> ↓<br>Application<br> ↓<br>Database<br> ↓<br>Return data</pre><p>Every request reaches the database.</p><p>But what if thousands of students request the same popular notes?</p><p>The database has to repeatedly retrieve the same information.</p><p>That’s unnecessary work.</p><p><strong>Caching</strong> solves this by temporarily storing frequently accessed data in <strong>fast memory</strong>.</p><p>Instead of repeatedly asking the database, the application can retrieve the data from the cache.</p><p>A common approach is the <strong>Cache-Aside Pattern</strong>.</p><h4>Process</h4><ol><li>User requests data.</li><li>Application checks the cache.</li><li>If data exists → <strong>Cache Hit</strong>.</li><li>Return the data immediately.</li><li>If data doesn’t exist → <strong>Cache Miss</strong>.</li><li>Application queries the database.</li><li>Database returns the data.</li><li>Application stores the data in the cache.</li><li>Application returns the response.</li><li>Future requests can retrieve the data directly from the cache.</li></ol><pre>             ┌── Cache Hit → Return quickly<br>             │<br>User → App → Cache<br>             │<br>             └── Cache Miss<br>                    ↓<br>                 Database<br>                    ↓<br>                  Cache</pre><p>Cached data can also have a <strong>TTL (Time-to-Live)</strong> so that it automatically expires after a certain period.</p><h4>Example: Our University Notes App</h4><p>Suppose <strong>JK</strong> uploads a popular DBMS PDF.</p><p>Later, <strong>Jyotirmoy</strong> searches for the same PDF.</p><p>The application checks the cache.</p><p>Since JK’s PDF is already cached:</p><pre>Jyotirmoy<br>    ↓<br>University App<br>    ↓<br>   Cache<br>    ↓<br>DBMS PDF</pre><p>The database doesn’t need to be contacted.</p><p>Then <strong>Bishal</strong> searches for the same PDF.</p><p>The application can again retrieve it from the cache.</p><p>Instead of:</p><pre>JK → Database<br>Jyotirmoy → Database<br>Bishal → Database<br>1000 students → Database</pre><p>we can have:</p><pre>First request<br>      ↓<br>   Database<br>      ↓<br>    Cache<br>      ↓<br>Future requests → Cache</pre><p>That’s why caching can dramatically reduce database load and improve response time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-JoIc64k6bRuMKTxEH8tHg.png" /></figure><h3>The simple takeaway</h3><blockquote><strong><em>Caching = Keep frequently requested data closer to the application so future requests can be served faster.</em></strong></blockquote><h3>20. Denormalization</h3><p>Database normalization is great for keeping data organized and avoiding unnecessary duplication.</p><p>But sometimes there’s a trade-off.</p><p>Suppose our university application has separate tables:</p><pre>Users<br>Orders<br>Notes<br>Subjects</pre><p>To show a student’s complete information, the database might need to perform multiple <strong>JOINs</strong>.</p><p>As the system grows, these joins can become expensive for read-heavy applications.</p><p><strong>Denormalization</strong> takes the opposite approach.</p><p>Instead of keeping everything strictly separated, we intentionally <strong>duplicate some data</strong> so that frequently requested information can be retrieved faster.</p><p>The idea is simple:</p><blockquote><strong><em>Use a little extra storage to reduce expensive database operations.</em></strong></blockquote><h4>Process</h4><ol><li>Identify queries that are executed frequently.</li><li>Find expensive JOIN operations.</li><li>Identify data that is repeatedly needed together.</li><li>Combine selected information into a read-optimized structure.</li><li>Accept some controlled data duplication.</li><li>Update duplicated information whenever the original data changes.</li><li>Use the denormalized structure for faster reads.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YCYoaDgWbKLv410xLXcJXQ.png" /></figure><h4>Example: Our University App</h4><p>Imagine the app displays a student’s uploaded notes like this:</p><pre>JK<br>DBMS Unit 3<br>Uploaded by: JK<br>Email: jk@example.com</pre><p>With a normalized design, the application might need to join:</p><pre>Users + Notes + Subjects</pre><p>Every time the page is loaded.</p><p>Instead, we could create a read-optimized structure:</p><pre>UserNotes<br><br>note_id<br>student_name<br>student_email<br>subject<br>file_name<br>upload_date</pre><p>Now the application can retrieve most of the information with a single query.</p><p>For example:</p><pre>JK → DBMS Unit 3 → PDF</pre><p>Similarly, when <strong>Jyotirmoy</strong> and <strong>Bishal</strong> browse the notes section, the application can quickly retrieve the information without repeatedly joining multiple tables.</p><p>But there’s a catch.</p><p>If JK changes his email address, the duplicated email stored with his notes may also need to be updated.</p><p>So denormalization gives us:</p><p><strong>Faster reads ✅</strong></p><p>but potentially:</p><p><strong>More storage + more complicated updates</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HcxqTjM50qFeKSk-omHm_A.png" /></figure><h4>The simple takeaway</h4><h4><strong><em>Denormalization = Intentionally duplicate some data to make frequent reads faster, at the cost of extra storage and more complex updates.</em></strong></h4><h3>21. CAP Theorem</h3><p>As applications grow, we rarely have everything running on a single machine.</p><p>We may have multiple servers, databases, and even data centers located in different parts of the world.</p><p>That creates a new problem:</p><blockquote><strong>What happens when these machines cannot communicate with each other?</strong></blockquote><p>This is where the <strong>CAP Theorem</strong> becomes important.</p><p>CAP stands for:</p><ul><li><strong>Consistency</strong> → Every user gets the latest available data.</li><li><strong>Availability</strong> → The system continues responding to requests.</li><li><strong>Partition Tolerance</strong> → The system continues working even when communication between servers is disrupted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*uKfc-gvjkR759GwLe6B8JA.png" /></figure><p>The important idea is that in a distributed system, when a network partition happens, you generally have to make a trade-off between <strong>Consistency and Availability</strong>.</p><h4>CP — Consistency + Partition Tolerance</h4><p>The system prefers giving users correct, consistent data, even if that means temporarily refusing some requests.</p><p>Imagine a banking application. Showing an outdated account balance could be much worse than temporarily saying:</p><blockquote><em>“Please try again later.”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nCenFE3edy6QpOTGIH2RbA.png" /></figure><h4>AP — Availability + Partition Tolerance</h4><p>The system prefers staying available, even if some users temporarily see slightly outdated information.</p><p>This can make sense for systems such as social media feeds, where seeing an older post for a few seconds isn’t usually disastrous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ESRHhLX54iwiMvQ61UCxA.png" /></figure><h3>Process</h3><p>When a distributed system is operating normally:</p><ol><li>Multiple servers communicate with each other.</li><li>Data is replicated across different nodes.</li><li>A user sends a request.</li><li>The system retrieves the required data.</li><li>The response is returned normally.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tKSZXUYUbij_ovE377gFpw.png" /></figure><p>Now imagine a network failure:</p><ol><li>Two database nodes can no longer communicate.</li><li>The system must decide how to handle incoming requests.</li><li>A <strong>CP-oriented system</strong> may reject or delay some requests to maintain consistency.</li><li>An <strong>AP-oriented system</strong> may continue responding using locally available data.</li><li>Once communication is restored, replicas can synchronize.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*496iYtMHaeuluH5J60fW5Q.png" /></figure><p>This is also where <strong>eventual consistency</strong> becomes useful.</p><p>The idea is simple:</p><blockquote><em>The data might not be identical everywhere immediately, but the replicas eventually converge to the same state.</em></blockquote><h4>Example — Our University App</h4><p>Imagine <strong>JK, Jyotirmoy, and Bishal</strong> are using our university notes application.</p><p>We have two database servers:</p><pre>        University App<br>              |<br>       ┌──────┴──────┐<br>       ↓             ↓<br>   Database A     Database B</pre><p>JK uploads a new DBMS note.</p><p>The update reaches Database A, but suddenly the network connection between A and B breaks.</p><p>Now we have two choices.</p><h4>Consistency-first approach</h4><p>The system could temporarily stop certain operations until both databases agree.</p><p>JK might see:</p><blockquote><em>“Unable to save changes. Please try again.”</em></blockquote><p>Annoying — but the system avoids inconsistent data.</p><h4>Availability-first approach</h4><p>The system could allow users to continue using the application.</p><p>Bishal might temporarily see the old version of the notes.</p><p>Once the network connection returns, Database B synchronizes with Database A.</p><p>That’s the basic trade-off behind CAP.</p><h3>22. Blob Storage</h3><p>Our applications don’t only deal with text.</p><p>Think about everything a university application might need to store:</p><ul><li>PDF notes</li><li>Profile pictures</li><li>Assignment files</li><li>Recorded lectures</li><li>Images</li><li>Videos</li><li>Project files</li></ul><p>Trying to put all these large files directly into a traditional database isn’t always the best approach.</p><p>This is where <strong>Blob Storage</strong> comes in.</p><p>Blob storage is designed for storing <strong>large, unstructured files</strong>, such as images, videos, PDFs, and documents.</p><p>Instead of storing the entire file inside our application database, we can store the file in a dedicated storage service.</p><p>The application database can then store information such as:</p><pre>File name<br>File type<br>File size<br>Owner<br>Storage location<br>Upload date</pre><p>while the actual file lives in blob storage.</p><p>Services such as Amazon S3, Azure Blob Storage, and Google Cloud Storage follow this general idea.</p><h4>Process</h4><p>When a user uploads a file:</p><ol><li>JK selects a PDF from his device.</li><li>The application receives the upload.</li><li>The file is sent to blob storage.</li><li>Blob storage stores the actual file.</li><li>A unique identifier or URL is generated.</li><li>The application stores the file’s metadata.</li><li>When another user requests the file, the application retrieves it from storage.</li><li>The file is delivered to the user.</li></ol><p>This separates <strong>application data</strong> from <strong>large file storage</strong>.</p><h4>Example — Our University Notes App</h4><p>Suppose <strong>Jyotirmoy</strong> uploads: DBMS_Unit_3.pdf</p><p>Instead of putting the entire PDF inside our main database:</p><pre>Database<br>   |<br>   └── DBMS_Unit_3.pdf ❌</pre><p>we can do:</p><pre>Database<br>   |<br>   └── File metadata<br>          |<br>          └── Storage reference<br>                    |<br>                    ↓<br>              Blob Storage<br>                    |<br>                    └── DBMS_Unit_3.pdf</pre><p>So when <strong>Bishal</strong> opens the note, our application knows where the file is stored and retrieves it.</p><p>This becomes especially useful when thousands of students start uploading files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dkm6nPTrkPt3iCztRtVCKw.png" /></figure><h3>23. CDN</h3><p>Imagine <strong>Bishal</strong> is in India and our university application stores a large video on a server located in the United States.</p><p>Every time Bishal watches that video, the data has to travel a huge distance.</p><p>That can result in:</p><ul><li>Higher latency</li><li>Slower loading</li><li>Buffering</li><li>Poor user experience</li></ul><p>This is where a <strong>CDN — Content Delivery Network</strong> helps.</p><p>A CDN is a network of geographically distributed servers called <strong>edge servers</strong>.</p><p>Instead of making every user download content from the original server, frequently requested content can be cached closer to users.</p><p>For example:</p><pre>                 Origin Server<br>                      |<br>          ┌───────────┼───────────┐<br>          ↓           ↓           ↓<br>       India        Europe      USA<br>       Edge         Edge        Edge</pre><p>A user can receive cached content from a nearby edge location instead of always contacting the origin server.</p><p>CDNs are commonly used for:</p><ul><li>Images</li><li>Videos</li><li>JavaScript</li><li>CSS</li><li>Static webpages</li><li>Downloads</li></ul><h4>Process</h4><ol><li>A user requests a file.</li><li>The request reaches the CDN.</li><li>The CDN checks whether the requested content is cached.</li><li>If it is available, the CDN returns it immediately.</li><li>If it isn’t available, the CDN requests it from the origin server.</li><li>The CDN receives the content.</li><li>It can cache the content at the edge.</li><li>Future users near that location can receive the cached version.</li></ol><p>This reduces the distance between users and frequently accessed content.</p><h4>Example — Our University App</h4><p>Suppose <strong>JK</strong> uploads a popular: DBMS_Complete_Notes.pdf</p><p>Thousands of students start downloading it.</p><p>Without a CDN:</p><pre>JK&#39;s Notes<br>     ↓<br>Origin Server<br>     ↓<br>Every Student</pre><p>The origin server has to handle every request.</p><p>With a CDN:</p><pre>                 Origin<br>                   |<br>             CDN Edge Servers<br>             /      |       \<br>          India   Europe    USA<br>            |<br>        Students</pre><p>Now <strong>Jyotirmoy</strong>, who is accessing the file from India, can receive the cached content from an Indian edge location.</p><p>The origin server doesn’t need to serve every single request.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hn4d54LRtCM4xVxebYVhgA.png" /></figure><h3>24. WebSockets</h3><p>Most websites communicate using the traditional <strong>request-response model</strong>.</p><p>The client asks:</p><blockquote><em>“Do you have any new data?”</em></blockquote><p>The server responds.</p><p>If the client wants another update, it asks again.</p><p>That works perfectly well for many applications.</p><p>But imagine building a <strong>live chat application</strong>.</p><p>You don’t want your phone to ask the server every two seconds:</p><p>That’s where <strong>WebSockets</strong> become useful.</p><p>WebSockets provide a <strong>persistent, two-way connection</strong> between a client and server.</p><p>Once the connection is established:</p><ul><li>The client can send data to the server.</li><li>The server can send data to the client.</li><li>Neither side needs to repeatedly create a new connection.</li></ul><p>This makes WebSockets useful for:</p><ul><li>Live chat</li><li>Multiplayer games</li><li>Live notifications</li><li>Real-time dashboards</li><li>Collaborative applications</li><li>Live tracking</li></ul><h4>Process</h4><ol><li>The client requests a WebSocket connection.</li><li>The server accepts the connection.</li><li>A persistent connection is established.</li><li>The connection remains open.</li><li>The client can send messages whenever necessary.</li><li>The server can push messages whenever an event occurs.</li><li>Neither side needs to repeatedly poll for updates.</li><li>The connection remains active until one side closes it.</li></ol><h4>Example — University Group Chat</h4><p>Imagine <strong>JK, Jyotirmoy, and Bishal</strong> are inside a group chat.</p><p>JK sends:</p><blockquote><em>“Tomorrow’s DBMS class is at 10 AM.”</em></blockquote><p>With a traditional polling approach, Jyotirmoy’s app might repeatedly ask:</p><pre>Any new message?<br>Any new message?<br>Any new message?</pre><p>With WebSockets:</p><pre>JK<br> ↓<br>WebSocket Server<br> ↓<br>Jyotirmoy<br>Bishal</pre><p>The moment JK sends the message, the server can push it to Jyotirmoy and Bishal.</p><p>No repeated polling is required.</p><p>That’s why WebSockets are so useful for <strong>real-time communication</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gC7r7FDSLCMTM7QW8NTSNQ.png" /></figure><h3>25. Webhooks</h3><p>WebSockets are useful when a <strong>client and server need real-time communication</strong>.</p><p>But what if one server needs to tell another server:</p><blockquote><em>“Something just happened.”</em></blockquote><p>For example, your payment has been completed.</p><p>Instead of your application repeatedly asking:</p><blockquote><em>“Was the payment successful?”</em></blockquote><blockquote><em>“Was the payment successful?”</em></blockquote><blockquote><em>“Was the payment successful?”</em></blockquote><p>we can use a <strong>webhook</strong>.</p><p>A webhook is essentially an <strong>event-driven HTTP callback</strong>.</p><p>Instead of your application continuously checking another service for updates, the external service sends a request to your application automatically when a specific event occurs.</p><p>For example:</p><pre>Payment completed<br>       ↓<br>Payment Service<br>       ↓<br>POST /webhook<br>       ↓<br>Our Application</pre><p>Webhooks are commonly used for events such as:</p><ul><li>Payment completed</li><li>GitHub push</li><li>New subscription</li><li>Order shipped</li><li>Email delivery</li><li>User registration</li></ul><h4>Process</h4><ol><li>Our application provides a webhook URL.</li><li>The external service stores that URL.</li><li>An event occurs.</li><li>The external service creates an HTTP request.</li><li>It sends the request to our webhook URL.</li><li>Our application receives the event.</li><li>The application verifies the request.</li><li>It processes the event.</li><li>The application updates its database or triggers another action.</li></ol><h4>Example — University Payment System</h4><p>Imagine our university application allows students to pay their semester fees online.</p><p><strong>JK</strong> makes a payment.</p><p>Instead of our application repeatedly asking the payment provider:</p><pre>Payment successful?</pre><p>we register a webhook.</p><p>When the payment succeeds:</p><pre>JK<br> ↓<br>Payment Gateway<br> ↓<br>POST /payment-webhook<br> ↓<br>University Backend<br> ↓<br>Database</pre><p>The payment provider tells our application:</p><blockquote><em>“JK’s payment was successful.”</em></blockquote><p>Our backend can then update JK’s account:</p><pre>Payment Status: PAID</pre><p><strong>Jyotirmoy</strong> and <strong>Bishal</strong> don’t need to do anything manually — the system reacts automatically to the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*42b80GmlSPAEsnEvXAhWww.png" /></figure><p>That’s the real power of webhooks:</p><blockquote><strong><em>Don’t keep asking whether something happened. Let the system tell you when it happens.</em></strong></blockquote><h3>26. Microservices</h3><p>As an application grows, putting <strong>everything into one codebase</strong> can eventually become difficult to manage.</p><p>Imagine our university app contains:</p><ul><li>Authentication</li><li>Notes</li><li>Payments</li><li>Notifications</li><li>User profiles</li><li>Search</li></ul><p>If all of these live inside one large application, a small change in one feature can potentially affect the others.</p><p>This is where <strong>Microservices Architecture</strong> comes in.</p><p>A <strong>microservice</strong> is a small, independent service responsible for a specific business function.</p><p>Instead of building one huge application, we split it into multiple services.</p><p>For example:</p><pre>                 University App<br>                       |<br>        ┌──────────────┼──────────────┐<br>        ↓              ↓              ↓<br>   Auth Service    Notes Service   Payment Service<br>        ↓              ↓              ↓<br>    Database        Database        Database</pre><p>Each service can be:</p><ul><li>Developed independently</li><li>Deployed independently</li><li>Scaled independently</li><li>Maintained independently</li></ul><p>The services communicate using <strong>APIs or message queues</strong>.</p><p>The important idea isn’t simply “make lots of small services.”</p><p>It’s:</p><blockquote><strong><em>Give each service a clear responsibility.</em></strong></blockquote><h4>Process</h4><ol><li>A user sends a request to the application.</li><li>The request is routed to the appropriate service.</li><li>That microservice processes the request.</li><li>It communicates with its database or another service if required.</li><li>The service returns the result.</li><li>Other services continue operating independently.</li><li>If one service needs more capacity, only that service can be scaled.</li></ol><p>For example, if the Notes Service suddenly receives thousands of requests, we can scale the Notes Service without necessarily scaling the Payment Service.</p><h4>Example — Our University App</h4><p>Imagine <strong>JK, Jyotirmoy, and Bishal</strong> are using our application.</p><p>Instead of one giant application:</p><pre>University App<br> ├── Login<br> ├── Notes<br> ├── Payments<br> ├── Notifications<br> └── Search</pre><p>we could have:</p><pre>                    University App<br>                          |<br>       ┌──────────┬───────┼───────┬──────────┐<br>       ↓          ↓       ↓       ↓          ↓<br>     Auth       Notes   Payment  Search   Notification<br>    Service    Service  Service  Service    Service</pre><p>Suppose the <strong>Notes Service</strong> suddenly becomes extremely popular before exams.</p><p>We can add more Notes Service instances:</p><pre>                 Notes Requests<br>                       |<br>                ┌──────┴──────┐<br>                ↓             ↓<br>           Notes Server 1  Notes Server 2</pre><p>Meanwhile, the Payment Service doesn’t need to scale just because students are downloading notes.</p><h4>The trade-off</h4><p>Microservices aren’t automatically better.</p><p>They also introduce complexity:</p><ul><li>More services to monitor</li><li>Network communication</li><li>Distributed debugging</li><li>More deployment infrastructure</li><li>Data consistency challenges</li></ul><p>So for a small application, a <strong>monolith can actually be the simpler and better choice</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRexNkAJiwk1EC0seFo6-Q.png" /></figure><h3>27. Message Queues</h3><p>Microservices solve one problem: <strong>breaking a large application into independent services.</strong></p><p>But now we have another problem:</p><p><strong>How should those services communicate?</strong></p><p>One option is to directly call another service.</p><p>But imagine the Payment Service is temporarily overloaded.</p><p>If the Order Service waits for it to respond, requests can start piling up.</p><p>A <strong>Message Queue</strong> provides another approach.</p><p>A message queue acts as a temporary communication layer between services.</p><p>Instead of one service directly waiting for another service to finish, it can place a message into a queue.</p><p>The receiving service processes that message when it is ready.</p><pre>Producer<br>   ↓<br>Message Queue<br>   ↓<br>Consumer</pre><p>This is called <strong>asynchronous communication</strong>.</p><p>The producer doesn’t necessarily need to wait for the consumer to finish.</p><h4>Process</h4><ol><li>A service generates an event or task.</li><li>It creates a message.</li><li>The message is placed into the queue.</li><li>The queue stores it temporarily.</li><li>The consumer service becomes available.</li><li>It retrieves the message.</li><li>The consumer processes the task.</li><li>The message is acknowledged or removed.</li></ol><p>This helps services handle traffic spikes without immediately overwhelming one another.</p><h4>Example — University Assignment System</h4><p>Suppose <strong>JK</strong> submits an assignment.</p><p>After submission, several things need to happen:</p><ul><li>Save the assignment</li><li>Notify the teacher</li><li>Send confirmation to JK</li><li>Update submission statistics</li></ul><p>Instead of making JK’s request wait for everything:</p><pre>JK<br> ↓<br>Assignment Service<br> ↓<br>Notification<br> ↓<br>Statistics<br> ↓<br>Confirmation</pre><p>we could use a queue:</p><pre>JK<br> ↓<br>Assignment Service<br> ↓<br>Message Queue<br> ├── &quot;Send notification&quot;<br> ├── &quot;Update statistics&quot;<br> └── &quot;Generate confirmation&quot;</pre><p>Now <strong>Jyotirmoy</strong> and <strong>Bishal</strong> can continue using the application while background services process these tasks.</p><p>Popular technologies include <strong>Kafka, RabbitMQ, and Amazon SQS</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UX3Q7AbjRiOyE8v5_sEdhw.png" /></figure><h3>28. Rate Limiting</h3><p>Imagine our university app suddenly becomes popular.</p><p>Then a bot starts sending:</p><p><strong>10,000 requests every second.</strong></p><p>If we allow every request through, our servers could become overloaded.</p><p>And even worse, legitimate users like <strong>JK, Jyotirmoy, and Bishal</strong> might experience a slow or completely unavailable application.</p><p>This is where <strong>Rate Limiting</strong> helps.</p><p>Rate limiting controls <strong>how many requests a client can make within a specific period of time</strong>.</p><p>For example:</p><blockquote><strong><em>100 requests per minute per user</em></strong></blockquote><p>If a user crosses the limit, additional requests can temporarily be rejected.</p><p>The server commonly responds with:</p><pre>HTTP 429 — Too Many Requests</pre><p>Rate limiting helps:</p><ul><li>Protect servers</li><li>Prevent abuse</li><li>Control resource usage</li><li>Reduce excessive API traffic</li><li>Keep services available for legitimate users</li></ul><h4>Process</h4><ol><li>A user sends a request.</li><li>The rate limiter identifies the user or IP.</li><li>It checks how many requests have already been made.</li><li>If the user is below the limit, the request is allowed.</li><li>If the limit is exceeded, the request is rejected.</li><li>After the appropriate time or token refill, requests can be accepted again.</li></ol><p>Common approaches include:</p><ul><li><strong>Fixed Window</strong></li><li><strong>Sliding Window</strong></li><li><strong>Token Bucket</strong></li></ul><h4>Example — Our University App</h4><p>Suppose we allow each student:</p><blockquote><strong><em>100 API requests per minute</em></strong></blockquote><p><strong>Jyotirmoy</strong> makes 50 requests.</p><pre>50 / 100<br>✓ Allowed</pre><p><strong>Bishal</strong> makes 98 requests.</p><pre>98 / 100<br>✓ Allowed</pre><p>But a bot starts making:</p><pre>5,000 requests/minute</pre><p>The rate limiter stops the excessive traffic:</p><pre>Bot<br> ↓<br>Rate Limiter<br> ↓<br>100 requests → ✓<br>Remaining requests → ❌ HTTP 429</pre><p>This protects the application so <strong>JK, Jyotirmoy, and Bishal</strong> can continue using it normally.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*znsTy6yOT28BTIVeRUGy1Q.png" /></figure><h3>29. API Gateway</h3><p>By now, our university application has several microservices:</p><pre>Auth<br>Notes<br>Payments<br>Search<br>Notifications</pre><p>Should we expose every single service directly to users?</p><p>Probably not.</p><p>Instead, we can introduce an <strong>API Gateway</strong>.</p><p>An API Gateway acts as a <strong>single entry point</strong> between clients and backend services.</p><p>Instead of:</p><pre>Client → Auth<br>Client → Notes<br>Client → Payment<br>Client → Search</pre><p>we have:</p><pre>                    ┌── Auth<br>                    ├── Notes<br>Client → API Gateway├── Payment<br>                    ├── Search<br>                    └── Notifications</pre><p>The gateway can handle responsibilities such as:</p><ul><li>Authentication</li><li>Rate limiting</li><li>Request routing</li><li>Logging</li><li>Monitoring</li><li>Request transformation</li></ul><h4>Process</h4><ol><li>The client sends a request.</li><li>The request reaches the API Gateway.</li><li>The gateway authenticates the request.</li><li>It checks rate limits and other policies.</li><li>It identifies the appropriate backend service.</li><li>It forwards the request.</li><li>The backend service processes it.</li><li>The response returns to the gateway.</li><li>The gateway sends the response back to the client.</li></ol><h4>Example — Our University App</h4><p>Suppose <strong>JK</strong> wants to download his notes.</p><p>He doesn’t need to know which server handles notes.</p><p>He simply sends:</p><pre>JK<br> ↓<br>API Gateway<br> ↓<br>Notes Service<br> ↓<br>Database</pre><p>Meanwhile, <strong>Jyotirmoy</strong> might be making a payment:</p><pre>Jyotirmoy<br> ↓<br>API Gateway<br> ↓<br>Payment Service</pre><p>And <strong>Bishal</strong> might be searching for notes:</p><pre>Bishal<br> ↓<br>API Gateway<br> ↓<br>Search Service</pre><p>The gateway acts like the <strong>front door of our backend</strong>.</p><p>The users don’t need to know what happens behind that door.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*24jJmmM0XZXL6CNNGBdR3w.png" /></figure><h3>30. Idempotency</h3><p>Now we reach one of those concepts that sounds complicated but becomes very simple with the right example.</p><p>Imagine <strong>JK is paying his university fees online</strong>.</p><p>He clicks:</p><blockquote><strong><em>Pay ₹5,000</em></strong></blockquote><p>The payment request reaches the server.</p><p>But then something goes wrong.</p><p>Maybe the network connection drops.</p><p>JK doesn’t know whether the payment succeeded.</p><p>So he clicks <strong>Pay</strong> again.</p><p>Now the server receives the same payment twice.</p><p>Without protection:</p><pre>JK<br> ↓<br>Pay ₹5,000<br> ↓<br>₹5,000 charged<br><br>JK retries<br> ↓<br>Pay ₹5,000<br> ↓<br>Another ₹5,000 charged ❌</pre><p>This is exactly the kind of problem <strong>idempotency</strong> helps solve.</p><p>An operation is <strong>idempotent</strong> when performing the same operation multiple times produces the same final result as performing it once.</p><p>For important operations such as payments, we can give each request a unique <strong>idempotency key</strong>.</p><p>For example:</p><pre>payment_request_12345</pre><p>The server remembers whether that request has already been processed.</p><h4>Process</h4><ol><li>The client generates a unique request ID.</li><li>The request is sent to the server.</li><li>The server checks whether the ID was processed before.</li><li>If it is new, the operation is performed.</li><li>The server stores the result against that ID.</li><li>If the same request arrives again, the server recognizes it.</li><li>Instead of performing the operation again, it returns the previous result.</li></ol><h4>Example — JK’s University Payment</h4><p>JK clicks <strong>Pay ₹5,000</strong>.</p><p>The request contains:</p><pre>Idempotency-Key:<br>payment_12345</pre><p>The server processes it:</p><pre>payment_12345<br>      ↓<br>₹5,000 charged ✓<br>      ↓<br>Status: SUCCESS</pre><p>But JK’s internet connection drops.</p><p>He clicks <strong>Pay</strong> again.</p><p>The server receives:</p><pre>payment_12345</pre><p>It checks its records:</p><blockquote><em>“I’ve already processed this request.”</em></blockquote><p>So instead of charging JK again, it returns:</p><pre>Payment already processed.<br>Status: SUCCESS</pre><p>Now:</p><ul><li><strong>JK isn’t charged twice</strong></li><li><strong>Jyotirmoy doesn’t need to manually fix the transaction</strong></li><li><strong>Bishal’s payment isn’t affected</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6bdGYNKUksU-sX3pOpKp2Q.png" /></figure><p>That’s idempotency in action.</p><blockquote><strong><em>The request can be repeated, but the side effect happens only once.</em></strong></blockquote><h3>Ending Your 30-Concept Journey</h3><p>You can finish the article with something more personal instead of a generic <em>“Thanks for reading.”</em></p><h4>What I Actually Learned From These 30 Concepts</h4><p>When I first started learning <strong>System Design</strong>, I thought it was mostly about memorizing terms like:</p><p><em>Load Balancer, Sharding, Caching, Microservices, CAP Theorem.</em></p><p>But eventually I realized that these aren’t isolated concepts.</p><p>They’re pieces of the <strong>same story</strong>.</p><pre>A user opens an application.<br>↓<br>The request reaches a server.<br>↓<br>DNS helps find it.<br>↓<br>A proxy or gateway handles the request.<br>↓<br>A load balancer distributes traffic.<br>↓<br>The application talks to APIs and databases.<br>↓<br>Caching makes frequent requests faster.<br>↓<br>Replication and sharding help databases scale.<br>↓<br>CDNs bring content closer to users.<br>↓<br>WebSockets provide real-time communication.<br>↓<br>Message queues connect services asynchronously.<br>↓<br>Rate limiting protects the system.<br>↓<br>And idempotency prevents dangerous duplicate operations.</pre><p>And suddenly, <strong>System Design started feeling less like memorizing 30 definitions and more like understanding how a real application grows.</strong></p><p>That’s probably the biggest lesson I took away from learning these concepts.</p><blockquote><strong><em>Don’t try to memorize System Design. Build a mental picture of the system — and understand why each piece exists.</em></strong></blockquote><p>And honestly, if <strong>JK, Jyotirmoy, Bishal, and I</strong> were building our university app, we’d probably discover half of these concepts the hard way. 😄</p><p><strong>That’s exactly why learning them beforehand is worth it.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eecca5ffc35d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to AI Agents in 2026 ]]></title>
            <link>https://medium.com/@rajdeepmudiar02/a-beginners-guide-to-ai-agents-in-2026-a9f09c647c85?source=rss-24ca01f93c57------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9f09c647c85</guid>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[aiml]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Rajdeep Mudiar]]></dc:creator>
            <pubDate>Wed, 10 Jun 2026 14:39:45 GMT</pubDate>
            <atom:updated>2026-06-10T14:39:45.427Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*k6pfxuU_JPtw87Ze3cEDuA.png" /></figure><p>Technology keeps changing how we build software.</p><p>In 2010, it was mobile apps. In 2016, it was deep learning. In 2022, it<br>was large language models (LLMs).</p><p>Now in 2026, the next big shift is AI agents.</p><p>You might have heard the term everywhere ,but what exactly are AI<br>agents?</p><p>Let’s break it down.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>The Problem with Normal AI</strong></p><p>A regular AI chatbot like ChatGPT is great at answering questions.</p><p>You can ask: “Plan my week, reply to my emails, and book a restaurant.”</p><p>It can suggest a plan, but it won’t actually complete those tasks.</p><p>That’s because traditional LLMs are mostly reactive. They respond when<br>you ask.</p><p>They don’t automatically: — take actions — use external tools — make<br>decisions — continue working toward a goal</p><p>AI agents change this.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p>What is an AI Agent?</p><p>An AI agent is an AI system that can reason, plan, and take actions.</p><p>It combines an LLM with abilities like:</p><p>- Using tools (APIs, search, databases, code)<br>- Breaking tasks into steps<br>- Remembering information<br>- Making decisions<br>- Running until the task is complete</p><p>A calculator gives you an answer.</p><p>A programmer understands the problem and finds a solution.</p><p>AI agents are closer to programmers.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>How Does an AI Agent Work?</strong></p><p>An agent usually has four main parts:</p><p><strong>1. LLM (The Brain)</strong></p><p>Models like GPT, Claude, Gemini, and Llama help the agent understand<br>instructions and decide what to do.</p><p><strong>2. Tools (The Hands)</strong></p><p>Tools let agents interact with the world:</p><p>search_web() run_code() send_email()</p><p><strong>3. Memory</strong></p><p>Agents can remember: — current conversation — previous interactions -<br>stored information</p><p><strong>4. Agent Loop</strong></p><p>Most agents follow:</p><p>Think → Act → Observe → Repeat</p><p>They keep working until the goal is achieved.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*n0IYpGvSoSirsWoDnHgHTA.png" /></figure><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>ReAct</strong>: How Agents Think</p><p>One popular approach is ReAct (Reasoning + Acting).</p><p>Example:</p><p><strong>User:</strong> “Find today’s NVIDIA stock price.”</p><p><strong>Agent</strong></p><p>Thought: I need current data.</p><p>Action: Search stock price.</p><p>Observation: NVIDIA is trading at $124.50.</p><p>Answer: NVIDIA is currently $124.50.</p><p>The agent doesn’t just answer — it figures out how to get the answer.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Where Are AI Agents Used?</strong></p><p>Customer Support: Read messages, check orders, process refunds.</p><p>Research: Search information, summarize papers, create reports.</p><p>Coding: Find bugs, write fixes, run tests.</p><p>Productivity: Manage schedules, emails, and tasks.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Popular Agent Frameworks</strong></p><p>LangChain: For building LLM applications and simple agents.</p><p>LangGraph: For advanced workflows and stateful agents.</p><p>CrewAI: For multiple AI agents working together.</p><p>AutoGen: For multi-agent collaboration.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>The Future: Multi-Agent Systems</strong></p><p>The future is not just one AI agent.</p><p>It’s teams of agents.</p><p>Manager Agent → Creates tasks Developer Agent → Writes code Tester Agent<br>→ Finds bugs Deployment Agent → Releases apps</p><p>AI agents working together like a team.</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>How to Start Learning</strong></p><p>1. Learn LLM basics<br>2. Learn Python<br>3. Build a simple chatbot<br>4. Create a tool-using agent<br>5. Explore LangChain, LangGraph, and CrewAI</p><p>— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —</p><p><strong>Final Thoughts</strong></p><p>AI is moving from “AI that answers” to “AI that acts.”</p><p>Agents are changing how we interact with software.</p><p>You don’t need a PhD to start building them.</p><p>Start small. Build projects. Experiment.</p><p>The agent era is here. 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9f09c647c85" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenAI Just Solved an 80-Year-Old Math Problem — And That Changes Everything]]></title>
            <link>https://medium.com/@rajdeepmudiar02/openai-just-solved-an-80-year-old-math-problem-and-that-changes-everything-bce0133846ea?source=rss-24ca01f93c57------2</link>
            <guid isPermaLink="false">https://medium.com/p/bce0133846ea</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Rajdeep Mudiar]]></dc:creator>
            <pubDate>Wed, 27 May 2026 13:18:15 GMT</pubDate>
            <atom:updated>2026-05-27T13:37:35.187Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>OpenAI Just Solved an 80-Year-Old Math Problem — And That Changes Everything</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yhvnUpJPWv1Jf-LoQ3UdrA.png" /></figure><p>Most people think AI is just about chatbots, image generators, or writing code.</p><p>But something happened this week that quietly changed the future of human intelligence itself.</p><p>OpenAI’s latest reasoning model reportedly solved a mathematical problem that had remained unsolved for nearly 80 years — a challenge that defeated generations of brilliant mathematicians.</p><p>And honestly?</p><p>This is much bigger than math.</p><p>---</p><p>The Problem That Refused to Be Solved</p><p>Back in 1946, legendary mathematician Paul Erdős posed a deceptively simple question in discrete geometry:</p><p>«How many pairs of points can exist exactly one unit apart on a flat plane?»</p><p>Sounds easy at first.</p><p>But this “unit distance problem” became one of the most frustrating puzzles in mathematics. For decades, researchers attacked it from every angle using advanced theories, computer simulations, and pure human creativity.</p><p>Still, no complete breakthrough.</p><p>Until now.</p><p>---</p><p>What OpenAI’s AI Actually Did</p><p>OpenAI revealed that its newest reasoning-focused AI generated an original mathematical proof related to the long-standing conjecture.</p><p>That’s important because this wasn’t memorization.</p><p>The AI didn’t just search Google.<br>It didn’t repeat existing formulas.<br>It created new reasoning.</p><p>That’s the real breakthrough.</p><p>For years, people believed creativity, intuition, and abstract reasoning were uniquely human abilities.</p><p>This achievement seriously challenges that assumption.</p><p>---</p><p>Why This Is a Huge Deal</p><p>Most AI headlines are about:</p><p>- Better image generation<br>- Faster coding<br>- More realistic chatbots</p><p>But mathematics is different.</p><p>Math requires:</p><p>- Deep logical reasoning<br>- Pattern recognition<br>- Multi-step thinking<br>- Creativity under constraints<br>- Building entirely new ideas</p><p>An AI doing this successfully signals a major leap forward in machine intelligence.</p><p>And the implications go far beyond geometry.</p><p>---</p><p>Imagine What Comes Next</p><p>If AI can help solve unsolved math problems, imagine its impact on:</p><p>Medicine</p><p>AI could discover new drug combinations or treatments humans overlooked.</p><p>Physics</p><p>It may uncover hidden patterns in quantum mechanics or cosmology.</p><p>Climate Science</p><p>AI could optimize energy systems and model climate solutions faster than ever.</p><p>Engineering</p><p>Future materials, batteries, and chips might be designed collaboratively between humans and AI.</p><p>We’re entering an era where AI doesn’t just automate work.</p><p>It accelerates discovery itself.</p><p>---</p><p>This Doesn’t Replace Humans — It Amplifies Them</p><p>A lot of people fear AI because they think it will replace human intelligence.</p><p>But breakthroughs like this suggest something more interesting:</p><p>Humans ask the important questions.<br>AI explores millions of possible paths.<br>Together, they solve problems neither could solve alone.</p><p>That’s not replacement.</p><p>That’s amplification.</p><p>---</p><p>The Bigger Picture: Are We Moving Toward AGI?</p><p>This achievement also reignites the conversation around Artificial General Intelligence (AGI).</p><p>AGI refers to systems capable of learning, reasoning, and solving problems across many domains like humans can.</p><p>We’re not fully there yet.</p><p>But solving complex abstract problems — especially ones requiring genuine reasoning — is a massive milestone.</p><p>It shows AI is evolving from:</p><p>- Pattern prediction → toward structured reasoning<br>- Tool usage → toward discovery<br>- Assistance → toward collaboration</p><p>And that shift changes everything.</p><p>---</p><p>The “Deep Blue” Moment for Reasoning</p><p>In 1997, IBM’s Deep Blue defeated chess champion Garry Kasparov.</p><p>That moment proved machines could outperform humans in strategic games.</p><p>This feels similar —<br>except instead of mastering a game with fixed rules, AI is now contributing to entirely new human knowledge.</p><p>That’s a completely different level.</p><p>---</p><p>Final Thoughts</p><p>For decades, we viewed AI as a tool.</p><p>Now we may need to start viewing it as a research partner.</p><p>And whether that excites you or scares you, one thing is becoming impossible to ignore:</p><p>The age of AI-powered discovery has officially begun.</p><p>The next scientific breakthrough…<br>the next medical cure,the next revolutionary invention might not come from a human working alone.</p><p>---</p><p>Follow for more content on AI, future tech, machine learning, and the future of human innovation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bce0133846ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>