Pricing policy for Managed Service for YDB serverless mode
To calculate the cost of using the service, use the calculator on the Yandex Cloud website or see the pricing in this section.
When you use Managed Service for YDB in serverless mode, you are billed for each request made to the database. Users do not have to indicate the resources they need: the database quickly adapts to changes in the user load. Apart from requests, the user pays for the data stored in Managed Service for YDB on an hourly basis. Other operations, such as recovery from a backup, are charged extra.
What goes into the cost of using Managed Service for YDB in serverless mode
When using Managed Service for YDB in Serverless mode, you pay for the following:
- Data operations.
- Amount of stored data, including service data, such as indexes.
- Additional user operations, such as recovery from a backup.
Other consumed resources to be additionally paid for:
- Space used in Yandex Object Storage to store on-demand backups.
- Volume of outgoing traffic from Yandex Cloud to the internet.
In all calculations, 1 GB = 210 MB = 220 KB = 230 bytes.
Data operations and request units
The serverless mode of Yandex Managed Service for YDB supports multiple ways to work with data:
- YQL is an SQL-like language for accessing relational tables that is supported by the SDK
, CLI , and the YDB management console. - Document API is the Amazon DynamoDB-compatible HTTP API. You can use this API to perform operations on document tables.
You can also query the database through the special APIs available as stand-alone features in the YDB SDK, CLI, or management console.
To calculate the cost of requests in YDB, we use so-called request units (RU). Each executed request, depending on its type, complexity, and data size, consumes a certain number of RUs. The total cost of all executed requests to YDB is the sum of the RU costs for each request.
Rules for calculating the cost of requests to YDB in RU:
Pricing for Request Unit consumption
- Actual consumption (on-demand). The cost of using YDB for a certain period is the number of spent Request Units multiplied by the price per Request Unit minus the monthly free package. If there were no requests to the database or if the amount of RUs spent in the current month is less than the free package, there is no charge for actual RU consumption.
- Provisioned capacity. If your load is predictable and has a fixed component, you can reduce the cost of using YDB by paying for some (or all) RUs you spent at an hourly rate. To do this, set a non-zero value of the database parameter "Provisioned capacity, RU/s". After that, you are charged according to a special pricing plan, the rate for which is set to RU/s × hour, with billing per second. The RUs consumed within the specified capacity are not added to the RUs spent at the on-demand rate.
Amount of data stored
In Serverless mode, data storage capacity is allocated automatically. The amount of stored data is calculated as the total amount of user and service data stored in the database. For example, creating a global index increases the total storage size by the index size.
For topics with on-demand pricing, you also pay for the actually used disk space. Its usage starts once each message is published in a topic and it is released once the retention period set for the topic expires.
Creating backups
Automatic backups
Managed Service for YDB automatically creates and stores two full backups for the last two days free of charge. No fee is charged for storing automatic backups.
On-demand backups
You can force a database backup, saving a copy to Object Storage. The cost of this operation depends on the size of copied data and is calculated similarly to the ReadTable operation. When calculating the cost, the actual amount is rounded up to a multiple of 1 GB.
Warning
If you export data using ydb tools dump
, billing is based on the ReadTable
operation rates.
Example of calculating the cost of creating an on-demand backup
Let's calculate the cost of creating backups of 1 GB and 10 GB databases.
Cost calculation for a 1 GB database
Actual (on-demand) consumption of RUs per month will be:
128 RUs × 1,024 = 131,072 RUs
Where:
- 128: Cost of request for 1 MB of data.
- 1,024: Amount of data copied, in MB.
The number of RUs spent (131,072) is less than 1,000,000, so creating a backup will be free of charge.
Cost calculation for a 10 GB database
Actual (on-demand) consumption of RUs per month will be:
128 RUs × 1,024 × 10 = 1,310,720 RUs
Where:
- 128: Cost of request for 1 MB of data.
- 1,024 × 10: Amount of copied data, in MB.
The number of spent RUs (1,310,720) exceeds 1,000,000, so the cost of creating a backup will be $0.171040 for 1,000,000 RUs.
(1,310,720 RUs - 1,000,000 RUs) / 1,000,000 × $0.171040 = $0.053146
Total: $0.053146, cost of creating a 10 GB backup.
Where:
- 1,310,720 RUs: Actual (on-demand) consumption of RUs per month.
- $0.171040: Price per 1 million RUs.
Recovery from a backup
You can restore databases and individual tables from the backups stored in Object Storage. The cost of this operation depends on the size of recovered data and is calculated similarly to the BulkUpsert operation. When calculating the cost, the actual amount is rounded up to a multiple of 1 GB.
Warning
If you restore data using ydb tools restore
, billing is based on the cost of writing a row to the DB for each restored row.
Example of calculating the cost of recovery from a backup
Let's calculate the cost of backup recovery for 1 GB and 1 GB databases.
Cost calculation for a 1 GB database
Actual (on-demand) consumption of RUs per month will be:
0.5 RUS × 1,024 × 1,024 = 524,288 RUS
Where:
- 0.5: Cost of request for 1 KB of data.
- 1,024 × 1,024: Amount of data recovered, in KB.
The number of RUs spent (524,288) is less than 1,000,000, so recovery from a backup will be free of charge.
Cost calculation for a 10 GB database
Actual (on-demand) consumption of RUs per month will be:
0.5 RUs × 1,024 × 1,024 × 10 = 5,242,880 RUs
Where:
- 0.5: Cost of request for 1 KB of data.
- 1,024 × 1,024 × 10: Amount of data being recovered, in KB.
The number of spent RUs (5,242,880) exceeds 1,000,000, so the cost of recovery from a backup will be $0.171040 for 1,000,000 RUs.
(5,242,880 RUs - 1,000,000 RUs) / 1,000,000 × $0.171040 = $0.725702
Total: $0.725702, the cost of recovery from a backup of 10 GB of data.
Where:
- 5,242,880 RUs: Actual (on-demand) consumption of RUs per month.
- $0.171040: Price per 1 million RUs.
Prices for the Russia region
Warning
Prices for Yandex Cloud resources vary from region to region. For more information about the available regions, see Regions.
The currency that can be used to pay for resources depends on which legal entity the user has entered into agreement with. For more information about account registration, see Registering an account in Yandex Cloud.
All prices are net of VAT. Prices are given for a 30-day month. For shorter months, the cost is higher. For longer months, it is lower.
Service | Cost, without VAT |
---|---|
Data operations, less than 1 million RUs per month | Free |
Data operations, over 1 million RUs per month | $0.171040 per 1 million RUs |
Data operations with one-month commitment | $0.0128 per hour per 100 RU/s |
Data storage, less than 1 GB per month | Free |
Data storage, over 1 GB per month | $0.171040 per 1 GB per month |
Storage of on-demand backups in Yandex Object Storage | $0.016166 per 1 GB per month |
Outgoing traffic
When using the service, you pay for traffic from Yandex Cloud to the internet. Traffic between internal IP addresses of Yandex Cloud services and incoming internet traffic is free.
The first 100 GB of outgoing traffic are provided free of charge every month.
The minimum billing unit is 1 MB.
Resource category | Cost of 1 GB |
---|---|
Outgoing traffic, 100 GB or less per month | Free |
Outgoing traffic, over 100 GB per month | $0.012240 |