<?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 Movses Martirosyan on Medium]]></title>
        <description><![CDATA[Stories by Movses Martirosyan on Medium]]></description>
        <link>https://medium.com/@movsesmartirosyan?source=rss-121491a1d024------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*oAncyPoNvU02uiZehio1KQ.jpeg</url>
            <title>Stories by Movses Martirosyan on Medium</title>
            <link>https://medium.com/@movsesmartirosyan?source=rss-121491a1d024------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 06:51:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@movsesmartirosyan/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[Setting Up Latency-Based Routing in AWS: A Step-by-Step Guide Part-1]]></title>
            <link>https://medium.com/@movsesmartirosyan/setting-up-latency-based-routing-in-aws-a-step-by-step-guide-part-1-73403f7a1cc2?source=rss-121491a1d024------2</link>
            <guid isPermaLink="false">https://medium.com/p/73403f7a1cc2</guid>
            <category><![CDATA[namecheap]]></category>
            <category><![CDATA[route-53]]></category>
            <category><![CDATA[routing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Movses Martirosyan]]></dc:creator>
            <pubDate>Tue, 07 May 2024 18:55:27 GMT</pubDate>
            <atom:updated>2024-05-07T19:00:31.351Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Introduction</strong></h3><p>Latency-Based routing solves many problems for modern applications, regardless of the cloud platform. It helps reduce network congestion and ensures a consistent user experience across different regions.</p><h3><strong>How Latency-Based routing works in AWS ?</strong></h3><p>Latency-Based routing in AWS works using the global infrastructure of AWS networks, deflecting arriving traffic to the region with the lowest latency for every user. AWS Route 53, a web service for DNS, keeps on probing the latency between end-users and AWS regions. When submitting the DNS query, Route 53 estimates the latency to its regions and redirects the user to the one with the lowest latency. Such dynamic routing makes absolutely certain that users are constantly routed to the region that could provide the quickest response times, therefore maximizing the uptime of apps hosted on AWS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*lhuqwqmgdtP4yfYe7JY9dw.png" /></figure><h3><strong>What you need:</strong></h3><ol><li>An AWS Account</li><li>A domain</li></ol><h3><strong>Let’s Start:</strong></h3><p>Registering your domain in Route53.</p><ol><li>Login to your AWS account and navigate to Route53</li><li>You’ll see Route53 dashboard, click on “Create hosted zone” button</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eEu70eQOVr2Oe8H3DsDxhQ.png" /></figure><p>3. Enter you domain in “Domain name” field, and set a description for your hosted zone, you can set tags for your hosted zone, and then press “Create hosted zone” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l98OTU5gb-goXFHU-tHuPA.png" /></figure><p>4. You’ll receive NS Records, which you need to add to your domain provider’s NameServers section. In my case, my domain provider is Namecheap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2Lh_vxDQ-cfqYxh60Jn8Q.png" /></figure><p>5. If you are using Namecheap go to your Namecheap account, find your domain and click on “Manage” button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c1pvN_HKuJGMcmtVxoheeA.png" /></figure><p>6. Select “Custom DNS” in “NAMESERVERS” section and add your NS Records. Then click green check button to save changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u3jQGDyfxmXfhbpx1kt6BA.jpeg" /></figure><p>Once we have completed the domain setup, the next step is to create the EC2 instances and Load Balancers across different regions. After that, with Route 53, we can point our domain to these Load Balancers. I will create one EC2 instance and Load Balancer in US East (N. Virginia) us-east-1 and the second one in Europe (Stockholm) eu-north-1.</p><h3><strong>Setting Up EC2 Instances and Load Balancers</strong></h3><ol><li>Navigate to EC2 and launch new instance, I will set EC2 name to “virginia-server”, you can set your own name</li><li>Select OS Image “Ubuntu”, and select AMI “Ubuntu Server 24.04 LTS”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3dOvtgYtBbdZDG_WfzskxQ.png" /></figure><p>3. Select Instance Type, I will select “t2.micro”</p><p>4. Create Key Pair to connect to server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s9XQU3yP2CuDuDQY63fYxw.png" /></figure><p>5. Now we should configure EC2 Security Groups, check “Allow SSH traffic From” and select “My IP” to allow SSH to server only from our IP Address and check “Allow HTTPS traffic from the internet” and “Allow HTTP traffic from the internet” to allow server listen all incoming traffic from the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rIR382KrT_W7IHi8Dpc3HA.png" /></figure><p>6. Scroll down to find the “Advanced Details” section. Expand this section if it is not already open. Locate the “User Data” text box within this section. Paste the provided code into this text box. This script will automatically install Nginx on the instance as soon as it starts for the first time.</p><pre>#!/bin/bash<br><br># Update package list<br>apt-get update<br><br># Install Nginx without any interaction<br>apt-get install -y nginx<br><br># Enable Nginx to start on boot<br>systemctl enable nginx<br><br># Start Nginx service<br>systemctl start nginx</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MeSuofknPWwWeS0jg89DLw.png" /></figure><p>7. Press “Launch Instance” to launch our EC2 server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*djpRCG-ds6oALPfD7TcMXQ.png" /></figure><p>8. Wait for the EC2 instance to start, and monitor its status via the EC2 dashboard. Look for the “Instances (running)” count to change to “1”, indicating that the instance is up and running. If the count does not update, click the “Refresh” button until the correct status appears.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cuw0-3XEEeS-sXKNLpPTgg.png" /></figure><p>9. Now when the EC2 instance is running, let’s set up a load balancer to distribute incoming traffic to our EC2. Begin by navigating to the “Target Groups” section within the EC2 dashboard. Here, click on the “Create target group” button. Target groups are crucial because they define a group of resources, like EC2 instances, that you want your load balancer to direct traffic to. This allows the load balancer to efficiently manage requests across multiple resources, enhancing the availability and fault tolerance of your applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2eOJu1lKopFshxauoLndg.png" /></figure><p>10. Select “Instances” under “Basic Configuration” section, under “Target group name” enter your desired target group name, then scroll down and press “Next” button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rymzgpCODZ-7P68l7OvFcw.png" /></figure><p>11. Now that you have created a target group, the next step is to register targets — such as EC2 instances — to which the Application Load Balancer (ALB) will route traffic. This involves specifying which servers will handle the incoming requests distributed by the ALB. Check the EC2 as shown below in the picture and press “Include as pending below” button, you will see that our EC2 is added under “Targets” section, and finally press “Create target group”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dVhFftV12yZaKRTpz3qsEA.png" /></figure><p>12. After setting up target group, the next step is to create a load balancer. This load balancer will direct incoming traffic to the servers listed in the target group we previously created. To do this, navigate to the “Load Balancers” section in the EC2 dashboard and click on “Create Load Balancer”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cq-hZbjsaka9klmHVWmudQ.png" /></figure><p>10. Press “Create” button under “Application Load Balancer”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oIvTIusIGiFIln6OsiEYkQ.png" /></figure><p>11. Set name for our Application Load Balancer (ALB)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cXRXpGsdNKYzy62OjK5stQ.png" /></figure><p>12. Choose at least two availability zones. <strong>It is crucial to select the subnet that corresponds to the one out target group’s server is located in</strong>. In my case my target group is in “us-east-1c”. This choice ensures that your load balancer can distribute traffic across multiple geographic locations within the region, enhancing the fault tolerance and stability of your application. By using multiple availability zones, you ensure that even if one zone experiences issues, your application remains accessible through the other zone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mdz3zWO9qE3H8hFsBbfzqQ.png" /></figure><p>13. The next step is to attach the target group that we previously set up. This attachment specifies that the traffic routed through the ALB should be directed to the servers in this target group. After attaching target group, scroll down and press “Create Load Balancer” button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BEs3k3AFx9EleJ9sQAlcJQ.png" /></figure><p>14. After creating load balancer navigate to “Target groups” and you can see that our target group became healthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7IEACfLd7zYW7Kfrj5XMUA.png" /></figure><p>15. Now switch to the Europe (Stockholm) region, designated as eu-north-1. You can do this by selecting ‘Europe (Stockholm) eu-north-1’ from the region dropdown menu located at the top right corner of the AWS Management Console. After changing the region, follow the same procedures outlined in the “<strong>Setting Up EC2 Instances and Load Balancers</strong>” section of the documentation. Repeat steps 1 — 15 as previously done to set up your EC2 instances and load balancers in the new region.</p><h3><strong>Conclusion and Next Steps</strong></h3><p>We have finished Part 1 of our guide. In Part 2, I will explain how to configure the default website of Nginx on each EC2 instance so that it displays the region where the instance is located. This will allow us to see which AWS region their requests are being served from when we connect to the EC2 server. Then we will config Route53 to point our domain to load balancers we have created previously.</p><p><strong>Thank you for reading!</strong> Stay tuned for Part 2 where we will continue our setup. Your feedback and comments are always welcome as we grow and learn together. See you in the next part!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73403f7a1cc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>