P99 0 ms* autocomplete for 240M domain names
The Wirewiki website, run by the author, provides a tool for inspecting internet infrastructure, including domain names. One of its features is autocomplete for 240 million domain names, offering users instant and accurate results. The autocomplete system is designed to be fast and useful, aiming for near-zero latency (p99 0 ms).
This is achieved by prefetching suggestions as the user types and rendering them as soon as the API returns results before the user releases the key. The system targets a latency of 121 milliseconds, measured during a stress test with 100 domain name entries. The API utilizes Tranco, a list of the top 1 million most popular domains, as its primary source, supplemented by CZDS (Country Zone Delegation Service) for ccTLDs.
The autocomplete function uses an in-memory character trie for quick prefix lookups and a SSD-backed memory-mapped block index for tail domain searches. In summary, the Wirewiki autocomplete system delivers near-instant results, with latency primarily determined by network factors and round-trip times to the server. While the current setup may face latency issues with distant users, the author suggests that expanding resources could further improve performance.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.