<?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 Saraswathinandra on Medium]]></title>
        <description><![CDATA[Stories by Saraswathinandra on Medium]]></description>
        <link>https://medium.com/@saraswathinandra?source=rss-d345fdb5c4fa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*AQNZn88h5JHa9MZO</url>
            <title>Stories by Saraswathinandra on Medium</title>
            <link>https://medium.com/@saraswathinandra?source=rss-d345fdb5c4fa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 13:45:07 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@saraswathinandra/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[“The Evolution of an Application: From One Server to Millions of Users”]]></title>
            <link>https://medium.com/@saraswathinandra/the-evolution-of-an-application-from-one-server-to-millions-of-users-1d8b8e8595f9?source=rss-d345fdb5c4fa------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d8b8e8595f9</guid>
            <dc:creator><![CDATA[Saraswathinandra]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 11:19:22 GMT</pubDate>
            <atom:updated>2026-03-31T11:19:22.800Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, I’m sharing the journey about how an application handles huge traffic and how systems actually grow step by step in a simple way. This is not a strict rulebook — real systems may differ — but this flow gives a clear understanding of how things evolve.</p><p>Let’s get started.</p><p><strong>Step 1: It All Starts Simple — Single Server:<em><br></em></strong>Every application begins small.</p><p>At the start, everything runs on one machine. It receives requests, processes them, stores data, and sends responses back.</p><p>When a user opens your app:</p><ul><li>The domain is converted into an IP address</li><li>The request reaches your server</li><li>The server processes it and returns the response</li></ul><p>That’s it. Straightforward.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wxUnRmOj-PIYljJYXBmHng.png" /></figure><p>This setup is easy to manage and cost-effective.<br>But things change when users start increasing.</p><p>More users -&gt; more requests -&gt; more pressure on the same server.</p><p>Slowly, performance drops. Sometimes, the app may even crash.</p><p>And the biggest risk?</p><p>If that one server goes down, your entire app goes down with it.<br> This is what we call a <strong>single point of failure</strong>.</p><p>At this point, we realize we need to organize things better — especially data.</p><p><strong>Step 2: Separating Data — Introducing Database:<em><br></em></strong>As the application grows, data handling becomes important.</p><p>So instead of keeping everything in one place, we move the database to a separate server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umv1tQlOEPAgZLh0UChzuA.png" /></figure><p>Now:</p><ul><li>One server handles application logic</li><li>Another server manages data</li></ul><p>This separation makes the system cleaner and easier to scale.</p><p>But as traffic keeps increasing, the application server starts struggling again — because it’s still doing too much work.</p><p>So, we need a smarter way to handle growth.</p><p><strong>Step 3: Scaling the Application:<em><br></em></strong>Now we have two choices:</p><p><strong><em>Vertical Scaling (Scale Up)<br></em></strong>Increase the power of the same server.</p><p>This works well initially because:</p><ul><li>No code changes required</li><li>Easy to implement</li></ul><p>But:</p><ul><li>There’s always a limit</li><li>It becomes costly</li><li>Still risky if the server fails</li></ul><p><strong><em>Horizontal Scaling (Scale Out)</em></strong></p><p>Instead of upgrading one server, we add multiple servers.</p><p>This approach:</p><ul><li>Removes dependency on a single machine</li><li>Handles more traffic easily</li><li>Improves reliability</li><li>Can serve users from different regions</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GiN-hzEh2Kq02LztGiyHkw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GiN-hzEh2Kq02LztGiyHkw.png" /></figure><p><strong>Step 4: Load Balancer </strong>— <strong>Traffic Manager:<br></strong>Instead of sending users directly to servers, all requests first go through a “<strong>load balancer”</strong>.</p><p>Think of it like a smart controller that decides where each request should go.</p><p>It can:</p><ul><li>Send requests one by one to each server</li><li>Pick the least busy server</li><li>Route the same user consistently if needed</li></ul><p>It also keeps checking server health.<br>If one server stops responding, it simply stops sending traffic there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qjbPXKik2Tp7qKdLbi-78w.png" /></figure><p>Now your system becomes:</p><ul><li>More stable</li><li>Better at handling traffic</li><li>Less likely to fail</li></ul><p>But even after fixing this, one problem still remains…</p><p><strong>Step 5: Database Replication:<br></strong>Even though we have multiple servers, we still rely on a single database.</p><p>As usage grows:</p><ul><li>Queries increase</li><li>Responses slow down</li><li>Database becomes overloaded</li></ul><p>So we improve this by creating copies of the database.</p><p>This is called <strong>replication</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4vuMKZA6u5dNVxvMYzHCoQ.png" /></figure><p>Now:</p><ul><li>One database handle writes</li><li>Multiple copies handle reads</li></ul><p>How it works:</p><ul><li>Data is written to the main database</li><li>Changes are tracked</li><li>Copies update themselves based on those changes</li><li>Read requests are shared across replicas</li></ul><p>This improves speed and reliability.</p><p>And if something fails:</p><ul><li>Another database can take over</li></ul><p><strong>Step 6: Cache — Reducing Unnecessary Work:<br></strong>Even with replication, the database is still being queried frequently.</p><p>Many users request the same data again and again.</p><p>Instead of hitting the database every time, we store frequently used data in a faster storage — cache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j245JVKMEZlW3aEXPAZH4A.png" /></figure><p>So:</p><ul><li>First request → goes to database</li><li>Next requests → served from cache</li></ul><p>This makes a huge difference:</p><ul><li>Faster responses</li><li>Less load on database</li></ul><p>But caching should be used carefully:</p><ul><li>Good for frequently accessed data</li><li>Not suitable for sensitive or constantly changing data</li><li>Needs proper expiration settings</li></ul><p><strong>Step 7: CDN — Content Delivery Network:</strong><br>Now consider users from different locations.</p><p>If all static files (images, CSS, videos) come from one server, users far away will experience delays.</p><p>To fix this, we use a <strong>CDN</strong>.</p><p>Instead of serving everything from one place, content is stored in multiple locations.</p><p>So users always get data from the nearest server.</p><p>Result:</p><ul><li>Faster loading</li><li>Better user experience</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ERE5WoEHY4dyQTLuvxbeug.png" /></figure><p><strong>Considerations of using a CDN:</strong></p><ul><li><strong>What to Serve via CDN:</strong><br> Use CDN mainly for static content like images, videos, CSS, and JavaScript files.</li><li><strong>Cache Invalidation:</strong><br> Ensure there is a way to update or remove old, cached content when changes are made.</li><li><strong>Geographical Coverage:</strong><br> Choose a CDN with wide global presence so users can access data from the nearest location.</li><li><strong>Security:</strong><br> Protect content using HTTPS, access controls, and features like DDoS protection.</li><li><strong>Cost Consideration:</strong><br> Evaluate pricing based on data transfer, number of requests, and usage to balance performance and cost.</li></ul><p><strong>Step 8: Stateful and Stateless Architecture: <br></strong>State = user’s current session data (shopping cart, preferences).<strong><br></strong>With multiple servers, another issue appears.</p><p>A user logs in:</p><ul><li>First request goes to Server 1</li><li>Next request goes to Server 2</li></ul><p>Now Server 2 doesn’t know anything about that user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jE2z_DDERjfPzmNyuDs21w.png" /></figure><p>To solve this, we stop storing session data inside servers.</p><p>Instead, we store it in a shared system like Redis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lD1Hb1SS5ug1g94PxTsUEA.png" /></figure><p>Now:</p><ul><li>Any server can handle any request</li><li>No dependency on a specific server</li><li>System becomes more flexible</li></ul><p><strong>Step 9:</strong> <strong>Visibility — Logs, Metrics, Automation<br></strong>As systems grow, understanding what’s happening becomes harder.</p><p><strong><em>Logging: Understanding What Happened</em></strong><br>Logging means recording important system activities such as requests, errors, and key events.</p><p>In a large system with many servers, logs can get scattered, making it difficult to debug issues. To solve this, logs are collected in a centralized system like Elasticsearch or CloudWatch, where you can easily search and analyze them in one place.</p><p>Good logging includes login attempts, orders, payments, errors, and slow queries. Sensitive data like passwords, credit card details, API keys, and personal information should never be logged.</p><p><strong><em>Metrics: Knowing System Health</em><br></strong>Metrics are numerical data that show how your system is performing in real time.</p><p>Host-level metrics include CPU usage, memory, disk activity, and network usage. System-level metrics track requests per second, response times, error rates, and cache performance. Business metrics focus on things like daily active users, conversions, and revenue.</p><p>Metrics help detect issues early. Instead of waiting for users to complain, alerts notify you immediately so problems can be fixed quickly.</p><p><strong><em>Automation: Scaling Without Effort</em><br></strong>As systems grow, manual processes become slow and error-prone. Automation helps manage deployments and operations efficiently.</p><p>Continuous Integration ensures every code change is automatically built and tested. Continuous Deployment releases changes smoothly, often with staged rollouts and automatic rollback if something goes wrong.</p><p>Auto-scaling automatically adds or removes servers based on traffic, ensuring performance while optimizing cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NHYKrh_eGGDQayuDPaVjoQ.png" /></figure><p>This helps us detect and fix issues quickly.</p><p><strong>Step 10: Database Scaling :</strong><br>At very large scale, even replication is not enough.<br>Increasing capacity of a single database server by adding more CPU, RAM, or storage. This is called “<strong>Vertical Scaling</strong>”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63HMDJqITwch2Aq_oaG7gg.png" /></figure><p>So, we split data across multiple databases. This is called <strong>sharding</strong>.</p><p>Data is divided using a key (like user ID), and each database stores a portion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*diChTku0ZM_nUg-LnW7xcw.png" /></figure><p>From above picture, assume a system with 10 million users distributed across 3 shards using Sharding function like shard_id = id % 3.<br>When querying for a user, the system calculates the shard ID and directly queries only that specific shard, making the process fast and efficient. For example,<br>User 123 -&gt; Shard 0 (123 % 3 = 0)<br>User 456 -&gt; Shard 0 (456 % 3 = 0)<br>User 457 -&gt; Shard 1 (457 % 3 = 1)<br>This way, the data is evenly distributed, with each shard holding around 3.3 million users.<br>This helps:</p><ul><li>Distribute load</li><li>Improve performance</li><li>Handle massive data</li></ul><p>But it also brings challenges like:</p><ul><li>Managing data distribution</li><li>Handling uneven traffic</li><li>Avoiding complex joins</li></ul><p><strong>Conclusion:</strong></p><p>Scaling a system is an iterative process.</p><p>Each step in scaling solves a specific problem, from handling traffic to managing data efficiently. As the system grows, choosing the right solution at the right time becomes important. Understanding these concepts helps in building systems that perform well in real-world scenarios.</p><p><strong>My Takeaways:</strong></p><ul><li>Start simple</li><li>Separate responsibilities early</li><li>Scale when needed, not before</li><li>Distribute traffic using load balancer</li><li>Use cache to speed things up</li><li>Use CDN for faster content delivery</li><li>Keep systems stateless</li><li>Use sharding for large-scale data</li></ul><p><strong>“Thank you for spending your valuable time to read this article. I hope it added value to your learning. Happy Learning!”</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d8b8e8595f9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>