SQL and transactions like a classic database, with scale-out like NoSQL (Spanner, CockroachDB).
A NewSQL database keeps what people like about a classic database (SQL and safe ACID transactions) and adds what they like about NoSQL: it can grow across many machines and survive failures.
For many years you had two choices. A classic relational database (like PostgreSQL or MySQL on one big server) gives you SQL, joins and strong transactions, but one machine can only grow so far. A NoSQL database spreads over many machines easily, but often gives up joins or strong transactions to do it.
NewSQL is the attempt to get both. You still write SQL and still get "all or nothing" transactions. Under the surface, the table is cut into ranges of rows. Each range is stored as a small group of copies (often three or five). One copy is the leader. A write goes to the leader, which sends it to the followers and waits until a majority has stored it. Then it is committed.
If one machine dies, the other copies still hold the data and choose a new leader. No committed write is lost, and the database keeps answering, as long as a majority of each group is alive.
| Part | What it does | Why it is there |
|---|---|---|
| Ranges (shards) | The table is cut into pieces by key, and the database splits and moves them as data grows | So no single machine holds everything |
| Replication per range | Every range has several copies, often three or five | So a failure does not lose data |
| Consensus (Raft or Paxos) | The copies agree on the order of writes. A write commits when a majority has it | So all copies tell the same story, even with crashes |
| Leader per range | One copy takes the writes and tells the others | Gives a clear order and avoids conflicts |
| Distributed transactions | A commit protocol similar to two-phase commit across the ranges involved | So a transaction touching several ranges is still all-or-nothing |
| Clocks and timestamps | Transactions get timestamps so the database can order them. Some systems use special clock hardware or bounded clock uncertainty | So readers see a consistent snapshot |
| Classic relational | Typical NoSQL | NewSQL | |
|---|---|---|---|
| Query language | SQL | Often its own API | SQL |
| Transactions | Strong, on one node | Often limited to one item | Strong, across nodes |
| Scale out | Hard (manual sharding) | Easy | Built in |
| Failure survival | Needs extra set-up | Built in | Built in |
| Write latency | Lowest | Low | Higher (consensus and cross-node commits) |
A write can commit: every shard it touches still has a majority.
A simplified model. A round is 4 ms inside one region and 70 ms when the majority must be reached in another region. These numbers are illustrative, not measurements. Real systems also use leases, follower reads and other tricks.
| Term | Meaning in easy words |
|---|---|
| NewSQL | A database that offers SQL and ACID transactions together with horizontal scaling |
| Range / shard | A slice of a table, stored and replicated as one unit |
| Replica | One copy of a range, stored on one node |
| Leader | The replica that takes writes for a range |
| Consensus | A method (Raft, Paxos) for copies to agree on the same order of writes |
| Majority (quorum) | More than half of the copies. A write commits when a majority has it |
| Distributed transaction | A transaction that changes data in more than one range or node |
| Two-phase commit | A protocol where everyone prepares, then everyone commits or aborts together |
| Hot spot | A range that gets far more traffic than the others |
| Serializable | The strongest isolation level: transactions behave as if they ran one after another |
| Geo-partitioning | Placing certain rows in chosen regions, for speed or for data-residency rules |
| Choice | We gain | We lose |
|---|---|---|
| More copies per range | Survives more failures | More cost and a slower majority |
| Copies in many regions | Survives a region outage | Slow writes across regions |
| Copies in one region | Fast commits | A whole-region failure is a big risk |
| Strong reads | Always the latest data | Must talk to the leader, so slower |
| Stale reads from nearby | Fast reads | May show data a few seconds old |
| Transactions across ranges | Easy app logic | Extra rounds, so higher latency and more retries |