Two APIs One Core
YugabyteDB exposes two query layers over a shared storage engine. YSQL is PostgreSQL compatible and YCQL is Cassandra compatible. Both sit on top of a distributed document store called DocDB.
DocDB
DocDB is the heart of the system.
- It is a sharded, replicated key to document store.
- Shards called tablets are spread across nodes.
- Each tablet is replicated with Raft for consistency and failover.
- Storage uses an LSM tree engine derived from RocksDB.
Why Reuse PostgreSQL
YSQL reuses the upper half of real PostgreSQL code for the parser and planner, then swaps the storage layer for DocDB. This gives strong PostgreSQL compatibility while gaining horizontal scale and automatic replication that single node PostgreSQL lacks.
Key idea
YugabyteDB layers a PostgreSQL compatible and a Cassandra compatible API over one Raft replicated document store, blending familiar interfaces with horizontal scale.