<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Uzair</title>
    <description>The latest articles on DEV Community by Uzair (@uzaxirr).</description>
    <link>https://dev.to/uzaxirr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F615787%2F3f4b7c10-4707-4b39-b5d4-9e47199d8467.png</url>
      <title>DEV Community: Uzair</title>
      <link>https://dev.to/uzaxirr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/uzaxirr"/>
    <language>en</language>
    <item>
      <title>Tool to Cross-Post Your Blogs in One Click</title>
      <dc:creator>Uzair</dc:creator>
      <pubDate>Fri, 10 Dec 2021 17:42:46 +0000</pubDate>
      <link>https://dev.to/uzaxirr/tool-to-cross-post-your-blogs-in-one-click-3n04</link>
      <guid>https://dev.to/uzaxirr/tool-to-cross-post-your-blogs-in-one-click-3n04</guid>
      <description>&lt;p&gt;Hey There 👋&lt;br&gt;
I made a SaaS tool that will cross-post your blogs between &lt;a href="https://dev.to/"&gt;dev.to&lt;/a&gt; , &lt;a href="https://medium.com/" rel="noopener noreferrer"&gt;Medium&lt;/a&gt; and &lt;a href="https://hashnode.com/" rel="noopener noreferrer"&gt;Hashnode&lt;/a&gt; in just a single click 🖱️&lt;/p&gt;

&lt;p&gt;Go Check ot out 🚀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://integrateme.co/crosspost" rel="noopener noreferrer"&gt;https://integrateme.co/crosspost&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It can cross-post from 🔀&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;dev.to -&amp;gt; Medium and Hashnode&lt;/li&gt;
&lt;li&gt;Medium -&amp;gt; dev.to and Hashnode&lt;/li&gt;
&lt;li&gt;Hashnode -&amp;gt; dev.to and Medium &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just bless us with your API keys and we handle the rest 🔑&lt;/p&gt;

&lt;p&gt;Below is a demonstration of cross-posting from dev to medium and hashnode 👨🏽‍💻&lt;/p&gt;

&lt;p&gt;We are on product hunt too show some love by upvoting ❤️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.producthunt.com/posts/intgrateme" rel="noopener noreferrer"&gt;https://www.producthunt.com/posts/intgrateme&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs74mob93cth9pvpy8bv6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs74mob93cth9pvpy8bv6.png" alt="demo"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And this post is also cross-posted from dev to Medium and hashnode using this tool 😀 Here's the link&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hashnode.com/post/tool-to-cross-post-your-blogs-in-one-click-ckx0s3sef03xtzvs12vn9bzg3" rel="noopener noreferrer"&gt;https://hashnode.com/post/tool-to-cross-post-your-blogs-in-one-click-ckx0s3sef03xtzvs12vn9bzg3&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@uzair-ali10/tool-to-cross-post-your-blogs-in-one-click-9c7fca832043" rel="noopener noreferrer"&gt;https://medium.com/@uzair-ali10/tool-to-cross-post-your-blogs-in-one-click-9c7fca832043&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And YESSSS, We love Open-Source as much as you do. Thus, we are completely open-source  &lt;/p&gt;

&lt;p&gt;Backend: &lt;a href="https://github.com/integrateme-co/integrate-io" rel="noopener noreferrer"&gt;https://github.com/integrateme-co/integrate-io&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frontend: &lt;a href="https://github.com/integrateme-co/frontend" rel="noopener noreferrer"&gt;https://github.com/integrateme-co/frontend&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We have Quite a lot of open issues and contributions are most welcome 😀&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>tooling</category>
      <category>showdev</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Caching - 101</title>
      <dc:creator>Uzair</dc:creator>
      <pubDate>Wed, 03 Nov 2021 19:02:36 +0000</pubDate>
      <link>https://dev.to/uzaxirr/caching-101-3agp</link>
      <guid>https://dev.to/uzaxirr/caching-101-3agp</guid>
      <description>&lt;p&gt;&lt;a href="https://dev.to/uzairali10/load-balancer-101-4jl9"&gt;Load Balancing&lt;/a&gt; helps you to scale horizontally by increasing resources (increasing number of servers) while caching enables you to make better use the existing resource you have.&lt;/p&gt;

&lt;p&gt;Caching works on the principle that recently requested data is likely to be requested again&lt;/p&gt;

&lt;p&gt;Cache is a hardware or a software component which helps in serving the data which is either frequently requested or is resource expensive to compute, So cache stores the response and serves it when asked to do so.&lt;/p&gt;

&lt;p&gt;Caches can exist at all levels in architecture, but are often found at the level nearest to the client where they are implemented to return data quickly without taxing downstream levels.&lt;/p&gt;

&lt;p&gt;For example: &lt;/p&gt;

&lt;p&gt;A client requests image from a server, Initially the server looks through DB for the image and return it to client but however there are the following possibilities&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The response can be cached in server side (Eg: in reverse proxy)&lt;/li&gt;
&lt;li&gt;The response can be cached client side (Eg: Browser cache, Forward proxy)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This way we are saving the copy of response and client do not have to request the server frequently for the same data, This even decrease the time to load data for client and even decreases load for the server.&lt;/p&gt;

&lt;p&gt;If the response for a particular request is saved in cache it is called &lt;code&gt;cache hit&lt;/code&gt; or else it is called &lt;code&gt;cache miss&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Pros:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Improves read Performance (aka Latency)&lt;/li&gt;
&lt;li&gt;Reduce the Load (aka Throughput)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Cons:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Increase complexity of System&lt;/li&gt;
&lt;li&gt;Consumes Resources&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cache Invalidation &amp;amp; Eviction
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Cache Invalidation:
&lt;/h2&gt;

&lt;p&gt;Updating the cached data is known as cache invalidation. The most common technique used for this purpose is known as TTL (Time To live). A certain time period is defined for cache to live in the memory and after that interval of time cache expires. And new data is requested from server&lt;/p&gt;

&lt;h2&gt;
  
  
  Cache Eviction:
&lt;/h2&gt;

&lt;p&gt;As cache memory is limited so we have to decide which cached data to keep or not.&lt;/p&gt;

&lt;p&gt;Eg: our storage is capable of only storing only 100 keys and currently all of them are filled and now we want to add an additional key so we have to kick out an older cached key so that room for a new one can be made. This process is know as cache Eviction.&lt;/p&gt;

&lt;p&gt;Below are some parameters considered while Eviction of a cached key:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;FIFO: First In First Out, In this the oldest cached key gets removed so that latest one can be occupied.&lt;/li&gt;
&lt;li&gt;LRU: Least Recently Used, In this the cached key which hasn't been used in recent time and was used a long time ago gets discarded.&lt;/li&gt;
&lt;li&gt;LFU: Least Frequently Used, In this the cached is used the most less number of times is discarded. Eg: there are 3 keys k1, k2, k3 and they are used 7,3,9 times respectively so k3 will be discarded first as it is used only 3 times which is the least number.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Cache Patterns
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cache Aside pattern:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzt6k16ihp7hd95qognzs.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzt6k16ihp7hd95qognzs.jpg" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This is the most commonly used technique in this the cache does not interact with DB or Server it only interacts with Application.&lt;/p&gt;

&lt;p&gt;When a client request some data through application, Application looks for it in cache if found then returns it or else request the same to server and then returns to client and also caches it.&lt;/p&gt;

&lt;p&gt;Here there was no interaction between cache and server or DB &lt;/p&gt;

&lt;p&gt;When the data in DB changes corresponding data in cached memory also have to be modified either through some code by application or through TTL method or combination of both can be used&lt;/p&gt;

&lt;p&gt;Pros of cache aside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caches only what is needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons of cache Aside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cache Miss are Expensive&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Read Through pattern:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hatvrac2wge2kbfan7g.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7hatvrac2wge2kbfan7g.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here the cache resides between application and server, in this case application never interacts with server or cache.&lt;/p&gt;

&lt;p&gt;When a client request some data it is first looked by the application in cache and if not found the cache itself request data to server and returns to the application.&lt;/p&gt;

&lt;p&gt;Pros of cache aside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Caches only what is needed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons of cache Aside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cache Miss are Expensive&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Write Through pattern:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmi79b0ruuicotj38pqnk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmi79b0ruuicotj38pqnk.jpg" alt="Image description"&gt;&lt;/a&gt;     &lt;/p&gt;

&lt;p&gt;The write-through strategy adds data or updates data in the cache whenever data is written to the database. Because the data in the cache is updated every time it's written to the database, the data in the cache is always current.&lt;/p&gt;

&lt;p&gt;Pros of Write Through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Up to Date Data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons of cache Aside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Writes are Expensive are Expensive&lt;/li&gt;
&lt;li&gt;There is a chance that we may add certain data to cache that no one ever reads&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Write Behind pattern:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr6hujk16stfe9ykl0mg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frr6hujk16stfe9ykl0mg.jpg" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is similar to write through and just instead of updating cache instantaneously it waits for some time and sends requests in bulk&lt;/p&gt;

&lt;p&gt;Pros of Write Through:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No Write penalty&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cons of cache Aside:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Reliability&lt;/li&gt;
&lt;li&gt;Lack of consistency&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Where Do Cache Resides
&lt;/h2&gt;

&lt;p&gt;Depending on the pattern used for caching and some other parameters cache can be embedded at various levels such as.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Client Side (Like Browser cache or OS Cache)&lt;/li&gt;
&lt;li&gt;Forward proxy&lt;/li&gt;
&lt;li&gt;Reverse proxy&lt;/li&gt;
&lt;li&gt;Application layer itself&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>systems</category>
      <category>performance</category>
      <category>redis</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Client and Server Side Architecture</title>
      <dc:creator>Uzair</dc:creator>
      <pubDate>Tue, 28 Sep 2021 06:04:00 +0000</pubDate>
      <link>https://dev.to/uzaxirr/client-and-server-side-architecture-4i67</link>
      <guid>https://dev.to/uzaxirr/client-and-server-side-architecture-4i67</guid>
      <description>&lt;h2&gt;
  
  
  Who's a Client 🧐
&lt;/h2&gt;

&lt;p&gt;In backend client generally refer to the device through which user is accessing the internet. It could be Laptop, Mobile, Desktop, tablet etc etc. Client contains frontend and the User Interface (UI/UX) 💻&lt;/p&gt;

&lt;p&gt;In other words client is a means or door through which a user can interact with backend. A lot of new fancy open source technologies like ReactJs, Angular, HTML, CSS etc etc are used on client side.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's a Server ❓
&lt;/h2&gt;

&lt;p&gt;Ever service running online needs some kind of computational power to run on and this is provided by server. Server is the place where core logic of our application is executed. You can think it of a computer placed on cloud ☁️&lt;/p&gt;

&lt;p&gt;The primary task of a server is to execute the logic based upon the demand by the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Client Side Architecture ↔️
&lt;/h2&gt;

&lt;p&gt;All the Client, Server architecture are based upon request, response model. &lt;/p&gt;

&lt;p&gt;Client sends a request and server responds with a response. 🔭&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q8dx98gyz305rrat9ye.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1q8dx98gyz305rrat9ye.jpg" alt="Untitled_Diagram_(2)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above conversation between client and server happens mostly over &lt;strong&gt;HTTP protocol&lt;/strong&gt; which was covered in &lt;a href="https://dev.to/uzairali10/hyper-text-transfer-protocol-http-101-4jp4"&gt;previous blog post&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And speaking from point of view of an modern, advance client server architecture client Sends an request to server mostly through &lt;strong&gt;REST-API&lt;/strong&gt; which was discussed in &lt;a href="https://dev.to/uzairali10/rest-apis-and-architecture-101-236f"&gt;previous blog post&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Client ⚙️
&lt;/h2&gt;

&lt;p&gt;Logical manipulation has to be done on data before returning to client then. The logic may reside on server side and sometimes on client side (depending Upon the service). On this basis Client are classified into two types 🗂️&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Thin Client&lt;/li&gt;
&lt;li&gt;Thick Client&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Thin Client&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When Logic that has to be performed on data reside on Server Side then it is classified as Thin Client. It depends on Cloud platform for its features.&lt;/p&gt;

&lt;p&gt;Eg: Netflix&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Thick Client&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When The logic that has to be performed on data resides on server side then it is known as Thick Client. It's function can also run offline. and runs at least some features locally on your device. &lt;/p&gt;

&lt;p&gt;Eg: Google Docs  (It perform calculations and computational related stuff using local resources but data is stored in database).&lt;/p&gt;

&lt;h2&gt;
  
  
  Different Tire Architecture (Tier 1, Tier 2, Tier 3)
&lt;/h2&gt;

&lt;p&gt;Now What's a Tier, Tier refers to logical separation between different components of an application or service.&lt;/p&gt;

&lt;p&gt;By Components I refers to&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Databse&lt;/li&gt;
&lt;li&gt;Client or User Interface&lt;/li&gt;
&lt;li&gt;Caching&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/uzairali10/load-balancer-101-4jl9"&gt;Load Balancer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Servers&lt;/li&gt;
&lt;li&gt;etc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are Mainly three Tire of Cleint - Server architectures&lt;/p&gt;

&lt;h2&gt;
  
  
  Tier 1 Architecture
&lt;/h2&gt;

&lt;p&gt;This is the most simplest of all the database, server and client all reside at a same machine. 💻&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl11qyjqrz1watvbidorm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl11qyjqrz1watvbidorm.jpg" alt="Untitled_Diagram_(2) 1"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These could be installed and run on a single machine without any external resources.&lt;/p&gt;

&lt;p&gt;Eg: when we install an SQL database to practice SQL quires.&lt;/p&gt;

&lt;h3&gt;
  
  
  Advantages ✔️
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;No network latency because every component is located on the same machine 🗄️&lt;/li&gt;
&lt;li&gt;Highly secure and private as user's data does not leave his/her machine 🔐&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Dis-Advantages 🚫
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Developer have no control over the software once it is shipped as it is totally disconnected from the outer world, we cannot ship updates and big-fixes anymore, The only way of doing this is by installing a newly release version of the same 🐞&lt;/li&gt;
&lt;li&gt;Such software can be easily twerked or reverse engineered ⏪&lt;/li&gt;
&lt;li&gt;Performance of Server and Database is directly proportional to the configuration of user's machine. Because the server and Database resides in user's machine itself. 🖥️&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tier 2 Architecture
&lt;/h2&gt;

&lt;p&gt;In this architecture the presentation layer or the frontend as we say runs on client side while Backend Server resides at an external resource. Here database is also included in the server (Means there is no external dedicated DB) 🐳&lt;/p&gt;

&lt;p&gt;In two-tier, the application logic is either buried inside the user interface on the client or within the database on the server (or both). &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdgwhu7rwnhtctygwxys6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdgwhu7rwnhtctygwxys6.jpg" alt="Untitled_Diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It has better security and scalability scope as compared to Tier 1. Here logic can reside either on client side or side depending on service. &lt;/p&gt;

&lt;p&gt;We can either keep the user interface and the business logic on the client or move the business logic to a dedicated backend server, which would make it a three-tier application. We will discuss it next.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tier 3 Architecture
&lt;/h2&gt;

&lt;p&gt;A three tier architecture is most scalable among the all three. It has three layers&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Presentation Layer (PC, Tablet, Laptop or any sort of UI Screen)&lt;/li&gt;
&lt;li&gt;Application layer (server)&lt;/li&gt;
&lt;li&gt;A dedicated Database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;User Interface, Server and DB all three resides on different machines and thus are physically separated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv59gzcmx726q7pxl0pl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftv59gzcmx726q7pxl0pl.jpg" alt="Tier-3"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Here Logic resides at server side and data is stored at database. This architecture can integrate data from different resources &lt;/p&gt;

&lt;p&gt;Let's take a simple blog website for example User Interface or frontend as we say is written in HTML and CSS, Server is Built up in NodeJS and Express or Django or any other backend framework and DB could be MongoDB or SQL etc, etc&lt;br&gt;
This is a typical example of 3 Tire architecture.&lt;/p&gt;

&lt;h2&gt;
  
  
  N- Tier Architecture
&lt;/h2&gt;

&lt;p&gt;In some cases even Tier 3 architecture isn't sufficient to handle traffic so load balancer, caching layer, etc are introduced on top of our tradational server and DB&lt;/p&gt;

&lt;p&gt;Let's Look what these components are&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cache&lt;/li&gt;
&lt;li&gt;Message queues for asynchronous behavior&lt;/li&gt;
&lt;li&gt;Load balancers&lt;/li&gt;
&lt;li&gt;Search servers for searching through massive amounts of data&lt;/li&gt;
&lt;li&gt;Components involved in processing massive amounts of data&lt;/li&gt;
&lt;li&gt;Components running heterogeneous tech commonly known as web services such as machine learning models, or some security services etc etc&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All the above represented components are very complex and requires a separate post on each&lt;/p&gt;

&lt;p&gt;All big software services like Facebook, Amazon, Apple Services, Netflix, Google Services , Instagram, Uber, Airbnb etc etc have a N-Tier Architecture.&lt;/p&gt;

&lt;p&gt;N-Tier Architecture is also known as distributed service or distributed applications.&lt;br&gt;
Below is a very rough representation of N Tier Architecture, We'll make more concise and detailed as we proceed&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr67xwc4tvixmb1bkqem5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr67xwc4tvixmb1bkqem5.jpg" alt="N-Tier"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Do Drop a Like and Share This if you find it useful&lt;/strong&gt; 💜&lt;/p&gt;

</description>
      <category>systems</category>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Load Balancer - 101</title>
      <dc:creator>Uzair</dc:creator>
      <pubDate>Sun, 19 Sep 2021 06:57:49 +0000</pubDate>
      <link>https://dev.to/uzaxirr/load-balancer-101-4jl9</link>
      <guid>https://dev.to/uzaxirr/load-balancer-101-4jl9</guid>
      <description>&lt;h2&gt;
  
  
  Okay, Now What's a Load-Balancer?? 🙄
&lt;/h2&gt;

&lt;p&gt;As the name suggest it has something to do with balancing the load, but here in backend system design architecture load generally refers to traffic or amount of incoming requests 📶&lt;/p&gt;

&lt;p&gt;So yeah, going by the name it manages traffic to servers so that they may not get overloaded by traffic ⚖️&lt;/p&gt;

&lt;p&gt;Imagine Facebook or Instagram, such a huge giant they are aren't they now let us assume all of their traffic and backend process is handled by a single server, not even a super computer can do such wonders 😂&lt;br&gt;
So definitely they must have multiple server spread across the globe 🌍 now how to decide which request goes to which server 🤨 And how to make sure that a particular server is not stormed by lot of requests, while other servers sits idle &lt;em&gt;and&lt;/em&gt; &lt;em&gt;smile at each other&lt;/em&gt; 😆&lt;/p&gt;

&lt;p&gt;This is the time when load balancer comes for rescue🦸&lt;br&gt;
It does the job of deciding which request goes to which server, and thus solving the above mentioned problems ✔️&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's see this in detail 🕵️
&lt;/h3&gt;

&lt;p&gt;When we talk about a server its not a single server, actually there are lot of server sitting behind  load balancer, Load Balancer is a device (hardware) or may be a software (ex: Ngnix) &lt;br&gt;
But when software is avalible then who will spend money on hardware 💰&lt;br&gt;
So a software load balancer is widely used 🎢&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpye4w9jghr79dwqx59n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flpye4w9jghr79dwqx59n.png" alt="Untitled_Diagram.drawio"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above image servers could be web server or application server, and server may further communicate with database etc etc&lt;/p&gt;

&lt;p&gt;A load balancer acts as a traffic cop 👮 sitting in front of servers and routing clients across all servers with equal load 📶 This ensures that no single server have too much load which can lead to degradation of service or degradation of server's health 👨‍⚕️&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A load balancer divides load uniformly across all servers, in the above scenario every server would receive 25% of the load as there are 4 servers. ♾️&lt;/li&gt;
&lt;li&gt;When client resolves URL into an IP address through DNS Lookup it basically gives the Load Balancer's IP not server's IP.&lt;/li&gt;
&lt;li&gt;Requests are measured in QPS (Query per second)&lt;/li&gt;
&lt;li&gt;This Adds extra security 🔐 as servers are not publicly exposed and remains in a private network. If a client tries to directly access servers it cant do so without going through load balancer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Load balancing Algorithms 🍖
&lt;/h2&gt;

&lt;p&gt;The algorithm in a particular load balancer decide which server will be receiving the next incoming request &lt;/p&gt;

&lt;p&gt;The Algorithms are as follow 👇&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Round Robin&lt;/li&gt;
&lt;li&gt;weighted Round Robin&lt;/li&gt;
&lt;li&gt;Least Connections&lt;/li&gt;
&lt;li&gt;Least Response Time&lt;/li&gt;
&lt;li&gt;IP Hash&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Lets take a look at all of them in detail 🕵️‍♂️&lt;/p&gt;

&lt;h3&gt;
  
  
  Round Robin ⭕
&lt;/h3&gt;

&lt;p&gt;Requests are sequentially sent to 1st, 2nd 3rd,.... till last server and then next request is sent back to the first server and this process is continues in a circular manner 🔁&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F497b90zfm57wc1qp36i8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F497b90zfm57wc1qp36i8.png" alt="Server_Farm"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above case requests will be sent in this manner:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;S1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;S2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;S3&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;S4&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;S1&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;S2&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;S3&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And So on...&lt;/p&gt;

&lt;h3&gt;
  
  
  Weighted Round Robin 🏋️
&lt;/h3&gt;

&lt;p&gt;One Drawback in Round Robin is that it assume that all the servers have same computational power and there's no way we can assign more requests to the one with more power and less request to the one with less power. 🚦&lt;/p&gt;

&lt;p&gt;To counter this we assign weights to each server and based on that weight requests are redirected  💪&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ibq513dt28djaa16f54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8ibq513dt28djaa16f54.png" alt="Server_Farm.drawio_(3)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Least Connections Algo ↔️
&lt;/h3&gt;

&lt;p&gt;Request are sent to server with least number of open connections ⚖️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5nmr844dss2t6ocec1q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5nmr844dss2t6ocec1q.png" alt="Server_Farm.drawio_(4)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the above representation at this particular instance &lt;code&gt;S3&lt;/code&gt; has the least number of connections so the next incoming request will be received by server &lt;code&gt;S3&lt;/code&gt; according to Least Connection Algo&lt;/p&gt;

&lt;h3&gt;
  
  
  Least Response Time Algo 🔭
&lt;/h3&gt;

&lt;p&gt;Request are sent to the server with fewest active connection and lowest average response time ↔️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Forpa8txiqun7flry0oqf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Forpa8txiqun7flry0oqf.png" alt="Server_Farm.drawio_(11)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here the avg response time is calculated by multiplying number of connections and response time&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ba2lagw0bjvuli8w9oz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ba2lagw0bjvuli8w9oz.png" alt="Server_Farm.drawio_(12)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxixww96yms7ew2zrrco.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqxixww96yms7ew2zrrco.png" alt="Server_Farm.drawio_(13)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the first case &lt;code&gt;S2&lt;/code&gt; and &lt;code&gt;S3&lt;/code&gt; both have same avg response time so in that case either of &lt;code&gt;S2&lt;/code&gt; or &lt;code&gt;S3&lt;/code&gt; will receive the request.&lt;/p&gt;

&lt;p&gt;But in case 2 &lt;code&gt;S3&lt;/code&gt; has the least avg response time hence it will receive the  request&lt;/p&gt;

&lt;h3&gt;
  
  
  IP Hashing Algo #️⃣
&lt;/h3&gt;

&lt;p&gt;Here IP of the client is used to determine the server to which request has to be redirected 🥢&lt;/p&gt;

&lt;p&gt;An high level explanation would be:&lt;/p&gt;

&lt;p&gt;Some logic is written in a function and an IP address is passed to that function, based on that logic which resides inside the function it return the server to which request has to be redirected for that particular IP address 👩🏻‍🔧&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhwwl3a0nmznx5z9fryz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbhwwl3a0nmznx5z9fryz.png" alt="Server_Farm.drawio_(15)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvy377qyz5mt2hxgovrh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvy377qyz5mt2hxgovrh.png" alt="Server_Farm.drawio_(19)"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Placement of Load Balancers 🛤️
&lt;/h2&gt;

&lt;p&gt;Based on certain criteria Load balancer can be placed at &lt;strong&gt;Layer 4&lt;/strong&gt; or &lt;strong&gt;Layer 7&lt;/strong&gt; in the OSI Model of a product 🧘‍♂️&lt;/p&gt;

&lt;p&gt;An OSI Model consist of 7 layers which are 👇&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r7s6zfuviqz7lj1ex86.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r7s6zfuviqz7lj1ex86.png" alt="OSI_Model"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Its Similar to layers in a Cake 🥮 😁&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 4 Load Balancers:
&lt;/h3&gt;

&lt;p&gt;The Layer 4 Load balancer are placed on the 4th Layer of OSI model i.e Transport Layer&lt;/p&gt;

&lt;p&gt;They don't have access to data and decision to redirect request to a server is purely done on the basis on data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Layer 7 Load Balancers:
&lt;/h3&gt;

&lt;p&gt;Layer 7 Load Balancer are placed on Application layer and have access to incoming as well outgoing request and data and decision is made up on its basis, Layer 7 LB is very very much complex :/&lt;/p&gt;

&lt;p&gt;At Last an high level architecture of load balancer can be depicted as:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ygpmhq6v9gc4p6kzc2p.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ygpmhq6v9gc4p6kzc2p.jpg" alt="Load balassssncer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Happy Load Balancing 🚀
&lt;/h2&gt;

</description>
      <category>tutorial</category>
      <category>computerscience</category>
      <category>performance</category>
      <category>systems</category>
    </item>
    <item>
      <title>System Design - 101</title>
      <dc:creator>Uzair</dc:creator>
      <pubDate>Sun, 19 Sep 2021 06:05:59 +0000</pubDate>
      <link>https://dev.to/uzaxirr/system-design-101-170o</link>
      <guid>https://dev.to/uzaxirr/system-design-101-170o</guid>
      <description>&lt;p&gt;Hey There!!&lt;br&gt;
Welcome to System Design 101&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjzw9vbeiw2usx2z27m4h.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjzw9vbeiw2usx2z27m4h.gif" alt="6f860f7a55059d942cbf0ccadf68ca36"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Find Your way to the topic which excites the most!!!&lt;br&gt;
NOTE: &lt;em&gt;It is recommended to follow the topics in order if you have no prior knowledge in system design&lt;/em&gt;&lt;/p&gt;

</description>
      <category>systems</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
