← Lessons

quiz vs the machine

Silver1100

Databases

YugabyteDB Design

A document store core that powers both SQL and Cassandra style APIs.

4 min read · intro · beat Silver to climb

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.

Check yourself

Answer to earn rating on the learn ladder.

1. What is the shared storage core of YugabyteDB called?

2. How does YSQL achieve PostgreSQL compatibility?