Neon Authorize just launched. Add row-level security to your codebase, with simplified syntax
Case Studies

How Retool uses Retool (and the Neon API) to manage 300K+ Postgres databases

Retool manages a massive database fleet with only one engineer

Post image

Neon is a serverless Postgres database with a robust API. Partners like Retool choose Neon to easily offer managed databases to their end-users, simplifying the management of massive database fleets while optimizing costs. Thanks to Neon, Retool is able to manage over 300k Postgres databases with just one engineer!

The Retool platform makes it easy for developers to create internal apps for their teams and businesses. Retool handles much of the boilerplate code and UI design automatically, empowering developers to deliver effective business software up to 10x faster. 

Post image

Retool’s drag-and-drop interface allows users to quickly assemble UIs from a set of pre-built components such as tables, buttons, and forms, supporting custom code for the specific functionalities of each app. The platform makes it easy to connect these UI components to nearly any API, streamlining the development process. 

This smooth experience empowers teams to build a wide range of internal tools. A few examples of what you can build with Retool: 

  • DevOps dashboards: to visualize and analyze software development, testing, deployment, and monitoring for faster and more efficient software delivery.
  • Inventory management dashboards: to stay organized by tracking inventory, including what’s in stock, adding new SKUs, monitoring the status of orders, and placing new orders. 
  • Support ticketing systems:  to manage and track customer support tickets, streamlining the process of addressing and resolving them. 

Explore the Retool templates for more.

Adding a database to the Retool platform

To further improve the user experience, the Retool team decided to host a database into their platform. This would allow developers to jump straight into building their internal tools, without worrying about having to spin up and manage database instances separately. 

To make this happen, the engineers identified some key requirements for the implementation. The objective was to ensure the database integration was not only seamless to the end user, but also operationally sustainable and cost-efficient for the team: 

This system had to be managed with minimal engineering overhead.

The fleet had to be easily scalable up to hundreds of thousands of databases without a proportional increase in the management burden. The best way to do this was by offering dedicated Postgres URLs to every end user; this isolated design simplifies the management of the database fleet, as it allows to maintain a clear mapping between customers and their respective databases.

The Retool team wanted to automatically suspend databases that were not in use.

By suspending idle instances, Retool would reduce the costs associated with running server resources that are not being actively used. This is particularly important for a platform potentially managing a massive number of customer databases with each database on its own instance.

Hello, RetoolDB (powered by Neon)

“We’ve been able to automate virtually all database management tasks via the Neon API. This saved us a tremendous amount of time and engineering effort. The scale-to-zero functionality of Neon allows us to offer dedicated databases to our customers without worrying about the cost of idle resources”

Himanshu Bhandoh, Software Engineer at Retool

The Retool team ended up partnering with Neon to power RetoolDB. The Neon API allowed Retool to integrate and automate all database management, streamlining workflows and reducing manual work. Retool creates one Neon project per every end user, each project with one Postgres database. 

Due to their serverless nature, Neon databases scale to zero automatically when inactive. This saves Retool the costs of idle instances, which is crucial for managing resources cost-effectively across a large fleet. This streamlined architecture enables Retool to manage +300,000 database projects with minimal engineering overhead—the fleet is currently managed by one engineer.

The beauty of dogfooding: how Retool uses Retool to manage RetoolDB

Retool oversees virtually all database management tasks directly from an internal tool, which they built (of course) using Retool.

Post image

Let’s peek behind the scenes:

  • When a new Retool user signs up, they’re automatically assigned a pre-created, unclaimed database from a pool of Neon projects. 
  • Whenever a database is allocated from the pool, the system seamlessly triggers the creation of a new Neon project, maintaining a consistent supply.
  • The backbone of this system is an internal Postgres database that tracks the status of each Neon database (claimed or unclaimed) along with user assignment details.
  • The team monitors the entire fleet through a custom dashboard. This not only offers real-time insights but also allows for direct actions, such as adjusting storage quotas for individual databases.
Post image

Sometimes, even complex problems can have elegant solutions (and it feels great when they do!). Start exploring Retool and discover how to build your own internal tools that connect to your databases and APIs.

Offer managed Postgres to your users: partner with Neon    

“The support from the Neon team has been great. Whenever we’ve raised issues, we’ve received fast, effective responses. Their dedication to improving their service reassures us that we have a reliable partner in Neon”

Himanshu Bhandoh, Software Engineer at Retool

By partnering with Neon, Retool has been able to incorporate a Postgres offering into their developer platform, reducing time-to-value for their customers. If you’d also like to offer Postgres to your end users, consider partnering with us. Providing your customers with fully managed Postgres has never been easier.