Yandex Cloud
Search
Contact UsGet started
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
  • Pricing
  • Customer Stories
  • Documentation
  • Blog
© 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
    • Using YDB via the ydb-mcp server with the Cursor IDE as an example
  • Access management
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials

In this article:

  • Creating a table
  • Row-oriented table
  • Document table
  • Сolumn-oriented table
  • Changing the table structure
  • Row-oriented table
  • Document table
  • Column-oriented table
  • Deleting a table
  • Row-oriented table
  • Document table
  • Column-oriented 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 October 20, 2025
  • Creating a table
    • Row-oriented table
    • Document table
    • Сolumn-oriented table
  • Changing the table structure
    • Row-oriented table
    • Document table
    • Column-oriented table
  • Deleting a table
    • Row-oriented table
    • Document table
    • Column-oriented 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, navigate to the folder dashboard and select Managed Service for YDB.
  2. Select the database to create a table in.
  3. Navigate 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-oriented and column-oriented 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, navigate to the folder dashboard 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 partitioning key value as an input for the internal hashing function. The result of the hash function calculation decides the partition the element will be stored in.
    • Sort key. The primary key can be composite and consist of a partitioning key and a sorting key. All elements with the same partitioning key will be stored together, sorted based on the sorting key. If a document table features a partitioning key and a sorting key, any two elements may contain the same partitioning key value but must contain different sorting key values.
  6. Click Create table.

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

Сolumn-oriented tableСolumn-oriented table

Management console
Terraform
  1. In the management console, navigate to the folder dashboard and select Managed Service for YDB.
  2. Select the database to create a table in.
  3. Navigate 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: Column table.
  6. Add columns:
    • Column Name. Must be unique within the table.

    • Column data Type.

    • Primary key. Specify whether the column is part of the primary key. A primary index is automatically created based on the primary key.

      Note

      The order of columns in the primary key depends on the order of columns in the table being created.

    • NOT NULL constraint. Specify whether the column may contain the NULL value.

  7. Configure the table TTL parameters:
    • Column. Select the column whose value will be used to calculate the lifetime of the rows.
    • Lifetime. Specify the lifetime of the table rows.
    • Unit. Select a unit of measurement for the table row lifetime you specified.
  8. Configure partitioning:
    • Partition key: Specify a column to partition the table by.
    • Partition count: Specify the number of partitions for the table.
  9. Click Create table.

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

To learn how to create a column-oriented table using Terraform, see Creating row-oriented and column-oriented 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, navigate to the folder dashboard 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-oriented and column-oriented 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, navigate to the folder dashboard 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.

Column-oriented tableColumn-oriented table

Management console
Terraform
  1. In the management console, navigate to the folder dashboard 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.

    Make the required updates in the table structure. Available actions:

    • 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.
    • To delete non-key columns from the table, click in the appropriate row. You cannot delete columns that make up a primary key.
    • Configure the table TTL parameters:
      • Column. Select the column whose value will be used to calculate the lifetime of the rows.
      • Lifetime. Specify the lifetime of the table rows.
      • Unit. Select a unit of measurement for the table row lifetime you specified.
  4. Click Alter table.

To update column-oriented tables, you can also use the ALTER TABLE command.

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

Note

Updating the store and partition_by parameters of the column-oriented table will result in recreating the table.

Deleting a tableDeleting a table

Row-oriented tableRow-oriented table

Management console
Terraform
  1. In the management console, navigate to the folder dashboard 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, navigate to the folder dashboard 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.

Column-oriented tableColumn-oriented table

Management console
Terraform
  1. In the management console, navigate to the folder dashboard 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 column-oriented table, delete the yandex_ydb_table resource.

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

Creating and deleting directoriesCreating and deleting directories

Management console
  1. In the management console, navigate to the folder dashboard 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.