Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for YDB
  • Getting started
    • Overview
    • Connecting to a database using the YDB CLI
    • Managing databases
    • Migrating a database to a different availability zone
    • Managing tables and directories
    • Reading and writing data
    • Monitoring DB status
  • Access management
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials

In this article:

  • Creating a table
  • Row-oriented table
  • Document table
  • Changing the table structure
  • Row-oriented table
  • Document table
  • Deleting a table
  • Row-oriented table
  • Document table
  • Creating and deleting directories
  1. Step-by-step guides
  2. Managing tables and directories

Managing tables and directories

Written by
Yandex Cloud
Improved by
Max Z.
Updated at November 26, 2024
  • Creating a table
    • Row-oriented table
    • Document table
  • Changing the table structure
    • Row-oriented table
    • Document table
  • Deleting a table
    • Row-oriented table
    • Document table
  • Creating and deleting directories

This section describes how to manage row-oriented and document tables as well as directories using the cloud management console or Terraform.

The following operations are possible:

  • Creating a table
  • Changing the table structure
  • Deleting a table
  • Creating and deleting directories

To work with tables and directories, you will need a database.

Creating a tableCreating a table

You can create a row-oriented table or a document table.

Row-oriented tableRow-oriented table

Management console
Terraform
  1. In the management console, go to the folder page and select Managed Service for YDB.
  2. Select the database to create a table in.
  3. Go to the Navigation tab.
  4. Choose Create → Table on the right side of the page.
  5. Configure the table settings:
    • Table Name. Must be unique within the database.
    • Table type: Row table.
  6. Add columns:
    • Column Name. Must be unique within the table.
    • Column data Type. Regardless of the data type, each column may contain a NULL value.
    • Primary key. Specify whether the column is part of the primary key. Primary indexes are automatically created based on the primary key.
  7. If necessary, set up secondary indexes:
    • Secondary index Name. Must be unique within the table.
    • Key: One or more columns that make up a key for creating a secondary index.
  8. Configure the partitioning policy:
    • None: The table is not partitioned.
    • Evenly: The entire range of values of Uint32 or Uint64 key columns (from 0 to the maximum value) is split into same-length intervals. When using this policy, set the number of intervals in the Count field.
    • Explicitly: Allows you to explicitly specify values for keys that will act as boundaries for initial table partitioning. To add another boundary value, click Add split point.
  9. Configure automatic partitioning:
    • By size: If enabled, a partition is split into two when a certain data size is reached.
    • By load: If enabled, a partition is split into two if it is under high loads for a certain period of time (uses a lot of CPU time).
  10. Configure advanced table settings:
    • Auto-partitioning by size in MB: Threshold data size at which auto partitioning by size is triggered.
    • Minimum number of partitions: Number of partitions in the table below which no partition merge by size or load is performed.
    • Maximum number of partitions: Number of partitions in the table above which no splitting by size or load is performed.
    • Bloom filter for primary key: If enabled, YDB uses a Bloom filter to search data by key. In some cases, it can speed up key reads.
  11. Click Create table.

To create row-oriented tables, you can also use the CREATE TABLE command.

To learn how to create a row-oriented table using Terraform, see Creating row tables in a database.

Document tableDocument table

Management console
Terraform

Note

Document tables are only available in Managed Service for YDB serverless mode.

  1. In the management console, go to the folder page and select Managed Service for YDB.
  2. Select the database to create a table in.
  3. Choose Create → Table on the right side of the page.
  4. Configure the table settings:
    • Table Name. Must be unique within the database.
    • Table type: Document table.
  5. Add columns:
    • Column Name. Must be unique within the table.
    • Column data Type. Regardless of the data type, each column may contain a NULL value.
    • Partition key: Simple primary key that consists of one attribute. YDB uses the partition key value as an input for the internal hashing function. The result of calculating the hash function determines the partition where the item will be stored.
    • Sort key. A primary key can be composite and consist of a partition key and a sort key. All items with the same partition key will be stored together, in sorted order by the sort key value. If a partition key and a sort key are specified in a document table, two elements may contain the same value for the partition key but must contain different values for the sort key.
  6. Click Create table.

To learn how to create a document table using Terraform, see Creating document tables in a database.

Changing the table structureChanging the table structure

Row-oriented tableRow-oriented table

Management console
Terraform

In the YDB cloud console, you can add non-key columns to a table and change its automatic partitioning settings.

  1. In the management console, go to the folder page and select Managed Service for YDB.
  2. Select the database to update a table in.
  3. Find the table in the list and select → Edit.
  4. Add new columns to the table and specify their parameters:
    • Column Name. Must be unique within the table.
    • Column data Type. Regardless of the data type, each column may contain a NULL value.
  5. To delete non-key columns from the table, click in the appropriate line. You cannot delete columns that make up a primary key.
  6. Configure automatic partitioning:
    • By size: If enabled, a partition is split into two when a certain data size is reached.
    • By load: If enabled, a partition is split into two if it is under high loads for a certain period of time (uses a lot of CPU time).
  7. Configure advanced table settings:
    • Auto-partitioning by size in MB: Threshold data size at which auto partitioning by size is triggered.
    • Minimum number of partitions: Number of partitions in the table below which no partition merge by size or load is performed.
    • Maximum number of partitions: Number of partitions in the table above which no splitting by size or load is performed.
    • Bloom filter for primary key: If enabled, YDB uses a Bloom filter to search data by key. In some cases, it can speed up key reads.
  8. Click Alter table.

See Creating row tables in a database for the description of the table entities that you can change using Terraform.

Document tableDocument table

Management console
Terraform

Note

Currently, only adding new rows to a table is supported, while the preview is disabled in the management console.

  1. In the management console, go to the folder page and select Managed Service for YDB.
  2. Select the database to update a table in.
  3. Find the table in the list and click it.
  4. Click Add row.
  5. Enter the values for the columns listed in the form, then click Add.

See Creating document tables in a database for the description of the table entities that you can change using Terraform.

To edit row-oriented tables, you can also use the ALTER TABLE command.

Deleting a tableDeleting a table

Row-oriented tableRow-oriented table

Management console
Terraform
  1. In the management console, go to the folder page and select Managed Service for YDB.
  2. Select the database to delete a table from.
  3. Find the table in the list and select → Delete.
  4. Confirm the deletion.

To delete a row-oriented table, delete the yandex_ydb_table resource.

Document tableDocument table

Management console
Terraform
  1. In the management console, go to the folder page and select Managed Service for YDB.
  2. Go to the database to delete a document table from.
  3. Select a document table from the list of tables, then click → Delete.
  4. Confirm the deletion.

To delete a document table, delete the aws_dynamodb_table resource.

To delete row-oriented tables, you can also use the DROP TABLE command.

Creating and deleting directoriesCreating and deleting directories

Management console
  1. In the management console, go to the folder page and select Managed Service for YDB.
  2. Select the database to create a directory in.
  3. Choose Create → Directory on the right side of the page.
  4. Enter the directory name and click Create directory.

Was the article helpful?

Previous
Migrating a database to a different availability zone
Next
Reading and writing data
© 2025 Direct Cursus Technology L.L.C.