For decades, systems architects were forced to make a painful compromise: choose a traditional relational database (PostgreSQL, MySQL) for full ACID transactions, rich SQL semantics, and secondary indexes, but suffer painful manual sharding; or choose a NoSQL store (Cassandra, DynamoDB) for horizontal scale and high availability, sacrificing transactions, joins, and relational integrity.

Distributed SQL (NewSQL) engines like TiDB / TiKV and CockroachDB eliminated this compromise. Inspired by Google’s seminal Spanner and Percolator papers, these systems deliver the best of both worlds: standard ANSI SQL, ACID transactions, and strong consistency, scaling horizontally across hundreds of nodes with automated sharding and self-healing consensus.

This architectural study deconstructs the NewSQL revolution:

  • Layered Architecture: Decoupling the stateless SQL parse/plan/optimize layer from the distributed transactional KV storage engine.
  • Multi-Raft Range Topologies: Partitioning petabytes of data into millions of independent small Raft consensus groups (Regions), enabling parallel replication and localized split/merge balancing.
  • Percolator 2PC Distributed Transactions: Decentralized snapshot isolation using primary lock records, optimistic rollbacks, and asynchronous resolution.
  • Hybrid Logical Clocks (HLC): Providing monotonic causal ordering without requiring Google Spanner’s expensive physical GPS receivers and atomic clocks.

This module provides the theoretical and systems foundations for modern global relational data platforms.

What you will learn

  • Deconstruct NewSQL architectural layers: stateless SQL execution engines (TiDB) vs distributed transactional KV engines (TiKV)
  • Master Multi-Raft consensus: dividing continuous key spaces into 64-96 MB Regions/Ranges with independent Raft state machines
  • Analyze distributed transaction concurrency control: Google Percolator two-phase commit with primary and secondary lock columns
  • Evaluate distributed time models: Google Spanner TrueTime hardware GPS/atomic bounds vs Hybrid Logical Clocks (HLC)
STAGE TOPICS

Topics in this chapter