Menu
Sign In Search Podcasts Charts People & Topics Add Podcast API Pricing
Podcast Image

Rust in Production

Radar with Jeff Kao

08 Jan 2026

Transcription

Chapter 1: What is the main topic discussed in this episode?

1.938 - 25.903 Matthias Endler

Here's Rost in production, a podcast about companies who use Rost to shape the future of infrastructure. My name is Matthias Entler from Corot, and today we talked to Jeff Kao from Radar about building a high-performance geocoding platform with Rost. Jeffrey, thanks a lot for taking the time today for the interview. Can you say a few words about yourself and about Radar?

0

26.693 - 56.549 Jeff Kao

Yeah, happy to be on this podcast. So my name's Jeff, and I'm a principal engineer at Radar Labs. We are an enterprise geolocation tech company. So that's, you know, a variety of things, you know, spanning from maps and routing to search and geocoding and geofencing, as well as fraud detection. And a bit more about myself, I've been programming for quite some time now.

0

56.769 - 72.129 Jeff Kao

I've worked at a variety of different startups. I've been a freelancer before as well and even started my own small indie company a while ago. But these days, most of my engineering focus, I would say, is largely on backend and data infrastructure engineering.

0

72.149 - 76.815 Matthias Endler

What's your programming background? What other languages do you know besides Rostam?

0

77.302 - 103.152 Jeff Kao

Yeah, so I would say, actually, it's kind of funny. When I first graduated from university, I joined a company called Foursquare. And I think at that time, it was maybe around the 2010s, where there were a lot of companies that were moving from Ruby. Because Ruby on Rails, I think at the time was like... And it still is, you know, but I think like it was almost like peak Ruby on Rails.

103.412 - 126.199 Jeff Kao

And then there's the peak migrating from Ruby on Rails to something more quote unquote scalable like companies like Twitter and like Foursquare and like SoundCloud. So it's funny because I worked at two of those companies. And so I've done a lot of work in Scala. You know, in university, I prototyped and I was doing freelancing and then I used a lot of Ruby on Rails at that time.

126.239 - 149.497 Jeff Kao

And so, you know, a lot of like web technology is involved with that as well. So I did a lot of JavaScript. And even at that time, there wasn't TypeScript, but I think people were using CoffeeScript at that time. So I played around with that quite a bit. We actually, it's funny, we migrated when I worked at PagerDuty. We moved some workloads from JavaScript to actually CoffeeScript.

149.517 - 178.927 Jeff Kao

But I think it's pretty much defunct now. Nobody really uses it. So those are probably my main languages, you know, dabbled in Python and some C and C++, but never in like a really full-time sort of manner. And so these days at Radar, mostly working with TypeScript, some Scala for some Spark pipelines, of course, a lot of Rust. And yeah, what else? Maybe some Python as well.

178.947 - 179.828 Jeff Kao

That's the matter in the face.

Chapter 2: How did Radar transition from Elasticsearch and MongoDB to HorizonDB?

245.37 - 263.092 Jeff Kao

It's almost like, especially in modern languages, a lot of us have come to really... be spoiled with these concepts of very powerful list collections that you see from functional languages. So mapping and filtering, and reducing.

0

263.372 - 284.783 Jeff Kao

And even these concepts you can see are applied to like things that aren't even just programming languages, even in like distributed computation frameworks, like literally map reduces is that concept. And you see that in spark and, and with all the new sort of data infrastructure that's written in rust or even like SQL, because if you think about like,

0

284.763 - 305.204 Jeff Kao

you know, like the where clause in SQL is like a filter or, you know, you can, you can do reductions with grouping. Like they're all sort of these ways to express the, how you process data in a way that's very elegant. And it's commonly used throughout all these different paradigms.

0

305.244 - 321.486 Jeff Kao

So I really think that on the Ruby side, for me, when I first started, I was like, wow, this is like Python, but better. But that's going to make some people angry, obviously. And that was me being a naive college student looking at

0

321.466 - 345.347 Jeff Kao

you know languages and seeing like oh where where's the sort of trend going and why is everybody using ruby on rails and it's really just understanding that like it's it's a very pleasant experience and very expressive language and and having all of those like sort of batteries built in gives you a lot of gives you a lot of productivity and almost like brings more joy to to programming

346.222 - 367.386 Jeff Kao

for really expressing like your ideas because really at the end of the day programming is about creating things and almost it's almost like a creative profession that I think most people don't really assume is creative from the outside but you're you're trying to solve problems and build things and being able to express things in in a very

367.585 - 376.802 Jeff Kao

I guess like terse manner is very conducive to you sort of getting into the flow state as a programmer.

377.575 - 401.322 Matthias Endler

Yeah, when I think of Ruby, I think of elegance. I think of the joy of programming, expressiveness. Where would you see yourself more on the programming is a craft or an art? Or would it be more like discipline of engineering? Where would you see yourself on that scale?

402.398 - 422.01 Jeff Kao

I think it's a mix of the two things. You have the tools, but it shouldn't necessarily be like, you know, the tools help you express something. So maybe like as as like drawing parallels to maybe some other hobbies I have, like, say you're a musician, right?

Chapter 3: What are the advantages of using Rust for building HorizonDB?

560.917 - 583.704 Jeff Kao

Rust really feels modern, and there are so many things to like coming from. I guess at Radar, our main programming language is TypeScript. We actually migrated to TypeScript from JavaScript a couple years ago, but looking at the JavaScript ecosystem where Essentially, there's a library for everything. There's a joke even on like, like stack overflow.

0

583.724 - 613.828 Jeff Kao

It's like, how do you add two plus two, just add this NPM package to add two numbers, you know. So there's, you know, having, you know, really, even at the time where we first started building this, and we're definitely not early adopters, like, we started building our Rust project, maybe two, two and a half years ago or so. There's a rich cargo crate ecosystem. There's a formatter, flame graphs.

0

614.129 - 640.474 Jeff Kao

And the paradigms are very functional, but you're not forced to use those either. So having a rich data structure ecosystem in the standard library, being able to process vectors with all of the sort of functions that many developers are used to these days really felt refreshing.

0

641.129 - 659.442 Jeff Kao

And when we were starting to build out HorizonDB, our Rust geo service, those were some of the characteristics we were really looking for, especially for a team with largely a background in writing TypeScript.

0

662.003 - 682.83 Matthias Endler

If you want to learn Rust on a deeper level and really get your hands dirty with challenging problems while having fun and seeing your progress at the same time, I recommend checking out CodeCrafters. I personally use it often to sharpen my skills and would recommend it to anyone who wants to become a better software engineer with Rust or any other language for that matter.

683.331 - 705.769 Matthias Endler

The challenges range from building your own shell to implementing Redis and SQLite all the way to Kafka and DNS. This is perfect hands-on experience for backend engineers and systems programmers. And if you go to corrode.dev slash CodeCrafters, you can try CodeCrafters for free today and get 40% off when you upgrade to a paid plan.

706.09 - 734.991 Matthias Endler

Head over to corrode.dev slash CodeCrafters or click on the link in the show notes to get started today. Take us back to that time. What was the tech stack like before you started HorizonDB? What was the team like, the team dynamics? I guess most of them would be TypeScript developers, but there might be other people in the team.

735.46 - 754.515 Jeff Kao

I guess at that time, maybe to give some background on maybe the business side of things, we're sort of tasked to build essentially an address validation API. And so that's slightly different from geocoding. And we can talk about these two things.

754.495 - 780.182 Jeff Kao

Geo-coding, or generally it's synonymous with for-geo-coding, that's what most people assume what geo-coding is, is essentially searching for any geo-entity. Whether that's an address, that can be a place or a region. So those tend to be more specifically called as a course geo-code. So for an address code, say I live at 123 Broadway.

Chapter 4: How does RocksDB enhance performance in HorizonDB?

894.352 - 915.098 Jeff Kao

So some Python as well. But nothing really, you know, statically compiled or, I mean, there's TypeScript, but more in the sense of like, you know, these things translate into some bytecode sort of like a JVM or into native instructions. And we were sort of expecting...

0

915.078 - 931.655 Jeff Kao

We had more constraints about like, oh, if we want to build a service that does things like this and it overlaps so much with geocoding, we might as well just sort of replace the service because we had some operational issues with our existing geocoder, which we can talk about later.

0

931.675 - 959.17 Jeff Kao

And so there was sort of a motivation to use something that, whether it's like an external service, like something like Elasticsearch, or, you know, having something like all in one. Operationally, like we sort of got burnt by like having so many like external services that we were almost sort of motivated to have something that would just let us do everything on almost one package almost.

0

960.192 - 963.158 Matthias Endler

Was Rust the only language that you considered for that project?

0

963.222 - 985.307 Jeff Kao

So we were considering a couple of different options. And it's funny because at our company, we write like tech specs or essentially design documents before we sort of go into building some larger projects or like features or things that will have like big downstream impacts. So like actually looking at back at the doc, we were considering a couple of languages.

985.427 - 1011.089 Jeff Kao

So, and we sort of discussed the trade-offs there. So we were thinking about Kotlin And the thinking around there is that the Java and JVM ecosystem is very rich. From my personal experience, I think Scala is very complicated. And onboarding the whole team to that might have been a little tricky, but Kotlin is a little bit more closer to... It's sort of in between.

1011.149 - 1038.589 Jeff Kao

And I do feel like there's a little bit more of an... backing around it now in the 2020s versus Scala. Scala really just seems like a little bit more niche in Spark. And even then, I think with Spark, I have some opinions about that and how Rust might play into a world like that. So Kotlin felt like a good in-between. And there's just a whole ton of these sort of

1038.805 - 1064.357 Jeff Kao

interesting ecosystem aspects such as you know elastic search is written in java and you know essentially elastic search is just a distributed wrapper around lucene i mean obviously it's much more than that you know entire company so it's a very broad stroke but you know there's a whole ton of of work around like text processing which is essentially a lot of this this and we felt like okay that is a very rich ecosystem that we could potentially use

1065.282 - 1085.88 Jeff Kao

With the trade-off of, we know we're probably going to have to store large text indexes and all of these things. Even synonyms or different spellings or spell correction. A lot of this is dictionary lookups of strings and things like that. So you can imagine, even from the onset, we're probably going to store giant hash maps or a lot of things in memory.

Chapter 5: What role do finite-state transducers play in geocoding?

1229.674 - 1248.239 Jeff Kao

If you go on Hacker News and look up Rust or migrating to Rust, I think the first result is always this one about Discord moving from Golang to Rust. And so... We, it almost sort of motivated us to see like, oh, they had occasional garbage collecting issues.

0

1248.339 - 1269.726 Jeff Kao

And even working at like other companies where we use Scala and the JVM, like there was consistently like issues with like the JVM and like the garbage collector. And, you know, there's so much innovation around the garbage collector. But we knew like for a lot of what we were doing, text processing and indexing, things like that, we're going to store large data structures just in memory.

0

1270.752 - 1289.706 Jeff Kao

I know there's these concepts of off-heat memory, but that's already sort of off the happy path of the language we're using. So we're almost like... putting a barrier or, like, something impeding us before we even got started. So we really did want to have something where we had a lot more control over the memory.

0

1290.266 - 1310.45 Jeff Kao

But we also didn't want a language like C or C++ where you sort of have to expect developers to understand these, like, concepts. Like, they still need to understand these concepts to some extent, but you have to be really, really upfront and, like, be very almost... very, very strict about these things.

0

1311.052 - 1317.853 Jeff Kao

So that would require significant like senior engineering talent within that had like CNC plus plus knowledge, which we didn't

1318.643 - 1344.009 Matthias Endler

Mm-hmm. There's a lot of ceremony around allocating and deallocating memory in C. Not so much in C++ nowadays, but definitely in C still. And when you say garbage collectors, yeah, that is also true for both Go and Kotlin or Java to a wider extent. I remember that in the past, we ran a very large Elasticsearch cluster and those were different times.

1344.59 - 1348.414 Matthias Endler

We tried to migrate that to containers and it wasn't really easy because...

1349.153 - 1378.097 Matthias Endler

operationally java had some unfortunate default decisions where it would try to allocate as much memory as it could possibly get on the machine and if it's co-hosted with a lot of other services on the same machine that sometimes caused some problems so did you also run into or did you also consider these kind of concerns the operational part of it the deployment process

1378.229 - 1406.884 Jeff Kao

I guess specifically for how you mentioned Elasticsearch, actually one of the things that also sort of bit us and also why we decided not to use a JVM language was the fact that we did have to maintain an Elasticsearch cluster to power geocoding with our old iteration of the geocoder. And we realized we just had to put everything on one machine, which is still the case.

Chapter 6: How does geospatial indexing with Hilbert curves work?

1520.796 - 1546.037 Jeff Kao

And Rust just gives you a simple binary. And we essentially compile it in CI and essentially ship up the binary to our servers. But also the data assets, we wanted it all to be self-contained within the same server. And even the way that we process it, actually, we rebuild the data sets from scratch. We never backfill anything.

0

1546.458 - 1566.107 Jeff Kao

We just take all the raw sources and then, you know, distribute the compute with something like Spark and essentially compile it to, you know, some data assets. And there are some things that are more specific to, you know, the data formats that we use on our server. So we process those later and then we ship those data assets to all of these boxes.

0

1566.668 - 1586.605 Jeff Kao

And so, you know, what that means is because everything is self-contained, it's actually very trivial to roll back, which is something that you might not be able to do if you had, say, like a third, you know, like if very simple, like two-tier architecture, even a web app and a, say, SQL server. If you do a data migration,

0

1587.8 - 1608.744 Jeff Kao

You have to reason about the data migration rollback and forward, as well as the binary data rollback and forward. But with our new service, it all sort of goes in one package and lockstep. So if you need to rollback, you just switch everything over and all the data pointers also switch back. And so that's a way to rollback. And you don't have to reason about these many states.

0

1608.925 - 1619.016 Jeff Kao

It's just one self-contained thing. And for that to work, you really do need something that's very efficient, essentially, both in Because they're shipping so many data assets.

1620.638 - 1639.66 Matthias Endler

I see. That's an aspect that I never heard before. Because Rust is so fast, you can afford to simplify operations by doing more at startup, but it's still performing. So you can cut some corners thanks to Rust.

1640.551 - 1664.435 Jeff Kao

Right, because it's almost like, hey, you don't even need an external database for something like you would typically grab for in web apps like a Postgres or MySQL. It's, hey, I'm going to use an embedded database or have a large in-memory index. And that's your sort of state. And so all that ships together in one whole unit or package.

1665.736 - 1667.858 Matthias Endler

What do you use for the storage layer?

1669.019 - 1676.458 Jeff Kao

So we use a couple of things. And so we talk about this in, you know, the blog post that describes Verizon DB.

Chapter 7: What challenges did Radar face during the development of HorizonDB?

1744.859 - 1756.434 Jeff Kao

And essentially, RocksDB is this data structure called a log structure merge tree. And it's really designed for high write throughput, which is sort of different from our use case.

0

1756.615 - 1771.943 Jeff Kao

But as like I mentioned before, technology is so cyclical where, you know, if somebody builds a database that's like high write throughput, well, they actually adopt a lot of these concepts and ways to tune it so that, you know, it's also very well tuned for read throughputs.

0

1771.923 - 1799.272 Jeff Kao

And so we just felt that, yeah, that, you know, community backing and the sort of it is a project that's written not in Rust. Right. So that was sort of another nice thing. We had all the Rust bindings to RocksDB and it was very simple, like integration to be able to just pull in that project. And that is our sort of primary storage layer for, you know, all of our entities.

0

1799.372 - 1823.933 Jeff Kao

So addresses, places, and different regions. And so it serves, you know, a number of different purposes. So obviously like primary key fetches. So when our services have, say, like an event and they have an ID for a place, they'll fetch, you know, that from our service. But we also... index it in a way that makes it really easy to do geo lookups.

0

1824.294 - 1837.198 Jeff Kao

So given this lat long, I want to be able to fetch all the relevant geo entities. So am I inside the city? Am I inside this country? Things like that.

1838.41 - 1863.899 Matthias Endler

RocksDB is very fast and very write-focused, but also it's effective in terms of storage. And I guess that plays in your favor because if you try to geocode the world, you need a lot of storage. And on top of it, once the storage is quite optimized, you get really decent cache locality on top of it for free.

1863.919 - 1864.099 Jeff Kao

Right.

1864.119 - 1865.4 Matthias Endler

So it might have been a really great choice.

1865.921 - 1866.021

Yeah.

Chapter 8: What insights can be gained about the future of Rust in infrastructure projects?

1997.052 - 2001.257 Matthias Endler

What do you use for the fuzzy searching part that you mentioned?

0

2001.98 - 2026.514 Jeff Kao

Right. So this is more related to the forward geocoding side, which is essentially translating your text query into some sort of geo entity. And so one of the requirements we had to deal with was essentially... being able to handle a little bit of typo tolerance from our address validation service. And that comes in many different forms.

0

2026.534 - 2047.808 Jeff Kao

Like there's so many like sort of failure cases for search, which is a little bit different from like more typical web applications. It's like you click through a couple of things and that you expected this. really like all the different use cases are literally every type of single character that a user can type. Those are all the potential use cases. So the cardinality is extremely high.

0

2047.868 - 2077.881 Jeff Kao

And essentially the number of failure cases is almost unbounded in some sense. There's just so many combinations that at that point, like there's so many ways to type something in. So we deal with fuzzy search in a couple of ways. We use a library called FST. And I remember there's an episode you had with Charlie Marsh from UV. And I think there's an engineer who works there now.

0

2078.282 - 2094.458 Jeff Kao

I only know, I only remember his, his GitHub name because it's very memorable, like burnt sushi, but he works at UV if, if I remember correctly, and he's come up with a lot of really interesting rust crates. And I think he even implemented the regex or had the, did the regex implementation of rust. So.

2094.725 - 2096.932 Matthias Endler

Yeah, exactly. Jonathan Gallant, yeah.

2097.514 - 2130.151 Jeff Kao

Right. And yeah, so we make a lot of use of his libraries, but FST is essentially a character graph. And so there's this concept of like a try that's very typically used for prefix queries. And so you can sort of think of an FST as like a try where, you know, all the prefixes that are shared compress, but it also compresses the suffixes. So now you have almost like double compression, right?

2130.892 - 2130.992

Yeah.

2130.972 - 2159.106 Jeff Kao

And essentially doing text lookups is a traversal of the graph. And you can see how that sort of primitive lets you do many things. It lets you implement like a regex because the regex sort of works the same way. And so for fuzzy search, you can implement like Levenstein distance by essentially keeping away of dropping or like if you type something incorrectly,

Comments

There are no comments yet.

Please log in to write the first comment.