Company
Date Published
Author
Connor Brewster
Word count
1001
Language
English
Hacker News points
251

Summary

The text provides an overview of the evolution of Replit's hosting infrastructure from a single load balancer setup to a multi-cluster architecture. Initially, Replit used a straightforward system with multiple proxy service instances behind a load balancer, which became complex as the system expanded. To address this, they transitioned to a cluster-based system where each cluster has its own database and proxy instances, allowing for efficient routing of HTTP requests to the appropriate clusters. A key innovation was the development of an authoritative DNS name server that directs traffic to the correct cluster without additional hops, enhancing the system's efficiency. This DNS server not only manages domain requests but also handles DNS-01 challenges for TLS certificate generation. To ensure seamless migration of repls between clusters, Replit implemented "tombstones" to redirect requests from outdated clusters to the correct ones. Additionally, the infrastructure supports custom domains by linking them through CNAME records, ensuring they point to the appropriate cluster. The new setup allows for different configurations per cluster, such as allocating more resources for specific user groups, making the system robust and flexible for future scalability.