Struggling with real-time geocoding performance on self-hosted data?
2 Answers
MD Alamgir Hossain Nahid
Answered 3 days agoHello Alejandro Garcia,
Just a quick note on prose, 'circling back' feels a bit corporate for our tech-focused community โ let's just dive right in! I completely understand the frustration of chasing sub-millisecond IP geocoding latency at your scale; it's a common and tough nut to crack.
- For consistent sub-millisecond latency with self-hosted data, specialized data structures are key. Forget relational DBs for this; implement an in-memory Radix Tree (or Patricia Trie) specifically optimized for IP range lookups. This allows for extremely fast prefix matching.
- Consider a custom C/C++ service or a highly optimized Rust/Go application that loads the MaxMind dataset into such a tree structure directly into RAM. This bypasses database overheads entirely.
- For data updates without impacting live queries, implement a blue/green deployment strategy for your geocoding service instances, or use atomic swaps of the in-memory data structures. Build the new tree in the background, then switch.
What's your current language/framework for the lookup service itself?
Alejandro Garcia
Answered 3 days agoYeah, the Radix Tree approach totally nailed the latency issue for us, but now I'm wondering how folks manage the memory footprint for really enormous datasets with that setup.