# Pricing for Yandex Data Streams

Data Streams supports two pricing modes:

- Based on allocated resources: You pay a fixed hourly rate for the established throughput limit and message retention period and additionally for the number of units of actually written data.
- On-demand: You pay for data writes and reads performed, the amount of data read/written, and the size of storage actually used for messages with a valid retention period.

Pricing mode is set for each data stream individually. By default, streams in Data Streams are created with pricing based on allocated resources.

## Pricing based on allocated resources

If pricing for allocated resources is used, the number of units of written data and resources allocated for streaming data are billed.

Pricing for the allocated resources includes the established segment throughput limit as well as storage time and size.

Data stream services with the following properties are provided free of charge each month:

- Segment write speed: no more than 128 KBps.
- Message retention period: 1 hour.
- Number of data units written per month: no more than 2 million.

After you've used up your free service amounts, you will be charged at the applicable rate. The unused balance of free services is reset at the end of the month.

### Examples of cost calculation

A single-shard stream receives two 50 KB messages per second. The message retention period is 12 hours.

Calculation of the monthly cost of processing data (provided that there are 31 days in the month):

⌈ 50 / 40 ⌉ = 2

Where:

- 50 is the size of one message in KB.
- 40 is the size of units of written data in KB.
- 2 is the number of data units written per message.

While calculating the cost, the number of units of written data is rounded up to an integer. In this example, the number is rounded to 2.

2 × 2 = 4

Where:

- 2 is the number of messages per second.
- 2 is the number of data units written per message.
- 4 is the number of data units written per second.

4 × 60 × 60 × 24 × 31 = 10713600

Where:

- 4 is the number of data units written per second.
- 60 × 60 × 24 × 31 is the number of seconds in the month.
- 10713600 is the units of data written per month.

0.001709 × 24 × 31 = 1.269264

Where:

- 0.001709 is the cost of allocated resources per hour when stored for 12 hours.
- 24 is the number of data storage hours.
- 31 is the number of days in a month.
- 1.269264 is the cost of allocated resources with a maximum data write speed of 128 KB/s and a storage period of 24 hours, $ per month, without VAT.

(10713600 - 2000000) / 1000000 × 0.015128 + 1.269264 = 1.401083

Where:

- 10713600 is the number of units of data written per month.
- 2000000 is the number of free units per month.
- 0.015128 is the cost of 1 million units of written data, $, without VAT.
- 1.269264 is the cost of allocated resources with a maximum data write speed of 128 KB/s and a storage period of 24 hours, $ per month, without VAT.

Total: $1.401083, without VAT.

### Pricing

#### Cost of a unit of written data

The first 2000000 units of written data per month are free of charge.

Unit size | Cost per million units, without VAT |
---|---|

40 KB | $0.015128 |

#### Cost of allocated resources

#### Pricing based on storage time

Cost of using allocated resources per hour:

Data retention period |
Cost of storing data with a throughput limit per shard of 128 KB/s, without VAT |
Cost of storing data with a throughput limit per shard of 512 KB/s, without VAT |
Cost of storing data with a throughput limit per shard of 1 MB/s, without VAT |
---|---|---|---|

1 hour | Free | Not offered | Not offered |

4 hours | $0.001496 | $0.003419 | $0.005556 |

12 hours | $0.001709 | $0.005128 | $0.008120 |

24 hours | $0.002564 | $0.007692 | $0.011966 |

#### Pricing based on storage size

Data is stored for up to 7 days.

Data write price:

Segment throughput limit | Price incl. VAT |
---|---|

Up to 128 KB/s | $0.615385 |

Up to 512 KB/s | $1.846154 |

Up to 1 MB/s | $3.076923 |

Data storage price:

Storage size | Price incl. VAT |
---|---|

1 GB | $0.13846 |

Minimum storage size: 50 GB per segment.

## On-demand pricing

With on-demand pricing, data streams are billed at the level of YDB Serverless database topics where their data is stored. Go to the Pricing policy for YDB Serverless mode page to learn more about pricing and cost calculation.