HeadlinesBriefing favicon HeadlinesBriefing.com

Wie Spacetime skaliert: Rechnen, Speicher, Netzwerk

Hacker News •
×

This is probably the question I get asked most about Spacetime. It’s a simple enough question, and it certainly seems like it should have a simple answer. Scaling is a complex topic, and the devil is in the details, as it so often is.

On the other hand, it’s also not so complex that we can’t understand scalability from first principles in a blog post. Let’s start by exploring scalability in general, and then let’s answer the question, “How does Spacetime scale?”If you want the TL; DR: There are three dimensions of scale: compute, storage, and networking. Horizontally scaling storage is relatively straightforward and shipping October 31st, 2026.

However, not all networking and computation can be scaled horizontally. OLTP databases that claim general horizontal scalability often pay enormous overhead per transaction and perform extremely poorly when faced with contending transactions. Spacetime provides high performance under contention and provides tools to make it easy for you to scale your parallelizable OLTP workloads.

NOTE: I talk about Cockroach DB a lot in this article. Cockroach DB is a rough stand-in for essentially all general purpose, horizontally scaling RDBMSs including Spanner and Aurora DSQL. Although I talk about some issues with these technologies, all of them are incredibly impressive feats of engineering.

Scale Intuitively, everyone has an idea of what it means to “scale”. It means to be able to do more. It means to keep up with demand.

It means to handle a billion requests, or “infinite” requests, or an infinite amount of data, or an infinite number of customers, or the ability to grow your app at 10x or 100x year over year without needing to rewrite your software. In particular, I think that when most people say a system is scalable, they’re talking about whether or not it’s specifically horizontally scalable. Whereas vertical scalability means to do more with a single computer, horizontal scalability is the ability to do more with more computers.

If doubling the number of computers lets us do roughly twice as much work, the computation scales horizontally. After all, a single computer can only be so big and fast, but in theory there’s no limit to the number of computers you can buy. There’s something very satisfying about that idea, so that’s the property that everyone looks for.

NOTE: The “doing more with more computers” definition implies that all horizontally scalable systems must be distributed systems. However, it does NOT imply that the only purpose of distributed systems is horizontal scalability. For example, distributed state machine replication is designed to redundantly do the same computation on many computers for the purpose of reliability, not scale.

More on this below in the Spacetime section. The question “Does it scale horizontally?” is underspecified. A better question is, “In what ways does it scale horizontally?” This is because there are actually three pretty independent dimensions of scalability: Compute: how many transactions you can process Storage: how much data you can store Networking: how many connections and how much bandwidth you can support To see what I’m talking about, let’s look at a few database systems that all expose broadly Postgre SQL-compatible interfaces, but have radically different architectures.

For example: Postgres is for the most part a single-node database. Postgres does not scale compute, storage, or networking horizontally for you. You can of course scale Postgres horizontally by deploying many Postgres instances, but as far as the Postgres code is concerned, it’s largely unaware of those other instances.

The one exception to this is read replicas which allow you to manually direct readers to a replica. This helps to scale both networking and compute, but it comes with caveats about read-after-write consistency and performance. Postgres itself has no notion of a cluster of primaries, cannot run transactions or queries across them, or route you to the appropr...