DEV Community

Le Huy Ho
Le Huy Ho

Posted on

Learning AWS - DVA - Day 15: Route 53 Routing Policies

Overview

  • Define how Route 53 responds to DNS queries

  • Don't get confused by the word "Routing"

    • It's not the same as Load Balancer routing which routes the traffic
    • DNS does not route any traffic, it only responds to the DNS queries
  • Route 53 supports the following Routing Policies

    • Simple
    • Weighted
    • Failover
    • Latency based
    • Geolocation
    • IP-based
    • Multi-Value Answer
    • Geoproximity (using Route 53 Traffic Flow feature)

Routing Policies - Simple

  • Typically, route traffic to a single resource

  • Can specify multiple values in the same record

  • If multiple value are returned, a random one is chosen by the client

  • When Alias enabled, specfy only one AWS resource

  • Can't be associated with Health Checks


Routing Policies - Weighted

  • Control the % of the requests that go to each specific resource

  • Assign each record a relative weight:
    traffic(%) = weight of the records / sum of all the weight

  • Weights don't need to sum up to 100

  • DNS records must have the same name and type

  • Can be associated with Health Checks

  • Use cases: load balancing between regions, testing new application versions, ...

  • Assign a weight of 0 to a record to stop sending traffic to a resource

  • If all records have weight of 0, then all records will be returned equally


Routing Policies - Latency-based

  • Redirect to the resource that has the least latency close to us

  • Super helpful when latency for users is a priority

  • Latency is based on traffic between users and AWS Regions

  • Germany users may be directed to the US (if that is the lowest latency)

  • Can be associated with Health Checks (has a failover capability)


Routing Policies - Failover (Active - Passive)

  • You designate a primary resource and a secondary (or failover) resource. The primary resource is the one that Route 53 will route traffic to under normal conditions

  • Route 53 performs health checks on the primary resource to determince its availability

  • If the primary resource becomes unhealthy, Route 53 will redirect traffic to the secondary resource without manual intervention

  • Use cases: high vailability dns, desaster recovery


Routing Policies - Geolocation

  • Different from Latency-based

  • This routing is based on user location

  • Specify location by Continent, Contry or by US State (if there is overlapping, most precise location selected)

  • Should create a "Default" record (in case there is no match on location)

  • Use cases: website localization, restrict content distribution, load balancing, ...

  • Can be associated with Health Checks


Routing Policies - Geoproximity

  • Route traffic to your resources based on the geographic location of users and resources

  • Ability to shift more traffic to resources based on the defined bias

  • To change the size of the geographic region, specify bias values:

    • To expand (1 to 99) - more traffic to the resource
    • To shrink (-1 to -99) - less traffic to the resource
  • Resources can be:

    • AWS resources (specify AWS Region)
    • Non-AWS resources (specify Latitude and Longitude)
  • You must use Route 53 Traffic Flow (advanced) to use this feature


Routing Policies - IP-basd Routing

  • Routing is based on client's IP addresses

  • You provide a list of CIDRs for your clients and the corresponding endpoints/locations (user-IP-to-endpoint mappings)

  • Use cases: Optimize performance, reduce network costs, ...

  • Example: route end users from a particular ISP to a specific endpoint


Routing Policies - Multi-Value

  • Use when routing traffic to multiple resources

  • Route 53 return multiple values/resources

  • Can be associated with Health Checks (return only values for healthy resources)

  • Up to 8 healthy records are returned for each Multi-Value query

  • Multi-Value is not a substitue for having an ELB


Domain Registrar vs DNS Service

  • You buy or register your domain name with a Domain Registrar typically by paying annual charges (e.g., GoDaddy, Amazon Registra Inc, Hostinger, ...)

  • The Domain Registrar usually provides you with a DNS service to manage your DNS records

  • But you can use another DNS service to manage your DNS records

  • Example: purchase the domain from GoDaddy and use Route 53 to manage your DNS records

  • So if you buy your domain on a 3rd party registrar, you can still use Route 53 as the DNS Service provider

  • Create a Hosted Zone in Route 53

  • Update NS Records on 3rd party website to use Route 53 Name Servers

Top comments (0)