docs/content/stable/architecture/design-goals.md
YugabyteDB scales out horizontally by adding more nodes to handle increasing data volumes and higher workloads. With YugabyteDB, you can also opt for vertical scaling choosing more powerful infrastructure components.
{{<lead link="../../explore/linear-scalability/">}} Scalability {{</lead>}}
YugabyteDB ensures continuous availability, even in the face of individual node failures or network partitions. YugabyteDB achieves this by replicating data across multiple nodes and implementing failover mechanisms via leader election.
{{<lead link="../../explore/fault-tolerance/">}} High Availability {{</lead>}}
YugabyteDB is resilient to various types of failures, such as node crashes, network partitions, disk failures, and other hardware or software faults and failure of various fault domains. It can automatically recover from these failures without data loss or corruption.
{{<lead link="../../explore/fault-tolerance/">}} Fault tolerance {{</lead>}}
YugabyteDB supports distributed transactions while offering strong consistency guarantees (ACID) in the face of potential failures. For more information, see the following:
YugabyteDB supports single-row linearizable writes. Linearizability is one of the strongest single-row consistency models, and implies that every operation appears to take place atomically and in some total linear order that is consistent with the real-time ordering of those operations. In other words, the following is expected to be true for operations on a single row:
YugabyteDB supports multi-row transactions with three isolation levels: Serializable, Snapshot (also known as repeatable read), and Read Committed isolation.
SERIALIZABLE, REPEATABLE READ, and READ COMMITTED respectively. For more details, see Isolation levels.In terms of the CAP theorem, YugabyteDB is a consistent and partition-tolerant (CP) database which achieves very high availability at the same time. The architectural design of YugabyteDB is similar to Google Cloud Spanner, another CP system. The description of Spanner is also applicable to YugabyteDB. The key takeaway is that no system provides 100% availability, so the pragmatic question is whether or not the system delivers sufficient high availability that most users no longer have to be concerned about outages. For example, given that there are many sources of outages for an application, if YugabyteDB is an insignificant contributor to its downtime, then users are correct not to worry about it.
Split-brain is a computing scenario in which data and availability inconsistencies arise when a distributed system incurs a network partition. For YugabyteDB, when a network partition occurs, the remaining (majority for write acknowledgment purposes) Raft group peers elect a new tablet leader. YugabyteDB implements leader leases, which ensures that a single tablet leader exists throughout the entire distributed system including when network partitions occur. Leader leases have a default value of two seconds and can be configured to use a different value. This architecture ensures that YugabyteDB's distributed database is not susceptible to the split-brain condition.
YugabyteDB splits table data into smaller pieces called tablets and distributes these tablets across different nodes in the cluster for better performance, availability, and resiliency. YugabyteDB automatically re-balances the number of tablets on each node as the cluster scales.
YugabyteDB monitors and automatically re-balances the number of tablet leaders and followers on each node continuously. This leads to the distribution of reads and writes across multiple nodes avoiding hot-spots and ensuring efficient resource utilization.
YugabyteDB supports colocated tables and databases which enables related data to be kept together on the same node for performance reasons.
{{<lead link="../../additional-features/colocation/">}} Colocating tables {{</lead>}}
YugabyteDB supports robust security measures, such as authentication, authorization, encryption at rest, encryption in transit, and auditing capabilities.
YugabyteDB has been designed with operational simplicity in mind, providing features like automated deployment, configuration management, monitoring, and self-healing capabilities to reduce operational overhead.
Depending on the use case, the database may need to support diverse workloads, such as transactional processing, analytical queries, real-time data ingestion, time-series, and key-value workloads.
Transaction isolation is foundational to handling concurrent transactions in databases. YugabyteDB supports three strict transaction isolation levels in YSQL.
In YCQL, it supports only Snapshot isolation using the BEGIN TRANSACTION syntax.
YSQL is a fully relational SQL API that is wire-compatible with the SQL language in PostgreSQL. It is best fit for RDBMS workloads that need horizontal write scalability and global data distribution, while also using relational modeling features such as joins, distributed transactions, and referential integrity (such as foreign keys). Note that YSQL reuses the native query layer of the PostgreSQL open source project.
In addition:
New changes to YSQL do not break existing PostgreSQL functionality.
YSQL is designed with migrations to newer PostgreSQL versions over time as an explicit goal. This means that new features are implemented in a modular fashion in the YugabyteDB codebase to enable rapid integration with new PostgreSQL features as an ongoing process.
YSQL supports wide SQL functionality, such as the following:
YCQL is a semi-relational CQL API that is best suited for internet-scale OLTP and HTAP applications needing massive write scalability and fast queries. YCQL supports distributed transactions, strongly-consistent secondary indexes, and a native JSON column type. YCQL has its roots in the Cassandra Query Language.
{{<lead link="../query-layer/">}} Query layer {{</lead>}}
Written in C++ to ensure high performance and the ability to use large memory heaps (RAM) as an internal database cache, YugabyteDB is optimized primarily to run on SSDs and Non-Volatile Memory Express (NVMe) drives. To handle ever-growing event data workload characteristics in mind, YugabyteDB ensures the following:
{{<lead link="../docdb/performance/">}} High performance in YugabyteDB {{</lead>}}
YugabyteDB supports Row Level Geo-Partitioning of tables. This enables a specific row to be placed in a specific geography. It leverages two PostgreSQL features, Table partitioning and Tablespaces to accomplish this elegantly.
YugabyteDB is a cloud-native database, and can be deployed out of the box in most public cloud services like AWS, GCP, and Azure. YugabyteDB also supports a mult-cloud deployment which enables a cluster to be spread across different cloud providers.
YugabyteDB has been designed with several cloud-native principles in mind.
YugabyteDB works natively in Kubernetes and other containerized environments as a stateful application. {{<link dest="../../deploy/kubernetes/">}}
{{<lead link="../../deploy/kubernetes/">}} Deploy in Kubernetes {{</lead>}}
YugabyteDB is 100% open source under the very permissive Apache 2.0 license. The source code is available on GitHub.