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 prices in this section.
When you use Managed Service for YDB in Serverless mode, you are billed for each request made to the database. Users don't 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 restoring data from backups, are charged additionally.
What goes into the cost of using Managed Service for YDB Serverless mode
When using Managed Service for YDB in Serverless mode, you pay for the following:
- Data operations.
- The amount of stored data, including service data, such as indexes.
- Additional user operations, like restoring data from backups.
Other consumed resources to be additionally paid for:
- The space used in Yandex Object Storage to store on-demand backups.
- Egress traffic from Yandex Cloud.
In all calculations, 1 GB = 210 MB = 220 KB = 230 bytes.
Data operations and request units
The serverless mode of Managed Service for YDB supports multiple ways to work with data:
- YQL is an SQL-like language for accessing relational tables, supported by the SDK
, CLI , and management console in YDB. - 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 RU. 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 RU 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 part (or all) of RU 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 consumption of RU within the specified capacity isn't added to the RU 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's 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 the ydb tools dump
utility, billing is based on the rates for the ReadTable
operation.
Example of calculating the cost of creating an on-demand backup
Below, you can find sample cost calculations for creating backups of 1GB and 10GB databases.
Cost calculation for a database of 1 GB
Actual (on-demand) consumption of RUs per month will be:
128 RU × 1024 = 131072 RU
Where:
- 128: Cost of request for 1 MB of data.
- 1024: Amount of data copied, in MB.
The number of RUs used (131072) is less than 1000000, so creating a backup will be free of charge.
Cost calculation for a database of 10 GB
Actual (on-demand) consumption of RUs per month will be:
128 RU × 1024 × 10 = 1310720 RU
Where:
- 128: Cost of request for 1 MB of data.
- 1,024 × 10: Amount of data copied, in MB.
The number of RUs used (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 RU - 1,000,000 RU) / 1,000,000 × $0.171040 = $0.0531455488
Total: $0.053146 is the cost of creating a backup of 10 GB of data.
Where:
- 1310720 RU is actual (on-demand) consumption of RUs per month.
- $0.171040: Cost of 1 million RUs.
Restoring data from backups
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 the ydb tools restore
utility, billing is based on the cost of writing a row to the DB for each restored row.
Example of calculating the cost of backup recovery
Below, you can find sample cost calculations for backup recovery for 1GB and 10GB databases.
Cost calculation for a database of 1 GB
Actual (on-demand) consumption of RUs per month will be:
0.5 RU × 1024 × 1024 = 524288 RU
Where:
- 0.5: Cost of request for 1 KB of data.
- 1024 × 1024: Amount of data recovered, in KB.
The number of RUs used (524288) is less than 1000000, so recovery from a backup will be free of charge.
Cost calculation for a database of 10 GB
Actual (on-demand) consumption of RUs per month will be:
0.5 RU × 1024 × 1024 × 10 = 5242880 RU
Where:
- 0.5: Cost of request for 1 KB of data.
- 1024 × 1024 × 10: Amount of data recovered, in KB.
The number of RUs used (5242880) exceeds 1000000, so the cost of recovery from a backup will be $0.171040 for 1000000 RUs.
(5242880 RU - 1000000 RU)/ 1000000 × $0.171040 = $0.7257021952
Total: $0.725702 is the cost of recovery from a backup of 10 GB of data.
Where:
- 5242880 RU: Actual (on-demand) consumption of RUs per month.
- $0.171040: Cost of 1 million RUs.
Pricing
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 |
When using the service, you pay for traffic from Yandex Cloud to the internet. Traffic between Yandex Cloud services and incoming internet traffic are free of charge.
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 via NAT gateway, first 10 GB per month | Free |
Outgoing traffic via NAT gateway, over 10 GB per month | $0.012240 |