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
  • Access management
  • Monitoring metrics
  • Audit Trails events
  • FAQ
  • Public materials

In this article:

  • Getting started
  • Create a database
  • Create a serverless DB
  • Create a database on dedicated servers
  • Run a query to the database
  • What's next

Getting started with Managed Service for YDB

Written by
Yandex Cloud
Improved by
Updated at June 9, 2025
  • Getting started
  • Create a database
    • Create a serverless DB
    • Create a database on dedicated servers
  • Run a query to the database
  • What's next

In this tutorial, you will create a YDB database in Yandex Cloud and run a simple query to it using the Yandex Cloud management console or command line tools.

You can also work with a Yandex Managed Service for YDB DB through:

  • YDB SDK
  • YDB CLI
  • AWS SDK
  • AWS CLI

Getting startedGetting started

  1. Go to the management console and log in to Yandex Cloud or sign up if not signed up yet.

  2. If you do not have a folder yet, create one:

    1. In the management console, select the appropriate cloud from the list on the left.

    2. At the top right, click Create folder.

    3. Give your folder a name. The naming requirements are as follows:

      • It must be from 2 to 63 characters long.
      • It can only contain lowercase Latin letters, numbers, and hyphens.
      • It must start with a letter and cannot end with a hyphen.
    4. Optionally, specify the description for your folder.

    5. Select Create a default network. This will create a network with subnets in each availability zone. Within this network, you will also have a default security group, within which all network traffic will be allowed.

    6. Click Create.

Create a databaseCreate a database

You can create a DB in the Serverless configuration or with dedicated servers. For more information about differences between configurations, see Serverless and dedicated modes. You cannot change the DB type once you have created it.

Note

For the Amazon DynamoDB-compatible mode, use a serverless database configuration.

Create a serverless DBCreate a serverless DB

Management console
Yandex Cloud CLI
  1. In the management console, select the folder to create your DB in.

  2. From the list of services, select Managed Service for YDB.

  3. Click Create a database.

  4. Enter the Name of the DB. Follow these naming requirements:

    • It must be from 2 to 63 characters long.
    • It can only contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  5. Under Database type, select Serverless.

    You can leave the default parameters for the DB being created and change them later. For more information about DB parameters, see Creating a serverless database.

  6. Click Create a database.

Wait for the DB to start. While being created, your database will have the Provisioning status. Once it is ready for use, its status will change to Running.

  1. If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

  2. Create a database:

    yc ydb database create <DB_name> --serverless
    

    Where <DB_name> is the name of your database.

    Result:

    done (6s)
    id: etn95g8jk8g0********
    folder_id: b1g7gvsi89m3********
    created_at: "2022-05-30T07:26:44Z"
    name: test
    status: PROVISIONING
    endpoint: grpcs://ydb.serverless.yandexcloud.net:2135/?database=/ru-central1/b1gia87mbaom********/etn95g8jk8g0********
    serverless_database:
      storage_size_limit: "53687091200"
    location_id: ru-central1
    backup_config:
      backup_settings:
      - name: daily
        backup_schedule:
          daily_backup_schedule:
            execute_time:
              hours: 17
        backup_time_to_live: 172800s
        type: SYSTEM
    document_api_endpoint: https://docapi.serverless.yandexcloud.net/ru-central1/b1gia87mbaom********/etn95g8jk8g0********
    monitoring_config: {}
    

    A database with default parameters is created. You can change its parameters later. For more information about DB parameters, see Creating a serverless database.

  3. Check the status of the created database:

    yc ydb database get <DB_name>
    

    Where <DB_name> is the name of the DB you created.

    While being created, your database will have the PROVISIONING status. Once it is ready for use, its status will change to RUNNING.

Create a database on dedicated serversCreate a database on dedicated servers

Management console
Yandex Cloud CLI
  1. In the management console, select the folder to create your DB in.

  2. From the list of services, select Managed Service for YDB.

  3. Click Create a database.

  4. Enter the Name of the DB. Follow these naming requirements:

    • It must be from 2 to 63 characters long.
    • It can only contain lowercase Latin letters, numbers, and hyphens.
    • It must start with a letter and cannot end with a hyphen.
  5. Under Database type, select Dedicated.

  6. Under Computing resources, select the type and amount of computing resources.

  7. Under Storage groups, select the disk type and number of storage groups that determines the total amount of storage.

  8. Under Network, configure network settings:

    1. (Optional) In the Public IP addresses field, select Assign if you plan to run queries against the DB both from the Yandex Cloud network and the internet.

      Warning

      For Managed Service for YDB databases with external IPs, the usage of outgoing internet traffic is counted by the current pricing policy.

      The charges for outgoing internet traffic generated by Managed Service for YDB usage will be offset by grants.

    2. Select an existing network from the Cloud network list or create a new one:

      1. Click Create.
      2. In the window that opens, enter a Name for the new network.
      3. (Optional) Select the Create subnets option. Subnets in each availability zone will be created automatically.
      4. Click Create network.
    3. Under Subnets, select a subnet or create a new one for each availability zone:

      1. Click Create.
      2. In the window that opens, enter a Name for the new subnet.
      3. (Optional) Enter a Description of the subnet.
      4. Select the availability zone you need from the Availability zone list.
      5. Set the subnet address in CIDR format.
      6. Click Create subnet.

    You cannot change the settings of the Network section after the database is created.

  9. Click Create a database.

    Wait for the DB to start. While being created, your database will have the Provisioning status. Once it is ready for use, its status will change to Running.

  1. If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

  2. Create a cloud network and subnets for each availability zone, if required.

  3. Create a database:

    yc ydb database create <DB_name> \
      --dedicated \
      --resource-preset <configuration> \
      --storage type=<media_type>,groups=<number_of_storage_groups> \
      --public-ip \
      --network-name default\
      --async
    

    Where:

    • --resource-preset STR: Configuration of the node computing resources. You can find the possible values in the Configuration name column of the table in Database on dedicated resources.
    • --storage STR: Media type and number of storage groups in type=<media_type>,groups=<number_of_storage_groups> format. For the ssd type, a single storage group can store up to 100 GB of data.
    • --public-ip: Public IP address assignment flag. Without it, you cannot connect to the database you created from the internet.
    • --network-name STR: Name of the cloud network to create the database in. You can specify the default network.
    • --async: Asynchronous DB creation flag.

    For more information about DB parameters, see Creating a serverless database.

    Result:

    done (7m18s)
    id: etnk1u65e4sh********
    folder_id: b1g7gvsi89m3********
    created_at: "2022-05-31T10:10:12Z"
    name: test-ded
    status: PROVISIONING
    endpoint: grpcs://lb.etnk1u65e4shtgj338va.ydb.mdb.yandexcloud.net:2135/?database=/ru-central1/b1gia87mbaom********/etnk1u65e4sh********
    resource_preset_id: medium
    storage_config:
      storage_options:
      - storage_type_id: ssd
        group_count: "1"
      storage_size_limit: "107374182400"
    scale_policy:
      fixed_scale:
        size: "1"
    network_id: enpqkm0od2bu********
    subnet_ids:
    - b0cmespgm8o3********
    - e2lif378n1pg********
    - e9b72lv142k4********
    dedicated_database:
      resource_preset_id: medium
      storage_config:
        storage_options:
        - storage_type_id: ssd
          group_count: "1"
        storage_size_limit: "107374182400"
      scale_policy:
        fixed_scale:
          size: "1"
      network_id: enpqkm0od2bu********
      subnet_ids:
      - b0cmespgm8o3********
      - e2lif378n1pg********
      - e9b72lv142k4********
      assign_public_ips: true
    assign_public_ips: true
    location_id: ru-central1
    backup_config:
      backup_settings:
      - name: daily
        backup_schedule:
          daily_backup_schedule:
            execute_time:
              hours: 17
        backup_time_to_live: 172800s
        type: SYSTEM
    monitoring_config: {}
    
  4. Check the status of the created database:

    yc ydb database get <DB_name>
    

    Where <DB_name> is the name of the DB you created.

    While being created, your database will have the PROVISIONING status. Once it is ready for use, its status will change to RUNNING.

Run a query to the databaseRun a query to the database

Management console
YDB CLI
  1. In the management console, select the folder where the desired bucket is located.

  2. From the list of services, select Managed Service for YDB.

  3. Select the previously created database.

  4. Navigate to the Navigation tab.

  5. Click New SQL query and enter the query text.

    SELECT 1;
    
  6. Click Run.

    See the query result below:

    # column0
    0 1
    
  1. If you do not have the Yandex Cloud CLI installed yet, install and initialize it.

  2. To manage your DBs from the command line, install the YDB CLI.

  3. To authenticate the YDB CLI in Yandex Cloud, get an IAM token and export it to the following environment variable:

    export IAM_TOKEN=`yc iam create-token`
    
  4. Get the DB endpoint and path:

    yc ydb database get ydb-prod
    

    Result:

    ...
    endpoint: grpcs://ydb.serverless.yandexcloud.net:2135/?database=/ru-central1/b1gia87mbaom********/etnudu2n9ri3********
    ...
    

    Here, a part of the grpcs://ydb.serverless.yandexcloud.net:2135 string contains the endpoint, while /ru-central1/b1gia87mbaom********/etnudu2n9ri3******** specifies the DB path.

  5. Run a query to the previously created DB using the resulting endpoint value and DB path:

    ydb \
      --endpoint grpcs://ydb.serverless.yandexcloud.net:2135 \
      --database /ru-central1/b1gia87mbaom********/etnudu2n9ri3******** \
      yql -s "SELECT 1;"
    

    Result:

    ┌─────────┐
    | column0 |
    ├─────────┤
    | 1       |
    └─────────┘
    

What's nextWhat's next

  • Learn more about working with DBs.
  • Read about service concepts.
  • Learn more about the YQL query language.

Was the article helpful?

Next
Overview
© 2025 Direct Cursus Technology L.L.C.