In addition to domain name resolution, there are three wonderful uses of DNS in architecture design!

What is DNS used for in general?

As shown in the preceding figure, DNS is generally used as a domain name resolution to translate the domain name into the public IP address of NG so that NG can route HTTP requests to the web-server cluster on the private network.

Are there any other uses for DNS in the architectural design process?

At least these three things can be done.

First, users can access nearby.

With Smart DNS technology, it is easy to achieve close access to the resources you need.

As shown in the preceding figure, different users access the same resource:

  • For telecom users, DNS can return the IP address of the telecom room;
  • For China Unicom users, DNS can return the IP address of China Unicom's data center.
  • For education network users, DNS can return the IP address of the education network data center;

As a result, users will access it faster.

Intelligent DNS technology is an indispensable part of CDN and multi-data center multi-active architecture.

Second, the horizontal expansion of reverse proxies.

In the video of Episode 3 "Time Delay and Throughput", there was a tail left:

If the throughput of Nginx is 10W times per second, how can Nginx on the homepage resist 100W concurrency per second?

Some friends say LVS, some friends say F5, both are true, but these two are essentially scale up solutions, and there is always a limit to performance, and the symptoms are not cured.

The correct solution for the scale out solution is DNS polling.

As shown in the figure above, on the DNS side, multiple NGINX public IPs are configured for the same domain name, and each DNS DNS resolution domain name request is polled to return a different IP, so that the horizontal expansion of NGINX can be achieved, achieving the purpose of 1 NG anti-10W throughput and 10 NG anti-100W throughput.

Third, the load balancing of the web-server.

Before the advent of reverse proxy technology, it was possible to distribute traffic evenly across different web-servers with the help of "DNS polling". The advantage of this solution is that the architecture lacks a layer of network requests, and the disadvantage is that "DNS polling" does not guarantee the availability of the back-end web-server.

In addition to ensuring load balancing, reverse proxy also has the ability to keep alive detection, so after the emergence of reverse proxy technology, there is no need for DNS polling to do load balancing.

To sum up, in the process of architecture design, in addition to resolving domain names, DNS can also:

  • First, intelligent DNS, which accesses the nearest server according to the user's IP;
  • Second, DNS polling horizontally expands the reverse proxy layer;
  • Third, use DNS to implement load balancing;

Know what it is, know why it is.

Ideas are more important than conclusions.