NATS 2.10 introduces a new compression feature for NATS Streams, which allows for configuring compression for each stream individually. The S2 compression format is supported, providing high throughput. The storage savings of using S2 compression are examined, and it is found that compression kicks in after a certain amount of messages, resulting in significant storage savings. Existing streams can have compression enabled, but it does not affect existing messages. The compression logic in nats-server is explained, highlighting how compression is performed on blocks of messages. Overall, the compression feature of NATS Streams can save storage space and has no immediate performance overhead for individual message writes.
Table of contents
Creating the streamsGenerating Test DataTest ResultsIs it possible to turn on compression for existing streams?Compression Logic in nats-serverWrap Up2 Comments
Sort: