DBDB.io The Encyclopedia of Database Systems · Est. 2017
Database of Databases

Database Entry

YugabyteDB


YugabyteDB is a high-performance transactional distributed SQL database for cloud-native and geo-distributed applications. YugabyteDB is consistent and partition tolerant. It supports distributed ACID transactions, auto-sharding, and auto-balancing. Besides PostgreSQL-compatible SQL API, it supports the Apache Cassandra Query Language (CQL). [05][06][07][08][09]

Source Code
https://github.com/yugabyte/yugabyte-db[02]
Twitter
@Yugabyte
Developer
Country of Origin
US
Start Year
2016 [29]
Project Types
Commercial, Open Source
Written in
C++
Supported Languages
C, C#, C++, Go, Java, JavaScript, Python
Derived From
PostgreSQL, RocksDB
Inspired By
Cloud Spanner
Compatible With
Cassandra, PostgreSQL, Redis
Operating Systems
Linux, macOS
License
Apache v2

YugabyteDB uses a customized version of RocksDB, called DocDB, as its underlying distributed storage engine. DocDB is a log-structured merge-tree (LSM) based "key to object/document" store.

Database Entry

YugabyteDB


YugabyteDB is a high-performance transactional distributed SQL database for cloud-native and geo-distributed applications. YugabyteDB is consistent and partition tolerant. It supports distributed ACID transactions, auto-sharding, and auto-balancing. Besides PostgreSQL-compatible SQL API, it supports the Apache Cassandra Query Language (CQL).

YugabyteDB uses a customized version of RocksDB, called DocDB, as its underlying distributed storage engine. DocDB is a log-structured merge-tree (LSM) based "key to object/document" store.[05][06][07][08][09]

History[10][11]


YugabyteDB's first public beta release came out in November 2017. It was initially developed by the former team that built and ran Facebook's NoSQL platform that supported a number of Facebook's real-time applications. They left Facebook and founded Yugabyte Inc., aiming to build a distributed SQL database for mission-critical applications.

Checkpoints[06]


Compression[12][13][14]


Relying on RocksDB, YugabyteDB's storage engine is responsible for converting every supported data formats (i.e., documents, CQL rows) to key-value pairs and storing them in RocksDB. How data compression is accomplished in YugabyteDB depends on how it is done in RocksDB, which uses Dictionary Compression.

Concurrency Control[15][16]


YugabyteDB uses MVCC and a variant of OCC for concurrency control (as of March 2022, the pessimistic concurrency control was in active development). Under a distributed environment, it uses Two-Phase Commit with Early Acknowledgement. When a transaction wants to modify a number of rows, it first writes "provisional" records of each modified row into the target tablet storing the row. These records cannot be seen by the client unless the transaction commits. If conflicts occur when writing these records, the transaction will restart and abort. Otherwise, the transaction commits and notifies success to the client. After that, the "provisional" records are applied and cleaned asynchronously.

Data Model[06]


YugabyteDB's storage engine, DocDB, is based on RocksDB. Unlike RocksDB, DocDB is a "key to object/document" store instead of a "key to value" store. Values in DocDB can be primitive types as well as object types (e.g., lists, sorted sets, and sorted maps) with arbitrary nesting.

Foreign Keys[12]


Foreign keys can be created with the CREATE TABLE and ALTER TABLE commands.

Indexes[17]


YugabyteDB supports log-structured merge-tree (LSM) and generalized inverted (GIN) indexes. These indexes are based on YugabyteDB's DocDB storage and are similar in functionality to PostgreSQL's btree and gin indexes, respectively.

Isolation Levels[18]


Joins[19][20][21][22]


YugabyteDB SQL API supports the following types of joins: cross join, inner join, right outer join, left outer join, and full outer join.

YugabyteDB uses the following join algorithms: Nested Loop Join, Hash Join, Sort-Merge Join.

Logging[06]


YugabyteDB uses the Raft distributed consensus algorithm for replication, so all the changes to the database will be recorded in Raft logs, which can be used during recovery.

Query Interface[23]


YSQL is a PostgreSQL code-compatible API based around v11.2. YSQL is accessed via standard PostgreSQL drivers using native protocols. It exploits the native PostgreSQL code for the query layer and replaces the storage engine with calls to the pluggable query layer.

YCQL is a Cassandra-like API based around v3.10 and re-written in C++. YCQL is accessed via standard Cassandra drivers using the native protocol port of 9042. In addition to the 'vanilla' Cassandra components, YCQL is augmented with the following features: - Transactional consistency - unlike Cassandra, Yugabyte YCQL is transactional. - JSON data types supported natively - Tables can have secondary indexes

Storage Architecture[24]


YugabyteDB is a disk-oriented database management system. However, as its storage engine is implemented as a log-structured merge-tree (LSM), some of the data will be stored in memory before flushed out to disk.

Storage Format


Storage Model[06][25]


YugabyteDB's storage model depends on RocksDB, which uses Static Sorted Table (SST) format.

Storage Organization[06]


Same as RocksDB

YugabyteDB's storage engine relies on RocksDB, which is implemented as a log-structured merge-tree (LSM).

Stored Procedures[26]


System Architecture[27]


YugabyteDB uses shared-nothing system architecture. A table will be split into multiple tablets. Depending on the replication factor, each tablet has its corresponding number of replicas (tablet peers) across different nodes.

Views[28]


YugabyteDB supports non-materialized views in its YSQL API.

Citations

32 sources
  1. YugabyteDB: AI-Ready, Distributed, Postgres-Compatible Database yugabyte.com
  2. GitHub - yugabyte/yugabyte-db: YugabyteDB - the cloud native distributed SQL database for mission-critical applications. · GitHub github.com
  3. YugabyteDB | YugabyteDB Docs yugabyte.com
  4. YugabyteDB - Wikipedia wikipedia.org
  5. YugabyteDB FAQS | YugabyteDB Docs yugabyte.com
  6. https://docs.yugabyte.com/stable/architecture/concepts/persistence yugabyte.com Dead — Check Archive
  7. Learn application development | YugabyteDB Docs yugabyte.com
  8. https://docs.yugabyte.com/stable/introduction/core-features yugabyte.com Dead — Check Archive
  9. YugabyteDB: High-Performing Distributed SQL Database yugabyte.com
  10. About Yugabyte and YugabyteDB—the Distributed SQL Database yugabyte.com
  11. YugabyteDB Has Arrived yugabyte.com
  12. DocDB data model | YugabyteDB Docs yugabyte.com
  13. Compression · facebook/rocksdb Wiki · GitHub github.com
  14. https://docs.yugabyte.com/stable/architecture/concepts/persistence#encoding-details yugabyte.com Dead — Check Archive
  15. Fundamentals of Distributed Transactions | YugabyteDB Docs yugabyte.com
  16. https://docs.yugabyte.com/stable/architecture/transactions/explicit-locking#pessimistic-concurrency-control yugabyte.com Dead — Check Archive
  17. Indexes | YugabyteDB Docs yugabyte.com
  18. Isolation levels | YugabyteDB Docs yugabyte.com
  19. Explore YSQL, the Yugabyte SQL API | YugabyteDB Docs yugabyte.com
  20. YSQL Architecture: Implementing Distributed SQL in YugabyteDB | Yugabyte yugabyte.com
  21. Reading data | YugabyteDB Docs yugabyte.com
  22. PostgreSQL: Documentation: 10: 50.5. Planner/Optimizer postgresql.org
  23. YugabyteDB API reference (for YSQL and YCQL) | YugabyteDB Docs yugabyte.com
  24. Key concepts | YugabyteDB Docs yugabyte.com
  25. A Tutorial of RocksDB SST formats · facebook/rocksdb Wiki · GitHub github.com
  26. Stored procedures | YugabyteDB Docs yugabyte.com
  27. Key concepts | YugabyteDB Docs yugabyte.com
  28. Explore YSQL, the Yugabyte SQL API | YugabyteDB Docs yugabyte.com
  29. https://www.crunchbase.com/organization/yugabyte crunchbase.com
  30. https://github.com/yugabyte/yugabyte-db/commit/a4ec574c19aa6e9c8648e8ced1f4ca4fc5fec5ed github.com
  31. https://github.com/yugabyte/yugabyte-db/commit/57706dd4e02de37ed0f2a18edd9ce2c00bb0b8a3 github.com
  32. https://github.com/yugabyte/yugabyte-db/commit/48dbf4564442d141c29331f635b5cf561c17998e github.com
Revision #30 Last Updated: