System Design Space
Knowledge graphSettings

Updated: June 4, 2026 at 12:42 PM

NewSQL: TiDB, CockroachDB, and YDB

medium

A NewSQL overview: distributed SQL, ACID, automatic sharding, TiDB, CockroachDB, YDB, cross-region transactions, and operational cost.

NewSQL becomes relevant when a team no longer wants to choose between SQL ergonomics, ACID guarantees, and the pain of manual sharding. This chapter is about that expensive stage of growth.

In practice, it helps you see when distributed SQL actually removes architectural pain, and when data locality, inter-region latency, and transaction cost still dominate the design.

In interviews and engineering discussions, it is especially useful when you need to compare NewSQL against PostgreSQL plus sharding and NoSQL under concrete product constraints rather than vendor slides.

Practical value of this chapter

Global ACID fit

Identify where NewSQL preserves SQL+ACID under horizontal scale without manual sharding complexity.

Region-aware design

Model data locality and inter-region RTT so transactional paths do not pay unnecessary latency.

Cost of consistency

Balance strong consistency benefits against latency, throughput, and infrastructure cost.

Interview comparison

Compare NewSQL with Postgres+sharding and NoSQL using business constraints instead of vendor messaging.

Decision frame and editorial focus

Chapter focus

NewSQL DBMS class, distributed SQL, and the cost of strict transactions

Workload profile

The focus is transactional SQL at horizontal and often regional scale where one classic node no longer scales cleanly.

Good fit

Distributed SQL is justified when strong guarantees matter more than simplicity and the team accepts latency, coordination, and operations cost.

Boundary and risk

Key risks are hot keys, cross-region transactions, consensus cost, rebalancing, and the illusion of free sharding.

Connect next

Always validate the choice against a PostgreSQL/MySQL baseline, distributed transactions, and multi-region architecture.

Primary source

NewSQL (Wikipedia)

A compact historical overview of NewSQL as an attempt to combine SQL, ACID, and horizontal scale.

Open material

TiDB docs

TiDB Architecture

Official TiDB architecture overview: TiKV, PD, the SQL layer, and HTAP components.

Open documentation

NewSQL is usually considered when a team wants to keep SQL and ACID semantics, but workload has already outgrown comfortable single-node OLTP limits. In this chapter we compare three practical implementations: TiDB, CockroachDB and YDB.

The goal is not to choose one universal winner, but to map workload, transaction constraints, and operational context to the most suitable engine.

What NewSQL usually means in practice

SQL and ACID without manual sharding

The DBMS takes responsibility for transaction coordination, data placement, and load balancing.

Strong consistency as a default posture

The baseline objective is correctness under failures, not only peak write throughput.

Higher operational complexity than classic OLTP

Distributed SQL requires disciplined key design, observability, and capacity planning.

Shared architectural pattern

NewSQL architecture map

SQL compute separated from KV storage

One comparison frame for three designs: where SQL lives, how data is distributed, and where consistency cost appears.

MySQL-compatible path to distributed SQL

TiDB separates compute, metadata, and storage: SQL nodes accept requests, PD manages placement, TiKV stores data, and TiFlash adds an analytical path.

TiDB SQL layer
SQL nodesMySQL wireplannerstateless compute
layer transition
PD
cluster metadataregion schedulingRaft leaders
layer transition
TiKV
distributed KVregionstransactions
layer transition
Raft groups
replicationmajorityrebalancing
layer transition
TiFlash/HTAP
columnar replicasanalytics near OLTP
layer transition
Operations and migration
MySQL compatibilityhot regionsmigration plan

What to check

Best fit

MySQL migrationtransactional growthHTAP without a separate DWH model

Main risk

hot keyscost of analytical replicasprimary-key design

Measure

p95/p99 latencyregion rebalancingAZ-failure behavior

TiDB vs CockroachDB vs YDB

Core architecture

  • TiDB: TiDB SQL nodes + TiKV on Raft + PD; HTAP path through TiFlash.
  • CockroachDB: Single binary model: SQL + KV + Raft ranges in one cluster.
  • YDB: Tablets and actors, shared-nothing design, with compute and storage split by layers.

Multi-region model

  • TiDB: Placement policies exist, but regional and zonal topology still needs explicit tuning.
  • CockroachDB: Strong built-in focus on geo-partitioning and data-locality policies.
  • YDB: Multi-AZ and multi-region setups depend on cluster topology and domain configuration.

Compatibility and ecosystem

  • TiDB: MySQL-compatible wire protocol and DDL; convenient for MySQL migration paths.
  • CockroachDB: PostgreSQL wire compatibility and PostgreSQL-like SQL workflows.
  • YDB: Own SQL dialect and APIs with strong integration into YDB/Yandex Cloud ecosystem.

Primary strengths

  • TiDB: Balanced OLTP and operationally close HTAP analytics with practical MySQL migration support.
  • CockroachDB: Strong global OLTP story with automated failover in multi-region environments.
  • YDB: High-load transactional workloads, auto-sharding, and row+column tables in one platform.

Operational risks

  • TiDB: Requires careful hot-region management and key-design discipline; HTAP adds operational complexity.
  • CockroachDB: Cross-region transactions add latency, and schema/key design strongly affects write cost.
  • YDB: Needs a mature distributed-operations model and strong partitioning practices.

Fast scenario-based selection

Global SaaS with active multi-region writes

Often CockroachDB

A good fit when locality policies, region-failure survivability, and predictable geo-failover are critical.

Growth from MySQL toward distributed SQL without fully rewriting the solution

Often TiDB

Useful when MySQL compatibility, incremental migration, and OLTP+HTAP in one platform are priorities.

High-load transactional services in Yandex Cloud ecosystem

Often YDB

A common fit when managed/native YDB integration and auto-sharding are key requirements.

Standard regional OLTP without hard scale-out pressure

Often not NewSQL

If PostgreSQL/MySQL already meets workload and SLA, distributed SQL can add unnecessary complexity.

Recommendations

Start with a key design document: partition key, transaction boundaries, and expected hot keys.

Measure p95/p99 latency under node/AZ failures and network partitions, not only steady-state throughput.

Separate local and cross-region transaction paths explicitly to control latency and cost.

Build observability around shard/range/tablet behavior: skew, rebalance, retries, and lock contention.

Common mistakes

Treating NewSQL as a silver bullet and migrating schemas without redesigning key strategy.

Ignoring transaction boundaries and allowing frequent cross-shard or cross-region writes.

Comparing engines only with synthetic benchmarks, without failure and rebalance behavior.

Choosing distributed SQL when single-node OLTP already satisfies workload and SLA.

References

Related chapters

Enable tracking in Settings