How Greenlight Works
GreenlightedNS is a DNS-based load balancer, meaning that it uses DNS records to route clients to severs.
Like in traditional DNS, a service has a name (e.g. www.example.com) with records that point to one or more servers.
Unlike traditional DNS, GreenlightedNS can dynamically add or remove records based on healthchecks, geographical proximity, and more. For example, it can remove a server’s A record/IP address from www.example.com when that server goes down.
How visiting a website works using regular DNS
Section titled “How visiting a website works using regular DNS”If a user wants to go to the webpage https://www.example.com/index.html in their web browser, the browser first uses DNS to resolve the IP address of the server:
In this scenario, the DNS server for example.com is configured with a single record www that contains the IP address 192.0.2.1.
When there are multiple servers that host www.example.com, the DNS server will be configured with a record for each IP addresses, e.g. 192.0.2.1 and 198.51.100.1.
How visiting a website works using Greenlight
Section titled “How visiting a website works using Greenlight”Greenlight becomes the DNS server for example.com. From the browser’s perspective, everything works exactly the same as the regular DNS server above.
The key difference is that Greenlight isn’t simply configured with a list of static IP addresses like a regular DNS server is. Instead, it is configured with Functions that enable various kinds of dynamic behavior.
The most common kind of dynamic behavior is a Weighted Round Robin (WRR) with a pool of healthchecked servers. With this setup, Greenlight performs healthchecks against multiple servers and an IP address for one of the healthy servers1.
Footnotes
Section titled “Footnotes”-
Greenlight keeps track of the status of the healthchecked servers; it doesn’t need to check them every time a browser asks about
www.example.com. ↩