NewSQL: SQL Scalability Without Sacrificing ACID
NewSQL databases aim for NoSQL's horizontal scaling with the ACID guarantees of a traditional relational database. They suit high-throughput OLTP systems, like e-commerce, that must scale out. The footgun is assuming they are a simple drop-in replacement.
WHY IT EXISTS For decades, developers faced a hard choice: use a traditional relational database (like PostgreSQL) for ACID guarantees but struggle with horizontal scaling, or use a NoSQL database for massive scale but give up strong consistency. NewSQL was created to resolve this trade-off for applications that need both.
THE MENTAL MODEL A NewSQL database is a relational database re-imagined for a distributed world. The goal is to provide the familiar SQL interface and ACID transaction guarantees of a traditional database, but with the ability to scale out horizontally across many commodity servers, just like a NoSQL system.
HOW IT WORKS While implementations vary, NewSQL systems typically use a new architecture built from the ground up for distribution. They automatically shard (partition) data across a cluster of nodes. To maintain consistency during writes, they use consensus algorithms like Raft or Paxos to ensure all nodes agree on the state of a transaction before it's committed. To the application, it looks like a single, giant SQL database, but underneath, the work is distributed.
WHEN TO USE IT Use NewSQL for Online Transaction Processing (OLTP) workloads that have outgrown a single database server but cannot compromise on data consistency. This is common in systems with many small, fast, concurrent reads and writes, such as financial trading platforms, large-scale e-commerce inventory systems, and global identity services.
WHEN NOT TO USE IT Avoid NewSQL if your workload fits comfortably on a single, powerful database server; a traditional RDBMS is simpler and more mature. If your application can tolerate eventual consistency, a NoSQL database is often easier and cheaper to operate. NewSQL is also generally not optimized for Online Analytical Processing (OLAP) or data warehousing, which involve large, complex queries over historical data.
ONE CANONICAL EXAMPLE An e-commerce platform needs to handle millions of concurrent 'checkout' operations globally. A traditional SQL database would become a bottleneck. A typical NoSQL database might risk data inconsistency, like selling the same last item twice. A NewSQL system allows the database to scale across many nodes while ensuring every transaction is ACID-compliant, maintaining a perfectly correct inventory count even under extreme load.
Read the original → en.wikipedia.org
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.