<?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"><channel><title><![CDATA[⚖ Load Balancing vs  ⚙  Failover]]></title><description><![CDATA[<h2>:scales: Load Balancing <strong>vs</strong>  :hourglass:  Failover</h2>
<hr />
<p dir="auto">Apart from Application Development, To become a  <code>DevOps Engineer</code> or <code>System Admin</code> you need to learn some production level <code>deployment</code> and <code>maintenance</code>  technique to design better <code>server architecture</code> to provide <code>high available service</code>.</p>
<p dir="auto">In this small blog,  We will see about 2 important things,</p>
<ol>
<li>Load Balancing</li>
<li>Failover</li>
</ol>
<p dir="auto">Both are <code>server setup techniques</code> to provide <code>High Available</code> or <code>Zero Downtime</code> services.</p>
<p dir="auto">Let's See one by one.</p>
<hr />
<p dir="auto"><strong>The problem</strong></p>
<p dir="auto">When you deploy our application. The server will serve the service to our clients.<br />
The client will send a <code>request</code> to server, Then our server will <code>response</code> to client.</p>
<p dir="auto">When so many clients use our service / app, They will send <code>millions of requests per second</code>. Everything has a limited capacity. We can do limited tasks using our two hands.</p>
<p dir="auto"><strong>Like that</strong> Server will handle <code>only limited requests</code> per second <em>(around 1000 req/ sec But it depends on the internal architecture)</em>.</p>
<p dir="auto">In above case, When server meet the maximum limit, It will get trouble to process the requests. So the <code>server will stop service / hang automatically</code>. This is what we called <code>Server Down</code>. In this case, Client's will not access our service / application / website which is hosted in that perticlular server.</p>
<p dir="auto"><strong>To avoid this problem,</strong> some server softwares automatically decline the clients' requests when reach limit. <strong>But</strong> this will create a <code>bad opinion</code> :angry: :angry:  on our <code>users'</code> or <code>clients'</code> mind about our service. They will be disappointed when they couln't access our service.</p>
<p dir="auto">Here we need to implement <code>Load Balancing</code> or <code>Failover</code>.</p>
<hr />
<p dir="auto"><strong>The Load Balancing</strong></p>
<p dir="auto">The name will give you a idea. Just think balance the load.</p>
<p dir="auto">Load Balancing means <code>divide</code> and <code>distribute</code> the <code>traffic (requests)</code> between more than one servers.</p>
<p dir="auto"><strong>For example</strong><br />
You  have 3 servers, Each server will handle 1000 requests per second.</p>
<p dir="auto">When you receive 2500 requests per second, The load balancer will divide the requests and serve to 3 servers something like,</p>
<blockquote>
<p dir="auto"><strong>Server 1 - 900 Req / S<br />
Server 2 - 900 Req / S<br />
Server 3 - 700 Req / S</strong></p>
</blockquote>
<p dir="auto">Here your servers will work together without getting stucked.</p>
<p dir="auto"><img src="https://avinetworks.com/wp-content/uploads/2018/07/application-delivery-load-balancing-diagram-simple.jpg" alt="Load Balancing" class=" img-responsive img-markdown" /></p>
<hr />
<p dir="auto">There are <code>2 types</code> of <code>load balancers</code>.</p>
<ol>
<li>Physical Load Balancer</li>
<li>Logical Load Balancer</li>
</ol>
<hr />
<p dir="auto"><strong>Physical load Balancer</strong></p>
<p dir="auto">This is a device looks like a <code>network switch</code> .</p>
<p dir="auto"><img src="http://www.loadbalancer.org/blog/content/images/2018/12/Load_balancer_Enterprise_R20.png" alt="Physical load Balancer" class=" img-responsive img-markdown" /></p>
<p dir="auto">Connected with servers to balance incomming traffic.</p>
<p dir="auto"><img src="https://blog.rackspace.com/wp-content/uploads/2016/07/LBaas1.png" alt="Physical Load Balancer" class=" img-responsive img-markdown" /></p>
<hr />
<p dir="auto"><strong>Logical Load Balancer</strong></p>
<p dir="auto">Thit will run as a service inside the <code>main server</code> or  <code>proxy</code>. It will receive all <code>requests</code> then transfer to other services in <code>same server</code> or <code>subservers</code>.</p>
<p dir="auto">Something like this,</p>
<blockquote>
<p dir="auto">Main Server - <a href="http://yourapp.com" target="_blank" rel="noopener noreferrer nofollow ugc">yourapp.com</a></p>
</blockquote>
<p dir="auto">The main server will get request, Then will forward &amp; balance between below services.</p>
<blockquote>
<p dir="auto">App1 - localhost:80<br />
App2 - localhost:8080<br />
App3 - localhost:8000<br />
App4 - localhost:8001</p>
</blockquote>
<p dir="auto">The <code>Nginx</code> is a famous <code>web server</code> with built-in <code>reverse proxy</code> &amp; <code>load balancer</code></p>
<p dir="auto">Sample Load Balancer Configuration of Nginx.</p>
<pre><code>http {
    upstream myapp1 {
        server srv1.example.com;
        server srv2.example.com;
        server srv3.example.com;
    }

    server {
        listen 80;

        location / {
            proxy_pass http://myapp1;
        }
    }
}
</code></pre>
<p dir="auto"><a href="http://nginx.org/en/docs/http/load_balancing.html" target="_blank" rel="noopener noreferrer nofollow ugc">Click Here</a> to Read More About nginx Load Balancing.</p>
<hr />
<h3><strong>Failover</strong></h3>
<p dir="auto"><code>Failover</code> is little different from <code>load balancing</code>. Here we are <strong>not</strong> going to balance the load.</p>
<p dir="auto">Here also we need more than 1 server. But we will fireup other server instead of one, When that server went down.</p>
<p dir="auto"><strong>Confusing? For Example</strong></p>
<p dir="auto">We have following  2 servers.</p>
<blockquote>
<p dir="auto"><strong>Server 1 :</strong> 192.168.8.100</p>
</blockquote>
<blockquote>
<p dir="auto"><strong>Server 2 :</strong> 192.168.8.103</p>
</blockquote>
<p dir="auto">Here, We don't use both servers at the same time. We will start the second server, When the first server went down.</p>
<p dir="auto">When our first server <code>stop working</code>, The <code>failover</code> machanism <code>automatically turn-on</code> server 2.</p>
<hr />
<p dir="auto">These are the main concepts of <code>Load Balancing</code> and <code>Failover</code>. Hope now you have learn new thing.</p>
<p dir="auto">Just put a comment, If you want to write about anything else. <strong>Or</strong> if you have any questions.</p>
<p dir="auto">Thank you!</p>
<p dir="auto"><strong>With :hearts:  B6.</strong></p>
]]></description><link>https://lankadevelopers.lk/topic/105/load-balancing-vs-failover</link><generator>RSS for Node</generator><lastBuildDate>Wed, 10 Jun 2026 00:08:13 GMT</lastBuildDate><atom:link href="https://lankadevelopers.lk/topic/105.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 15 Jan 2019 18:08:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Mon, 18 May 2026 07:00:38 GMT]]></title><description><![CDATA[<p dir="auto">Read Antarvasna Hindi Me stories for bold, desi entertainment written in pure Hindi. Enjoy realistic romance, emotions, and thrill 👉 <a href="https://www.cupidbaba.com/antarvasna/" target="_blank" rel="noopener noreferrer nofollow ugc">antarvasna hindi me</a>.</p>
]]></description><link>https://lankadevelopers.lk/post/8342</link><guid isPermaLink="true">https://lankadevelopers.lk/post/8342</guid><dc:creator><![CDATA[Ruchi Harpreet Roy]]></dc:creator><pubDate>Mon, 18 May 2026 07:00:38 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Fri, 26 Jul 2019 16:29:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/4">@dinlinux</a> Thank you!</p>
]]></description><link>https://lankadevelopers.lk/post/1986</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1986</guid><dc:creator><![CDATA[b6]]></dc:creator><pubDate>Fri, 26 Jul 2019 16:29:44 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Fri, 26 Jul 2019 16:32:30 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/1117">@Piumal-Kavinda</a> <strong>Yes, You can apply</strong>.  The <strong>logical load-balances</strong> handles the virtual instances. And physical machanism used to manage the parent instance.</p>
<p dir="auto">And nowadays no one using <strong>Virtual Architecture</strong> with <strong>Virtual Machines</strong> because of performance and scalability. Use <strong>containers</strong> instead of <strong>VMs</strong>.</p>
<p dir="auto"><strong>Docker &amp; Kubernate are rocking today's architecture,</strong></p>
]]></description><link>https://lankadevelopers.lk/post/1985</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1985</guid><dc:creator><![CDATA[b6]]></dc:creator><pubDate>Fri, 26 Jul 2019 16:32:30 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Mon, 22 Jul 2019 20:29:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/1117">@Piumal-Kavinda</a></p>
<p dir="auto">ahh ok, this can work with virtual architectures. no problem bro</p>
]]></description><link>https://lankadevelopers.lk/post/1959</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1959</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Mon, 22 Jul 2019 20:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Fri, 19 Jul 2019 16:16:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a> Not exactly , nowdays most companies using virtual servers by   hyper v and Vmware  so load balancing and fail over technologies must be support that platforms .</p>
<p dir="auto">.<img src="https://www.iphouse.com/wp-content/uploads/2012/04/traditional_vs_virtual.jpg" alt="alt text" class=" img-responsive img-markdown" /></p>
]]></description><link>https://lankadevelopers.lk/post/1945</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1945</guid><dc:creator><![CDATA[Piumal Kavinda]]></dc:creator><pubDate>Fri, 19 Jul 2019 16:16:16 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Fri, 19 Jul 2019 11:53:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/1117">@Piumal-Kavinda</a> you mean VPS ?</p>
]]></description><link>https://lankadevelopers.lk/post/1942</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1942</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Fri, 19 Jul 2019 11:53:42 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Fri, 19 Jul 2019 06:04:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/625">@b6</a> I have a question , can this two methods apply for virtualised servers ?</p>
]]></description><link>https://lankadevelopers.lk/post/1939</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1939</guid><dc:creator><![CDATA[Piumal Kavinda]]></dc:creator><pubDate>Fri, 19 Jul 2019 06:04:02 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Wed, 17 Jul 2019 09:59:14 GMT]]></title><description><![CDATA[<p dir="auto">Great post. Simple and accurate..</p>
]]></description><link>https://lankadevelopers.lk/post/1917</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1917</guid><dc:creator><![CDATA[dinlinux]]></dc:creator><pubDate>Wed, 17 Jul 2019 09:59:14 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Wed, 17 Jul 2019 07:34:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/1117">@Piumal-Kavinda</a> thank you</p>
]]></description><link>https://lankadevelopers.lk/post/1913</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1913</guid><dc:creator><![CDATA[b6]]></dc:creator><pubDate>Wed, 17 Jul 2019 07:34:03 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Wed, 17 Jul 2019 07:27:24 GMT]]></title><description><![CDATA[<p dir="auto">Good explanation</p>
]]></description><link>https://lankadevelopers.lk/post/1912</link><guid isPermaLink="true">https://lankadevelopers.lk/post/1912</guid><dc:creator><![CDATA[Piumal Kavinda]]></dc:creator><pubDate>Wed, 17 Jul 2019 07:27:24 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Tue, 22 Jan 2019 08:45:20 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/664">@Chirantha-Jananath</a> Thx Bro</p>
]]></description><link>https://lankadevelopers.lk/post/754</link><guid isPermaLink="true">https://lankadevelopers.lk/post/754</guid><dc:creator><![CDATA[b6]]></dc:creator><pubDate>Tue, 22 Jan 2019 08:45:20 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Mon, 21 Jan 2019 11:04:37 GMT]]></title><description><![CDATA[<p dir="auto">Good article.</p>
]]></description><link>https://lankadevelopers.lk/post/749</link><guid isPermaLink="true">https://lankadevelopers.lk/post/749</guid><dc:creator><![CDATA[Chirantha Jananath]]></dc:creator><pubDate>Mon, 21 Jan 2019 11:04:37 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Mon, 21 Jan 2019 05:07:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://lankadevelopers.lk/uid/27">@root</a> Thank you bro :)</p>
]]></description><link>https://lankadevelopers.lk/post/744</link><guid isPermaLink="true">https://lankadevelopers.lk/post/744</guid><dc:creator><![CDATA[b6]]></dc:creator><pubDate>Mon, 21 Jan 2019 05:07:13 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Wed, 16 Jan 2019 17:25:26 GMT]]></title><description><![CDATA[<p dir="auto">Good work bro. keep posting. this is very clean articles, Thanks</p>
]]></description><link>https://lankadevelopers.lk/post/713</link><guid isPermaLink="true">https://lankadevelopers.lk/post/713</guid><dc:creator><![CDATA[root]]></dc:creator><pubDate>Wed, 16 Jan 2019 17:25:26 GMT</pubDate></item><item><title><![CDATA[Reply to ⚖ Load Balancing vs  ⚙  Failover on Wed, 16 Jan 2019 03:05:10 GMT]]></title><description><![CDATA[<p dir="auto">Thanks bro</p>
]]></description><link>https://lankadevelopers.lk/post/702</link><guid isPermaLink="true">https://lankadevelopers.lk/post/702</guid><dc:creator><![CDATA[dev_lak]]></dc:creator><pubDate>Wed, 16 Jan 2019 03:05:10 GMT</pubDate></item></channel></rss>