> For the complete documentation index, see [llms.txt](https://dev7days.gitbook.io/dev7days/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev7days.gitbook.io/dev7days/aws/route-53/routing-policies.md).

# Routing Policies

Routing Policies define how Route 53 respond to DNS queries.

There are 7 type of policies

1. Simple
2. Weighted
3. Failover
4. Latency based
5. Geolocation
6. Multi Value Answer
7. Geoproximity

### (1) Simple

It will respond only single resource. We can specify multiple values in same record but client will choose only one random value from these and If we use `Alias` then it will choose only one AWS resource. This policy does not support for health check.

<img src="https://2166680554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP9VzT74ziIucCaJgfreE%2Fuploads%2FDWy7yJXtikR6OnDVpEpW%2Ffile.excalidraw.svg?alt=media&amp;token=122786be-8263-4379-9bd4-ee6eb42b7b7c" alt="" class="gitbook-drawing">

### (2) Weighted

In this strategy we will apply `weighted` to each of destination so the traffic will go to destination that has a highest `weighted` .  `Weighted` is similar to the number of traffic in percentage units. Also It can be associated with `Health Checks` feature.

<br>

<img src="https://2166680554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP9VzT74ziIucCaJgfreE%2Fuploads%2F5QHUUhhk73l7wE2bTtq0%2Ffile.excalidraw.svg?alt=media&amp;token=d6bf3794-235b-4458-b0af-62d4ebf6e521" alt="" class="gitbook-drawing">

**Usecase**

* Load balancing between region

{% hint style="info" %}
**Good To Know:**

* Asign a weightof 0 to a record to stop sending traffic to a resource
* If all records have weight of 0, then all records will be returned equality.
  {% endhint %}

### (3) Failover

It will has 2 kind of record we need to set one for `primary` instance and another for `secondary` instance. When `Primary` instance is failed then it will return `Secondary` instead. This strategy require to have `Health Check`.

<img src="https://2166680554-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FP9VzT74ziIucCaJgfreE%2Fuploads%2FT1OiJmT3HZvadGAeHbH6%2Ffile.excalidraw.svg?alt=media&amp;token=f3aeb99e-52d5-4ab1-865b-0d066890651a" alt="" class="gitbook-drawing">

### (4) Latency Based

It redirects to the resource that has the least latency close to user. `Latency`  is based on traffic between users and AWS region.<br>

e.g :\
Germany users may be directed to the US (If that is the lowest latency). Also It can be associated with `Health Checks` feature.

### (5) Geolocation

This routing is baed on user location and If it did not find the location of user , then it will return `default` record instead (No match on location). Also It can be associated with `Health Checks` feature.

{% hint style="info" %}
If you use the **`VPN`**`, your location is based on that`` `**`VPN`**`.` &#x20;
{% endhint %}

#### Usecase

* Restrict content on location
* Website localization

### (6) Multi Value

It will return multiple resources.  Also It can be associated with `Health Checks` feature.

### (7) Geoproximity

In the same location we have mutiple resource there but we will set the `bias` to one of these resources then the traffic mostly go to that resoruce.

<img alt="" class="gitbook-drawing">
