Databases with V
June 2, 2025 at 12:23 PM
At Turso, people are creating databases at an insane pace. Over the past few months, with the rise of agentic workflows, we've seen a massive surge. Companies are creating millions of databases because it’s economically viable on Turso.
Recently, I worked on scaling our proxy layer to handle a billion databases. This is the service responsible for converting a user friendly URL like `my-database-apple.turso.io` into the address of a node within our infrastructure. The proxy layer gives us the flexibility to move databases between nodes at will, while users continue using the same URL seamlessly.
As the number of databases grows daily, the metadata required to maintain this mapping has been increasing significantly: around 500MB per week. That's a lot, especially considering we run multiple instances of the proxy in several regions. Worse, as memory requirements grow, we’re forced to upgrade to higher-CPU machines even if we don't actually need the extra compute power, just to get more RAM.
We managed to cut down the memory usage significantly using techniques like:
- Interning strings
- Trimming unnecessary suffixes
- LRU Cache (instead of hashmap)
- Hybrid cache (in-memory + disk)
Here is the full post - https://turso.tech/blog/we-rewrote-large-parts-of-our-api-in-go
❤️
👍
🔥
🚀
7