Architecture decisions in Neon, a serverless Postgres service
neon.tech
neon.tech
The article mentions that a consequence of separating storage from compute is that compute nodes cache hot pages in memory and load cold pages from object storage (like S3?) when needed. Does anyone know what are the consequences of this decision. In case of a query that touches multiple rarely used pages, would that incur high latency and ingress? How does that penalty compare to a vanilla postgres running on AWS and storing pages on EBS?
Where it works super well is the long tail of small and rarely used database - it pushes our costs way down.
Another advantage is that if the whole region goes down the S3 copy survives.
Finally if you separate storage and compute you can be serverless and scale to 0.
I would love to spend 1-3 years with other good people to just build good tech :(
If it will be succesfull, time will tell. But serverless postgres would be really sweet to have. Hell, AWS itself should be funding this project. I run my Postgres for hobby projects at home because AWS Aurora serverless postgres is very expensive and doesn't scale down to zero. I wouldn't mind paying a dollar or two for storage the months I don't use that project, and a little more when I actually need to query my databases. At work, my $$$$$$ employer pays $$-employees to poke at $$$-devs who forget to shut down an Aurora serverless Postgres.
Since it’s my second company (prev was singlestore) the early funding was relatively easy. Later funding was done based on our traction.
GZ :)
A clean, low-friction separation of storage and compute for a top-tier database like Postgres is huge. I think it will take some time for the implications to sink in though, because it changes some assumptions about how to integrate a databases with a system that are so fundamental that we rarely think about it... (not to mention, it probably doesn't make sense to change existing systems, where the fundamental system decisions have already been made.)
We tend to centralize the database in system design because they are complex and expensive to run, and you can amortize those costs the more you put into a single database. But of course, that also makes the central database bigger, more complex and more expensive. And once everything is in a central store, we tend to bind everything together (with joins, references, procs, etc. Each step in that direction tends to make sense on its own, but the end result is the "big ball of mud" architecture where everything is interconnected and there's no separation of concerns, which makes the system fragile and increasingly difficult to change.
With this tech the pressure to centralize the database is relieved.
E.g., if you have a situation where you are adding some new, logically distinct data to your system -- maybe just a few tables and maybe with a variable load, especially at first -- traditionally you probably would lean hard toward adding this to an existing central database since the overhead of spinning up and running a new one would be prohibitive. But now you can just make that a separate database -- spinning up a managed one is easy and you only need to pay for as much storage and compute as you actually need to use (which is really about the same as if you had put the tables in an existing central database anyway).
Of course, systems would still tend to have significant central data, but that could be based on actual app concerns, not operational ones.
Anyway, I'm loving this and can't wait to see the long term impact.
You can have as many databases as logically makes senseseparate data logically without exploding the operational cost of your system. E.g. you can spin out a separate a database that has light (or even no load) most of the time yet can seamlessly scale to heavy load. And it can do this independent of how much data is in it, and you don't need to worry about it's affect on day-to-day data access in your system since you
Yugabyte is architected similarly to other similar databases, with an SQL layer on top of a distributed, replicated key/value store based on RocksDB. The different being that the SQL layer is Postgres.
Yugabyte tightly couples the two, though, though it seems like this is mostly for convenience, in that the "TServer" (tablet server) is managed by Yugabyte itself. I wonder if it could support an architecture more similar to TiDB, where the storage is independently scalable from compute.
CockroachDB and TiDB are based on a similar design, but Yugabyte stands out as being a "real" Postgres. It even supports normal Postgres extensions via "CREATE EXTENSION".
I think that its value as a layer becomes unclear. Sure its battle-tested and has great query planning and similar tools, but those base based on assumptions that are largely violated with the re-architecture.
I think the architectural decoupling benefits mentioned are basically already proven though. I’ve worked at places that had many NoSQL tables per team, each logically distinct, and at places that had one database with 50+ tables in it. The breakup can be nice, in the same way that “serverless” is nice - data storage becomes entirely abstracted to the developer.
I have a thread about it on twitter: https://x.com/nikitabase/status/1723579854266966399?s=46
Counterexample is snowflake - they got it right !
We have more cool stuff coming!