YDB glossary
- Key terminology
- Cluster
- Database
- Node
- Distributed storage
- Storage group
- Storage pool
- Actor
- Tablet
- Transactions
- Implicit Transactions
- Interactive transactions
- Sessions
- Client-side timeout
- Implicit transactions
- Multi-version concurrency control
- Streaming queries
- Streaming query checkpoints
- Topology
- Table
- View
- Topic
- Change data capture
- Backup collection
- Asynchronous replication instance
- Async replication instance
- Transfer instance
- Coordination node
- Resource pool
- Resource pool classifier
- YQL
- Federated queries
- Auth token
- Cluster scheme
- Database scheme
- Database root
- Scheme root
- Scheme object
- Folder
- Access object
- Access subject
- Access right
- Access right inheritance
- Permissions list
- Access level
- Access level list
- Owner
- User
- Group
- Role
- SID
- Query optimizer
- Compilation cache
- Advanced Terminology
- Actor Implementation
- Tablet Implementation
- Tablet Leader
- Tablet candidate
- Tablet follower
- Tablet generation
- Tablet local database
- Shared cache
- Memory controller
- Spilling
- Tablet types
- Slot
- State storage
- Board
- SchemeBoard
- Distributed configuration
- Distributed storage implementation
- Distributed transactions implementation
- Global schema
- KiKiMR
This article is an overview of terms and definitions used in YDB and its documentation. It starts with key terms that will be useful to get acquainted with early when you start working with YDB, while the rest of it is more advanced and might be helpful later on.
Key terminology
This section describes terms that are useful to anyone working with YDB, regardless of their role or use case.
Cluster
A cluster YDB is a set of interconnected nodes YDB that exchange data to execute user queries and ensure reliable data storage. These nodes form one of the supported cluster topologies, which directly affects its reliability and performance characteristics.
Clusters YDB are multi-tenant and can contain several isolated databases.
Database
Like in most database management systems, a database in YDB is a logical container for other entities like tables. However, in YDB, the namespace inside databases is hierarchical like in virtual file systems, and thus folders allow for further organization of entities.
Another essential characteristic of YDB databases is that they typically have dedicated compute resources allocated to them. Hence, creating a database requires additional operations from DevOps engineers.
Node
YDB A node is a server process that runs an executable called ydbd. Multiple nodes YDB can run on a single physical server or virtual machine, which is common practice. Thus, in the context of YDB, nodes are not synonymous with hosts.
Since YDB uses an approach with separate storage and compute layers (storage and compute separation), ydbd has several operation modes that define the node type. The available node types are described below.
Database node
Database nodes (also known as tenant nodes or compute nodes) process user queries addressed to a specific logical database. Their state is stored only in RAM and can be restored from distributed storage. The set of database nodes of a given cluster YDB can be considered the compute layer of that cluster. Thus, adding database nodes and allocating additional resources (CPU and RAM) to them are the main ways to increase the compute resources of a database.
The main role of database nodes is to run various tablets and actors, as well as accept incoming requests via various endpoints.
Storage node
Storage nodes are stateful nodes responsible for long-term storage of data fragments. The set of storage nodes in a given cluster YDB is called distributed storage and can be considered as the storage layer of that cluster. Thus, adding additional storage nodes and their disks is the primary way to increase the storage capacity and I/O throughput of the cluster.
Hybrid node
A Hybrid node is a process that simultaneously performs both the roles of a database node and a storage node. Hybrid nodes are often used for development purposes. For example, you can run a container with a full-featured YDB containing only one ydbd process in hybrid mode. They are rarely used in production environments.
Static node
Static nodes are configured manually during initial cluster initialization or reconfiguration. Typically, they serve as storage nodes, but they can technically be configured as database nodes.
Dynamic node
Dynamic nodes are added and removed from the cluster on the fly. They can only act as database nodes.
Distributed storage
Distributed storage, Blob storage, or BlobStorage is a distributed fault-tolerant data persistence layer of YDB. It has a specialized API designed for storing immutable pieces of tablet's data.
Multiple terms related to the distributed storage implementation are covered below.
Storage group
Storage group, distributed storage group, or Blob storage group is a place for reliable data storage, similar to RAID, but using disks from multiple servers. Depending on the selected cluster topology, storage groups use different algorithms to ensure high availability, similar to standard RAID levels.
Distributed storage typically manages a large number of relatively small storage groups. Each group can be assigned to a specific database to increase the disk space capacity and I/O throughput available to that database.
Static and dynamic storage groups are physical, meaning their data is placed directly on VDisks.
Static group
A static group is a special storage group created during the initial deployment of the cluster. Its main role is to store data of system tablets, which can be considered as cluster-level metadata.
A static group might require special attention during major maintenance, such as decommissioning an availability zone.
Dynamic group
Ordinary storage groups that are not static are called dynamic groups. They are called dynamic because they can be created and removed on the fly while the cluster is running.
Virtual storage group
A virtual storage group is an entity that is not actually a storage group but appears as one from the outside (provides a similar external interface). It can store its data in other storage groups or in S3.
Storage pool
A storage pool is a set of data storage devices with similar characteristics. Each storage pool is assigned a unique name within the YDB cluster. Technically, each storage pool consists of multiple physical disks ( PDisk). Each storage group is created in a specific storage pool, which determines the performance characteristics of the storage group through the selection of appropriate storage devices. Typically, separate storage pools are created for devices of different types (e.g., NVMe, SSD, and HDD) or for specific models of these devices with different capacity and access speed.
Actor
The Actor model is one of the main approaches to execution parallelism used in YDB. In this model, actors are lightweight user-space processes that can have and modify their private state, but can only influence each other indirectly through message passing. YDB has its own implementation of this model, which is described below.
In YDB, actors with the reliably persisted state are called tablets.
Tablet
A tablet is one of the main building blocks and abstractions of YDB. It represents an entity responsible for a relatively small segment of user or system data. Typically, a tablet manages up to several gigabytes of data, although some types of tablets can handle larger volumes.
For example, a row-oriented user table is managed by one or more DataShard tablets, with each tablet responsible for a continuous range of primary keys and the corresponding data.
End users sending queries to a YDB cluster aren't expected to know much about tablets, their kinds, or how they work, but it might still be helpful, for example, for performance optimizations.
Technically, tablets are actors with state reliably stored in distributed storage. This state allows a tablet to continue operating on a different database node if the previous one fails or becomes overloaded.
Tablet implementation details and related terms, as well as main tablet types, are covered below in the advanced section.
Transactions
YDB implements transactions on two main levels:
- Local database and the rest of the tablet infrastructure allow tablets to manipulate their state using local transactions with serializable isolation level. Technically, they are not local to a single node, since this state is stored remotely in distributed storage.
- In the context of YDB, the term distributed transactions usually refers to transactions that span multiple tablets. For example, transactions between tables or even rows of the same table are often distributed.
- Single-shard transactions cover one tablet and execute faster. For example, transactions between rows of the same table partition are often single-shard.
Together, these mechanisms allow YDB to provide strict consistency.
The implementation of distributed transactions is covered in a separate article DataShard: distributed transactions, while below there's a list of several related terms.
Implicit Transactions
An implicit transaction is the query execution mode used when the transaction mode is not specified. YDB automatically determines the behavior for each statement — whether to wrap it in a transaction or execute it outside one. This mode is described in more detail in Implicit Transactions.
Interactive transactions
The term interactive transactions refers to transactions that are split into multiple queries and involve data processing by an application between these queries. For example:
- Select some data.
- Process the selected data in the application.
- Update some data in the database.
- Commit the transaction in a separate query.
Sessions
Logical connections to the database that store the context needed for executing queries and managing transactions. Sessions are described in more detail in the section Sessions.
Client-side timeout
Client-side timeout — a time limit that an application or YDB SDK waits for a database operation to complete (for example, executing a query or receiving a response via a gRPC call). After this time expires, the client usually aborts the wait: closes the connection or data stream, receives a transport or SDK error — even before the server has returned an explicit response (see YDB server response codes).
If the client-side timeout is shorter than the query execution time on the YDB side, then due to the specifics of query processing in the cluster, a query interrupted on the client side may continue to execute on the server for some time. If this situation occurs on a large scale, the server becomes overloaded with queries for which the client is not waiting for a response. Therefore, frequent retries of the same query immediately after a timeout can exacerbate the overload. Retry policies in the SDK are described in the section Handling errors.
Implicit transactions
Implicit transaction is a query execution mode in which the transaction mode is not specified. In this case, YDB independently determines whether to wrap them in a transaction. This mode is described in more detail in Implicit Transactions.
Multi-version concurrency control
Multi-version concurrency control, multi-version concurrency control or MVCC is a method used by YDB for concurrent access of multiple parallel transactions to the database without interfering with each other. It is described in more detail in a separate article Multi-Version Concurrency Control (MVCC).
Streaming queries
A type of query designed for stream processing of an unbounded data stream. Unlike regular queries, streaming queries have no restrictions on execution duration, automatically restart on errors, and periodically save their state as checkpoints to ensure fault tolerance.
Streaming queries are described in more detail in Streaming queries.
Streaming query checkpoints
A periodically saved state of a streaming query, necessary for automatically restoring its operation after failures in a distributed system. For more details about checkpoints, see the article Checkpoints.
Topology
YDB supports several topologies of a cluster (or topology), described in more detail in a separate article YDB Cluster Topology. Below, several related terms are explained.
Availability zones and regions
An availability zone is a data center or an isolated segment thereof with minimal physical distance between nodes and minimal risk of failure at the same time as other availability zones. Thus, availability zones are expected not to share any infrastructure like power, cooling, or external network connections.
A region is a large geographic area containing several availability zones. The distance between availability zones in one region should be about 500 km or less. YDB performs data writes to each availability zone in the region synchronously, ensuring reasonable latency and uninterrupted operation in case of failure of one of the availability zones.
Rack
A rack or server rack is equipment used to organize the placement of multiple servers. Servers in the same rack are more likely to become unavailable simultaneously due to rack-level issues related to power supply, cooling, etc. YDB can take into account information about which server is in which rack when placing each data fragment in environments based on physical servers.
Pile
A Pile is a set of nodes that can fail or be shut down simultaneously while maintaining the operability of other parts of the cluster (pile). A Pile can remain operational when other cluster nodes are shut down. Piles are used in bridge mode to split the cluster into several parts between which synchronous replication is performed. A Pile can consist of nodes from one or more regions.
Bridge mode
Bridge mode is a special cluster topology in which data is stored with synchronous replication between several piles. The features of this mode are described in Bridge mode and also in Bridge cluster operation mode.
Table
A table is a structured piece of information arranged in rows and columns. Each row represents a single record or entry, while each column represents a specific attribute or field with a particular data type.
There are two main approaches to representing tabular data in memory or on disks: row-based (row by row) and column-based (column by column). The chosen approach greatly affects the performance characteristics of operations on this data: the former is more suitable for transactional workloads (OLTP), and the latter for analytical workloads (OLAP). YDB supports both approaches.
Row-oriented table
Row-oriented tables store data for all or most columns of a given row physically close to each other. They are explained in more detail in Row-Oriented Tables.
Column-oriented table
Column-oriented tables or columnar tables store data for each column separately. They are optimized for building aggregates over a small number of columns, but are less suitable for accessing specific rows, as rows need to be reconstructed from their cells on the fly. They are described in more detail in Column-Oriented Tables.
Primary key
A primary key is an ordered list of columns, the values of which uniquely identify rows. It is used to build the table's primary index. It is provided by the YDB user during table creation and dramatically impacts the performance of workloads interacting with that table.
Guidance on choosing primary keys is provided in Choosing a primary key.
Primary index
Primary index or primary key index is the main data structure used to find rows in a table. It is created based on the selected primary key and determines the physical order of rows in the table; thus, each table can have only one primary index. The primary index is unique.
Secondary index
A secondary index is an additional data structure used to find rows in a table, typically when this cannot be done efficiently using the primary index. Unlike a primary index, secondary indexes are managed independently of the table's main data. Thus, a table can have multiple secondary indexes for different scenarios. The capabilities of YDB regarding secondary indexes are described in a separate article Secondary indexes. A secondary index can be either unique or non-unique.
Special types of secondary indexes include vector index, full-text index, and JSON index.
Vector Index
Vector index is an additional data structure used to speed up the solution of the vector search problem when there is a lot of data and exact vector search without an index does not work satisfactorily.
The capabilities of YDB for approximate nearest neighbor search (ANN search) using vector indexes are described in a separate article Vector Indexes.
A vector index is a specialized type of secondary index designed for similarity search, as opposed to traditional secondary indexes optimized for equality or range search.
Fulltext index
Full-text index is an additional data structure used to speed up text search on a table column (by words and phrases, and when using N-grams, also by substrings).
The features of full-text search and index parameters are described in the articles Fulltext Indexes and Fulltext search.
JSON-index
JSON index is an additional data structure used to speed up predicates with the JSON_EXISTS and JSON_VALUE functions on a column of type Json or JsonDocument. Unlike traditional secondary indexes, which are optimized for equality or range searches on individual table columns, the JSON index works with arbitrary JsonPath paths within a JSON document.
A JSON index, like a full-text index, is built on top of an inverted index, but uses its own JSON document tokenizer. JSON search capabilities are described in the articles JSON indexes and Searching JSON document contents.
Local index
A local index is an auxiliary structure stored together with table data (unlike a global secondary index, which materializes a separate index table). It is applied while reading the main table in storage. See local indexes.
Bloom filter
A Bloom filter is a probabilistic data structure that allows you to quickly check whether an element belongs to a set. False positives are possible, but false negatives are not.
Local bloom index
A local Bloom index is a special case of a local index: a probabilistic filter on column values based on a Bloom filter that speeds up selective queries by skipping data fragments where the searched value is guaranteed to be absent. For more information, see Bloom indexes and local indexes.
Column family
Column family or column group is a feature that allows storing subsets of columns of a row table separately in a family or group. The main use case is storing some columns on other disk types (moving less important columns to HDD) or with different compression settings. If the workload requires many column families, consider using column tables.
Column encoding
Column encoding is a data storage optimization mechanism for table columns that reduces disk space usage and speeds up some operations.
Time to live
Time to live or TTL is a mechanism for automatically removing old rows from a table asynchronously in the background. It is explained in a separate article Time to Live (TTL) and Eviction to External Storage.
View
View is a way to save a query and access its results as if they were a real table. The view itself does not store any data except the query text. The query stored in the view is executed each time a SELECT is performed on it, generating the returned result. Any changes to the tables referenced by the view are immediately reflected in the read results.
There are user-defined and system-defined views.
Views can be user-defined or system.
User-defined views
User-defined views are created by the user using the CREATE VIEW command. They are described in more detail in View.
System views
System views are special views automatically created by the system for monitoring the state of the database and cluster. They are located in a special directory .sys in the root folder of each database. System views for databases are described in System database views; system views for the cluster and access management issues are described in Cluster System Views.
Topic
Message queue is used for reliable asynchronous communication between different systems by passing messages. YDB provides infrastructure that ensures exactly-once semantics in such communications. Using it, you can guarantee no lost messages or accidental duplicates.
Topic is a named entity in a message queue for interaction between writers and readers.
Several terms related to topics are listed below. How topics work in YDB is explained in more detail in a separate article Topic.
Partition
For horizontal scaling, topics are divided into separate elements called partitions. Thus, partitions are the unit of parallelism within a topic. Messages within each partition are ordered.
However, subsets of data managed by a single data shard or column shards can also be called partitions.
Offset
Offset is a sequence number that identifies a message within a partition.
Producer
Writer or producer is an entity that writes new messages to a topic.
Consumer
Reader or consumer is an entity that reads messages from a topic.
Change data capture
Change data capture or CDC is a mechanism that allows subscribing to a change feed for a specific table. Technically, it is implemented on top of topics. It is described in more detail in a separate article Change Data Capture (CDC).
Change feed
Change feed is an ordered list of changes to a table placed in a topic.
Backup collection
Backup collection is a schema object that organizes full and incremental backups for selected row tables. Collections provide point-in-time recovery by maintaining backup chains and ensuring consistent recovery of multiple tables. A table can belong to only one backup collection at a time.
For more information, see Backup Collection.
Backup
Backup is a copy of data at a specific point in time that can be used for data recovery. In the context of backup collections, there are two types:
- Full backup: A complete snapshot of all data in the collection. It serves as the basis for backup chains and can be restored independently.
- Incremental backup: Captures only changes (inserts, updates, deletes) since the previous backup. Requires the entire backup chain for restoration.
Backup chain
Backup chain is an ordered sequence of backups starting with a full backup followed by zero or more incremental backups. Each incremental backup depends on all previous backups in the chain. Deleting any backup in the chain makes subsequent incremental backups unrecoverable.
Asynchronous replication instance
Async replication instance
Async replication instance is a named entity that stores async replication settings (connection settings, list of replicated objects, etc.). It can also be used to obtain information about the async replication status: initial scan progress, lag, errors, etc.
Replicated object
Replicated object is an object (for example, a table) for which async replication is configured.
Replica object
Replica object is a mirror copy of the replicated object, automatically created by the async replication instance. Typically, it is read-only.
Transfer instance
Transfer instance is a named entity that stores transfer settings, including connection settings and data transformation rules. It can also be used to obtain information about the transfer status, for example errors.
Coordination node
Coordination node is a schema object that allows client applications to create semaphores for coordinating their actions. Coordination nodes are used to implement distributed locks, service discovery, leader election, and other scenarios. For more information about coordination nodes.
Semaphore
Semaphore is an object inside a coordination node that provides a synchronization mechanism for distributed applications. Semaphores can be persistent or temporary and support create, acquire, release, and monitor operations. For more information about semaphores in YDB.
Resource pool
Resource pool is a schema object that describes the limits imposed on resources (CPU, RAM, etc.) available for executing queries in this resource pool. A query is always executed in some resource pool. By default, all queries are executed in a resource pool named default, which does not impose any limits. For more information about using resource pools, see Workload Manager — resource consumption management.
Resource pool classifier
Resource pool classifier is an object designed to manage the distribution of queries among resource pools. It describes the rules by which a resource pool is selected for each query. These classifiers are global for the entire database and apply to all queries that come into it. For more information about their usage, see Workload Manager — resource consumption management.
YQL
YQL (YDB Query Language) is a high-level language for working with the system. It is a dialect of ANSI SQL. There's a lot of content covering YQL, including a tutorial, reference, and recipes.
Federated queries
Federated queries is a feature that allows executing queries to data stored in systems external to the YDB cluster.
A few terms related to federated queries are listed below. How YDB federated queries work is explained in more detail in a separate article Federated query.
External data source
External data source or external connection is metadata describing how to connect to a supported external system to execute federated queries.
External table
External table is metadata describing a specific dataset that can be retrieved from an external data source.
Secret
Secret is confidential metadata that requires special handling. For example, secrets can be used in definitions of external data sources and represent entities such as passwords and tokens.
Auth token
Auth token is a token used for authentication in YDB.
YDB supports various authentication modes and token types.
Cluster scheme
A YDB cluster scheme is a hierarchical namespace of a YDB cluster. The top-level element of the namespace is the cluster scheme root that contains databases as its children. Scheme objects inside databases can use nested directories to form a hierarchy.
Database scheme
A database scheme is a subset of the hierarchical namespace of a YDB cluster that belongs to a database.
Database root
A database root is a path to a database in a YDB cluster scheme.
Scheme root
Cluster schema root is the root element of the YDB namespace, whose child elements are databases.
Scheme object
A database schema consists of scheme objects, which can be databases, tables (including external tables), topics, folders, and so on.
For organizational convenience, scheme objects form a hierarchy using folders.
Folder
As in file systems, a folder or directory is a container for scheme objects.
Folders can contain subfolders, and this nesting can have arbitrary depth.
Access object
An access object during authorization is an entity for which access rights and restrictions are configured. In YDB, access objects are schema objects.
Each schema object has an owner and an access control list on that object, granted to users and groups (access subjects).
Access subject
An access subject is an entity that can access access objects and perform certain actions in the system.
Gaining access during these requests and actions depends on the configured access control lists and the access level of the subject.
An access subject can be a user or a group.
Access right
An access right is an entity that represents permission for an access subject to perform a specific set of operations in a cluster or database on a specific access object.
Access right inheritance
Access rights inheritance is a mechanism where access rights granted on parent access objects are inherited by child objects in the hierarchical database structure. This ensures that permissions granted at a higher level of the hierarchy apply to all lower levels unless they are explicitly overridden.
Permissions list
access control list or ACL — a list of all rights granted to access subjects (users and groups) on a specific access object.
Access level
An access level determines additional privileges of an access subject for scheme objects as well as privileges that are not related to scheme objects.
- Database
- Viewer
- Monitoring
- Administration.
The access level for a subject is configured using access control lists.
Access level list
Access Control List or Permission List — a list of SIDs of access subjects that are allowed a certain access level.
In YDB, there are several such lists that define who has which access levels.
Detailed information about access control lists, their hierarchy, and operating principles is provided in the Access control lists section of the authorization documentation.
Owner
Owner — an access subject (user or group) that has full rights to a specific access object.
User
User — a person who uses YDB to perform a specific function.
YDB has the following types of users depending on their source:
- Local users in databases YDB.
- external users from third-party directories.
A user is identified by SID.
Local user
A local user is an individual whose YDB account is created directly in YDB using the CREATE USER command or during the initial security configuration.
External user
A user YDB whose account is created in an external directory, for example, an LDAP directory or IAM system.
Group
Group or access group - a named set of users and other groups with equal permissions for their members.
A group is identified by SID.
Role
A role is a named collection of access rights that can be granted to users or groups.
Roles in YDB are implemented using groups, which are created during the initial deployment of the cluster and are assigned a specific access rights list at the cluster schema root. For more information about roles, see the Initial cluster security configuration article.
SID
SID or security identifier — a string of the form <name> or <name>@<auth-domain> that identifies an access subject. It is used in authentication, authorization, access control lists, and access level lists.
SID identifies an individual user or group of users.
The optional suffix @<auth-domain> identifies the source of the access subject, i.e., the external directory or system from which it was obtained. For example, users or groups from an LDAP directory may have the suffix @ldap. The absence of a suffix means that the user or group was created and exists directly in YDB.
Query optimizer
Query optimizer is a set of YDB components responsible for converting the logical representation of a query into a specific physically executable plan for obtaining the requested result. The main goal of the optimizer is to select, among all possible query execution plans, one that is sufficiently efficient in terms of predicted execution time and cluster resource consumption. It is described in more detail in a separate article Query Optimization in YDB.
Compilation cache
compile cache is a cache of compiled queries on each node of the cluster. It is used to avoid recompilation: if the query text is already in the node's cache, no additional compilation is performed. For more details, see the Query Compilation Cache section.
Advanced Terminology
This section explains terms that are useful for YDB contributors and users who want to understand what happens inside the system more deeply.
Actor Implementation
Actor System
actor system is a C++ library with an implementation of the actor model for the needs of YDB.
Actor Service
actor service is an actor that has a well-known name and usually runs as a single instance on a node.
ActorId
ActorId is a unique identifier of an actor or a tablet in a cluster.
Actor System Interconnect
actor system interconnect or interconnect is the internal network layer of the cluster. All actors communicate with each other in the system via the interconnect.
Local
local is an actor service running on each node. It directly manages tablets on its node and interacts with Hive. It registers with Hive and receives commands to start tablets.
Tablet Implementation
tablet is an actor with persistent state. It includes a set of data that this tablet is responsible for and a state machine through which the tablet's data (or state) is modified. The tablet is a fault-tolerant entity because the tablet's data is stored in distributed storage, which survives disk and node failures. The tablet is automatically restarted on another node in case of failure or overload of the previous one. Data in the tablet is modified sequentially, as the system infrastructure guarantees that there is no more than one tablet leader through which tablet data changes are performed.
A tablet solves the same problem as the Paxos and Raft algorithms in other systems, namely the problem of distributed consensus. From a technical point of view, the tablet implementation can be described as a replicated state machine (RSM) on top of a shared log, since the tablet state is fully described by an ordered log of commands stored in a distributed and fault-tolerant storage.
At runtime, the tablet state machine is managed by three components:
- The common tablet part ensures log consistency and recovery in case of failures.
- executor is an abstraction of a local database, namely data structures and code that organize work with data stored by the tablet.
- An actor with user code that implements the specific logic of a particular tablet type.
In YDB, there are multiple kinds of specialized tablets storing all kinds of data for all sorts of tasks. Many YDB features like tables and topics are implemented as specific tablets. Thus, reusing tablet infrastructure is one of the key means of YDB extensibility as a platform.
Typically, a YDB cluster runs orders of magnitude more tablets compared to the processes or threads that other systems would use for a cluster of similar size. In a YDB cluster, hundreds of thousands or millions of tablets can easily run simultaneously.
Since a tablet stores its state in distributed storage, it can be (re)started on any node of the cluster. Tablets are identified by TabletID, a 64-bit number assigned when the tablet is created.
Tablet Leader
Tablet leader is the current active leader of a given tablet. The tablet leader accepts commands, assigns them an order, and confirms them to the outside world. It is guaranteed that at any given time there is at most one leader for each tablet.
Tablet candidate
Tablet candidate is one of the election participants that wants to become the leader of a given tablet. If the candidate wins the election, it becomes the tablet leader.
Tablet follower
Tablet follower or hot standby is a copy of the tablet leader that applies the command log accepted by the leader (with some delay). A tablet can have zero or more replicas. Replicas perform two main functions:
- In case of termination or failure of the leader, replicas are preferred candidates for the new leader role, as they can become the leader much faster than other candidates because they have applied most of the log.
- Replicas can answer read-only requests if the client explicitly chooses an optional relaxed transaction mode that allows stale reads.
Tablet generation
Tablet generation is a number that identifies the reincarnation of the tablet leader. It changes only when a new leader is elected and always increases.
Tablet local database
Tablet local database or local database is a set of data structures and associated code that manage the state of the tablet and the data it stores. Logically, the state of the local database is represented by a set of tables, very similar to relational tables. Modification of the local database state is performed by local tablet transactions created by the user tablet actor.
Each local database table is stored using the LSM tree data structure.
Log-structured merge-tree
Log-structured merge-tree is a data structure designed to optimize write and read performance in storage systems. It is used in YDB to store tables of the local database and data of VDisks.
MemTable
All data written to the tables of the local database is initially stored in an in-memory data structure called MemTable. When the MemTable reaches a specified size, it is flushed to disk as an immutable data structure SST.
Sorted string table
Sorted string table is an immutable data structure that stores table rows sorted by key, facilitating efficient key lookup and range scans. Each SST consists of a continuous series of small data pages, typically about 7 KiB each, which further optimizes reading data from disk. An SST is usually part of an LSM tree.
Tablet pipe
Tablet pipe or TabletPipe is a virtual connection that can be established with a tablet. It involves finding the tablet leader by TabletID. This is the recommended way to work with a tablet. The term open a pipe to a tablet describes the process of resolving (finding) a tablet in the cluster and establishing a virtual communication channel with it.
TabletID
A TabletID is a cluster-wide unique tablet identifier.
Bootstrapper
Bootstrapper is the main mechanism for starting tablets, used for system tablets (e.g., Hive, DS controller, root SchemeShard). Hive initializes the other tablets.
Shared cache
Shared cache is an actor that stores data pages recently read from distributed storage. Caching these pages reduces the number of disk I/O operations and speeds up data retrieval, improving overall system performance.
Memory controller
A memory controller is an actor that manages YDB memory limits.
Spilling
Spilling is a memory management mechanism in YDB that temporarily offloads intermediate query data to external storage when such data exceeds the available RAM of the node. In YDB, disk is currently used for spilling.
For more details on spilling, see Spilling.
Tablet types
Tablets can be considered as a framework for building reliable components operating in a distributed system. Many components of YDB — both system and those working with user data — are implemented using this framework; the main ones are listed below.
Scheme shard
A Scheme shard or SchemeShard is a tablet that stores a database schema, including metadata of user tables, topics, etc.
In addition, there is a root SchemeShard that stores information about databases created in the cluster.
Data shard
DataShard or Data shard is a tablet that manages a segment of a row-based user table. A logical user table is divided into segments by continuous ranges of the table's primary key. Each such range is managed by a separate DataShard tablet. The range itself is also called a partition. The DataShard tablet stores data row by row, which is efficient for OLTP workloads.
Column shard
A column shard or ColumnShard is a tablet that stores a data segment of a column-oriented user table.
KV Tablet
KeyValue, KV Tablet is a tablet that implements a simple key → value mapping, where keys and values are strings. It also has several specific features, such as locks.
PQ Tablet
A PQ Tablet or persistent queue tablet is a tablet that implements the concept of a topic. Each topic consists of one or more partitions, and each partition is managed by a separate PQ tablet instance.
TxAllocator
A TxAllocator or transaction allocator is a system tablet that allocates unique transaction identifiers (TxID) within the cluster. Typically, a cluster has several such tablets, from which transaction proxy pre-allocates and caches ranges for local issuance within a single process.
Coordinator
Coordinator is a system tablet that ensures global ordering of transactions. The coordinator's task is to assign a logical time PlanStep to each transaction planned through this coordinator. Each transaction is assigned exactly one coordinator, selected by hashing its TxId.
Mediator
The Mediator is a system tablet that distributes the transactions planned by coordinators to the transaction participants (usually, DataShards). Mediators ensure the advancement of global time. Each transaction participant is associated with exactly one mediator. Mediators allow to avoid the need for a full mesh of connections between all coordinators and all participants in all transactions.
Hive
Hive is a system tablet responsible for launching and managing other tablets. Its responsibilities include moving tablets between nodes in case of failure or overload of a node. For more details about Hive, see the dedicated article.
Cluster management system
CMS or cluster management system is a system tablet responsible for managing information about the current state of the YDB cluster. This information is used for performing rolling restarts of the cluster without affecting user workloads, maintenance, cluster reconfiguration, etc.
Node Broker
NodeBroker is a system tablet that is responsible for registering dynamic nodes in the cluster.
BSController
BSController (also known as blob storage controller) manages the dynamic configuration of the distributed storage, including information about PDisk, VDisk, and storage groups. It interacts with node warden to start various distributed storage components. It interacts with Hive to allocate channels to tablets.
Console
Console is a system tablet responsible for storing the dynamic configuration and delivering it to cluster nodes.
Kesus
Kesus is a tablet that implements a coordination node.
SysViewProcessor
SysViewProcessor is a tablet that stores data for some of the system views.
SequenceShard
SequenceShard is a tablet that serves Sequence objects, which are used to implement serial data types.
ReplicationController
ReplicationController is a tablet responsible for the asynchronous replication process.
StatisticsAggregator
StatisticsAggregator is a tablet responsible for collecting statistics used in cost optimization.
Slot
A slot in YDB can be used in two contexts:
- Slot is a portion of server resources allocated to run one node of YDB. A typical slot size is 10 CPU cores and 50 GB of RAM. Slots are used when the YDB cluster is deployed on servers or virtual machines with sufficient resources to host multiple slots.
- VDisk slot or VSlot is a portion of a PDisk that can be allocated to one of the VDisk instances.
State storage
State storage (also known as StateStorage) is a distributed service that stores information about tablets, namely:
- The current leader of the tablet or its absence.
- Tablet followers.
- Generation and step of the tablet
(generation:step).
State storage is used as a service for resolving tablet names, i.e., to obtain an ActorId from a TabletID. StateStorage is also used in the tablet leader election process.
The information in the state storage is volatile. Thus, it is lost on power failure or process restart. Despite its name, this service is not a permanent long-term storage. It only contains information that is easy to recover and that does not need to be durable. However, the state storage stores information on multiple nodes to minimize the impact of node failures. This service can also be used to gather a quorum, which is used for tablet leader election.
Due to its nature, the state storage service operates on a best-effort basis. For example, the absence of multiple tablet leaders is guaranteed through the leader election protocol on the distributed storage, not on the state storage.
Board
Board is a distributed service designed to store metadata as key-value pairs. It is used, among other things, to store information about endpoints.
SchemeBoard
SchemeBoard is a distributed service designed to store metadata as key-value pairs. It is used, among other things, to store information about schemas.
Compaction
Compaction is the internal background process of rebuilding LSM tree data. The data in VDisks and local databases are organized in the form of an LSM tree. Therefore, there is a distinction between VDisk compaction and Tablet compaction. The compaction process is usually quite resource-intensive, so efforts are made to minimize the overhead associated with it, for example, by limiting the number of concurrent compactions.
gRPC proxy
gRPC proxy — a proxy system for external user requests. Client requests enter the system via the gRPC protocol, then the proxy component translates them into internal calls to execute these requests, transmitted via interconnect. This proxy provides an interface for both request-response and bidirectional streaming data.
Distributed configuration
Distributed configuration or DistConf — an internal mechanism of cluster configuration that ensures the startup and configuration of static nodes, automatic management of the static storage group and State Storage. Distributed configuration starts before any tablets, storage groups, or State Storage.
For more on how distributed configuration works, see Internals of the V2 configuration mechanism.
Distributed storage implementation
Distributed storage — a distributed fault-tolerant data storage layer that stores binary records called LogoBlob, addressed by a specific type of identifier called LogoBlobID. Thus, Distributed storage is a key-value store that maps a LogoBlobID to a string of up to 10 MB. Distributed storage consists of many storage groups, each of which is an independent data repository.
Distributed storage stores immutable data, with each immutable data block identified by a specific LogoBlobID key. The Distributed storage API is very specific, intended only for use by tablets to store their data and change logs. Thus, it is not intended for general-purpose data storage. Data in Distributed storage is deleted using special barrier commands. Due to the absence of mutations in its interface, Distributed storage can be implemented without implementing distributed consensus. Distributed storage is just one of the components that tablets use to implement distributed consensus.
LogoBlob
LogoBlob — a set of binary immutable data, identified by LogoBlobID and stored in Distributed storage. The data block size is limited at the VDisk level and above in the stack. Currently, the maximum data block size that a VDisk can handle is 10 MB.
LogoBlobID
LogoBlobID — an identifier of a LogoBlob in Distributed storage. It has a structure of the form [TabletID, Generation, Step, Channel, Cookie, BlobSize, PartID]. The main elements of LogoBlobID:
TabletID— the ID of the tablet that owns the LogoBlob.Generation— the generation of the tablet in which the data block was written.Channel— the channel of the tablet on which the LogoBlob is written.Step— an incremental counter, usually within the tablet generation.Cookie— a unique identifier of a data block within a singleStep. Cookie is typically used when writing multiple data blocks into oneStep.BlobSize— the size of the LogoBlob.PartID— the identifier of a data block part. It is important when the original LogoBlob is split into parts using erasure coding, and the parts are written to the corresponding VDisk and storage groups.
Replication
Replication — a process that ensures a sufficient number of copies (replicas) of data to maintain the desired availability characteristics of the cluster YDB. Typically used in geo-distributed clusters YDB.
Erasure Coding
Erasure coding is a data encoding method where the original data is supplemented with redundancy and split into multiple fragments, enabling recovery of the original data if one or more fragments are lost. It is widely used in clusters YDB with a single availability zone, as opposed to replication with 3 replicas. For example, the most popular erasure coding scheme 4+2 provides the same reliability as three replicas, with a space overhead of 1.5 versus 3.
PDisk
PDisk, physical disk is a component that controls a physical disk drive (block device). In other words, PDisk is a subsystem that implements an abstraction similar to a specialized file system on top of block devices (or files emulating a block device for testing purposes). PDisk provides data integrity control (including erasure coding of sector groups to recover data on individual damaged sectors, integrity checking using checksums), transparent encryption of all data on the disk, and transactional guarantees for disk operations (write confirmation strictly after fsync).
PDisk contains a scheduler that ensures shared use of the device's bandwidth among multiple clients ( VDisk). PDisk divides the block device into blocks called slots (about 128 megabytes in size; smaller blocks are also allowed). At any given time, no more than one VDisk can own each slot. PDisk also maintains a recovery log shared by PDisk service records and all VDisks.
VDisk
VDisk, virtual disk is a component that implements data storage of distributed storage LogoBlob on PDisk. VDisk stores all its data on PDisk. One VDisk corresponds to one PDisk, but typically several VDisks are associated with one PDisk. Unlike PDisk, which hides blocks and logs behind it, VDisk provides an interface at the LogoBlob and LogoBlobID level, for example writing a LogoBlob, reading LogoBlobID data, and deleting a set of LogoBlobs using a special command. VDisk is a member of a storage group. VDisk itself is local, but many VDisks in a given group provide reliable data storage. VDisks in a group synchronize data with each other and replicate data in case of losses. The set of VDisks in a storage group forms a distributed RAID.
Yard
Yard is the name of the PDisk API. It allows VDisk to read and write data to blocks and logs, reserve blocks, delete blocks, and transactionally acquire and release ownership of blocks. In some contexts, Yard can be considered a synonym for PDisk.
Skeleton
A Skeleton is an actor that provides an interface to a VDisk.
SkeletonFront
SkeletonFront is a proxy actor for Skeleton that controls the flow of messages coming to Skeleton.
Distributed storage controller
The distributed storage controller or DS controller manages the dynamic configuration of distributed storage, including information about PDisks, VDisks, and storage groups. It interacts with node wardens to launch various distributed storage components. It interacts with Hive to allocate channels to tablets.
Proxy
Distributed storage proxy, DS-proxy, or BS-proxy acts as a client library for performing operations with distributed storage. The users of DS-proxy are tablets that write to and read from distributed storage. DS-proxy hides the distributed nature of distributed storage from the user. The task of DS-proxy is to write to a quorum of VDisk, perform retries when necessary, and control the write/read flow to prevent VDisk overload.
Technically, the DS proxy is implemented as an actor service launched by node warden on each node for each storage group, handling all requests to the group (writing, reading, and deleting LogoBlob, and group locking). When writing data, the DS proxy performs erasure coding of the data, splitting the LogoBlob into parts that are then sent to the corresponding VDisks. The DS proxy performs the reverse process when reading, receiving parts from VDisks and reconstructing the LogoBlob from them.
Node warden
Node warden or BS_NODE is an actor service on each cluster node that launches PDisks, VDisks, and DS proxies of static storage groups when the node starts. It also interacts with the DS controller to launch PDisk, VDisk, and DS proxies of dynamic groups. The DS proxy of dynamic groups is launched on demand: node warden processes undelivered messages to DS proxies, launches the corresponding DS proxies, and receives group configuration from the DS controller.
Failure realm
A fail realm is a set of failure domains that can fail simultaneously due to a common cause. A correlated failure of two VDisks in the same fail realm is more likely than a failure of two VDisks from different fail realms.
An example of a fail realm is a set of equipment located in a single data center, or availability zone, which can fail entirely due to a natural disaster, large-scale power outage, or other similar event.
Failure domain
A fail domain is a set of hardware that may fail simultaneously. The correlated failure of two VDisks within the same fail domain is more probable than the failure of two VDisks from different fail domains. In the case of different fail domains, this probability is also affected by whether these domains belong to the same fail realm or not.
An example of a fail domain is a set of disks connected to a single server, since all disks of a particular server may become unavailable if the server's power supply or network controller fails. Typically, all servers located in a single server rack are considered a common fail domain, because power or network issues at the rack level cause all equipment in it to become unavailable. Thus, a typical fail domain corresponds to a server rack (if the cluster is configured with rack-aware topology) or an individual server.
Failures at the fail domain level are automatically handled by YDB without stopping the cluster.
Distributed storage channel
A distributed storage channel, DS channel, or channel is a logical connection between a tablet and a storage group. A tablet can write data to different channels, and each channel maps to a specific storage group. Having multiple channels allows a tablet to:
- Write more data than a single storage group can hold.
- Store different LogoBlobs in different storage groups, with different properties, such as erasure coding or on different media (HDD, SSD, NVMe).
Distributed transactions implementation
Below are the terms related to the implementation of distributed transactions. The implementation itself is described in a separate article DataShard: distributed transactions.
Deterministic transactions
Distributed transactions in YDB are inspired by the research paper Building Deterministic Transaction Processing Systems without Deterministic Thread Scheduling by Alexander Thomson and Daniel J. Abadi from Yale University. The paper introduced the concept of deterministic transaction processing, which allows efficient processing of distributed transactions. The original paper imposed restrictions on the types of operations that could be performed this way. Since these restrictions hindered real-world user scenarios, YDB evolved its algorithms to handle them, using deterministic transactions as stages for executing user transactions with additional orchestration and locking.
Optimistic locking
As in many other database management systems, queries in YDB can place locks on certain data fragments, such as table rows, to ensure that concurrent changes do not lead to an inconsistent state. However, YDB checks these locks not at the start of transactions, but when attempting to commit them. The first approach is called pessimistic locking (for example, used in PostgreSQL), and the second is called optimistic locking (used in YDB).
Transaction lock invalidation
Transaction Lock Invalidation (TLI) is the normal behavior of YDB when parallel transactions conflict under optimistic locks. If one transaction (the violator) writes data and thereby breaks the locks of another transaction (the victim), YDB detects this when the victim commits and aborts it with error transaction locks invalidated. For more details on TLI diagnostics, see Transaction lock invalidation.
Prepare stage
Preparation phase is the transaction phase during which the transaction body is registered on all participating shards.
Execute stage
Execution phase is the transaction phase during which the scheduled transaction is executed and a response is generated.
In some cases, instead of prepare and execute, the transaction is immediately executed, and a response is generated. For example, this happens for transactions involving only one shard or consistent reads from a snapshot.
Dirty operations
In the case of read-only transactions, similar to "read uncommitted" in other database management systems, it might be necessary to read data that has not yet been committed to disk. This is called dirty operations.
Read-write set
Read-write set or RW-set is a data set that will participate in the execution of a distributed transaction. It combines the read set data that will be read and the write set for which modifications will be performed.
Read set
Read set or ReadSet data is what participating shards send during transaction execution. In the case of data transactions, it may contain information about the state of optimistic locks, the shard's readiness to commit, or a decision to abort the transaction.
Transaction proxy
Transaction proxy or TX_PROXY is a service that orchestrates the execution of many distributed transactions: sequential phases, phase execution, scheduling, and result aggregation. In the case of direct orchestration by other actors (for example, QP data transactions), it is used for caching and allocating unique TxIDs.
Transaction flags
Transaction flags or TxFlags is a bitmask of flags that somehow modify the execution of a transaction.
Transaction ID
TxID is a unique identifier assigned to each transaction when it is accepted by YDB.
Transaction order ID
Transaction order id is a unique identifier assigned to each transaction during scheduling. It consists of PlanStep and Transaction ID.
PlanStep
PlanStep or Step is the logical time at which the execution of a set of transactions is scheduled.
Mediator time
During the distributed query execution, mediator time is the logical time before which (inclusive) the shard participant must know the entire execution plan. It is used to advance the time in the absence of transactions on a particular shard, to determine whether it can read from a snapshot.
MiniKQL
MiniKQL is a language that allows expressing a single deterministic transaction in the system. It is a functional, strongly typed language. Conceptually, the language describes a graph of reading from the database, performing computations on the read data, and writing results to the database and/or to a special document representing the query result (for display to the user). A MiniKQL transaction must explicitly specify its read set (data to be read) and assume deterministic selection of execution branches (for example, no randomness).
MiniKQL is a low-level language. The system's end users only see queries in the YQL language, which relies on MiniKQL in its implementation.
Query Processor
Query Processor or QP (formerly KQP) is a YDB component responsible for orchestrating the execution of user queries and generating the final response.
Global schema
Global scheme, global schema, or database schema is the schema of all data stored in a database. It consists of tables and other entities such as topics. The metadata about these entities is called the global schema. The term is used in contrast to local schema, which refers to the data schema inside a tablet. YDB users never see the local schema and work only with the global schema.
KiKiMR
KiKiMR is the former name of YDB, used before it became an open source product. It can still be found in source code, old articles, videos, etc.