Skip to main content

Compression

About 1 min

Compression

When the time series is written and encoded as binary data according to the specified type, IoTDB compresses the data using compression technology to further improve space storage efficiency. Although both encoding and compression are designed to improve storage efficiency, encoding techniques are usually available only for specific data types (e.g., second-order differential encoding is only suitable for INT32 or INT64 data type, and storing floating-point numbers requires multiplying them by 10m to convert to integers), after which the data is converted to a binary stream. The compression method (SNAPPY) compresses the binary stream, so the use of the compression method is no longer limited by the data type.

Basic Compression Methods

IoTDB allows you to specify the compression method of the column when creating a time series, and supports the following compression methods:

  • UNCOMPRESSED

  • SNAPPY

  • LZ4

  • GZIP

  • ZSTD

The specified syntax for compression is detailed in Create Timeseries Statement.

Compression Ratio Statistics

Compression ratio statistics file: data/system/compression_ratio/Ratio-{ratio_sum}-

  • ratio_sum: sum of memtable compression ratios
  • memtable_flush_time: memtable flush times

The average compression ratio can be calculated by ratio_sum / memtable_flush_time

Copyright © 2024 The Apache Software Foundation.
Apache and the Apache feather logo are trademarks of The Apache Software Foundation

Have a question? Connect with us on QQ, WeChat, or Slack. Join the community now.