Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between stateless and stateful compression?

In the chapter Filters (scroll down ~50%) in an article about the Remote Call Framework are mentioned 2 ways of compression:

  • ZLib stateless compression
  • ZLib stateful compression

What is the difference between those? Is it ZLib-related or are these common compression methods?

While searching I could only find stateful and stateless webservices. Aren't the attributes stateless/ful meant to describe the compression-method?

like image 759
MOnsDaR Avatar asked Sep 14 '25 08:09

MOnsDaR


2 Answers

From Transport Layer Security Protocol Compression Methods:

Compression methods used with TLS can be either stateful (the compressor maintains it's state through all compressed records) or stateless (the compressor compresses each record independently), but there seems to be little known benefit in using a stateless compression method within TLS.

Some compression methods have the ability to maintain history
information when compressing and decompressing packet payloads. The
compression history allows a higher compression ratio to be achieved on a stream as compared to per-packet compression, but maintaining a
history across packets implies that a packet might contain data needed to completely decompress data contained in a different packet. History maintenance thus requires both a reliable link and sequenced packet delivery. Since TLS and lower-layer protocols provide reliable, sequenced packet delivery, compression history information MAY be maintained and exploited if supported by the compression method.

like image 188
Jakub Konecki Avatar answered Sep 15 '25 22:09

Jakub Konecki


In general, stateless describes any process that does not have a memory of past events, and stateful describes any process that does have such a memory (and uses it to make decisions.)

In compression, then, stateless means whatever chunk of data it sees, it compresses, without depending on previous inputs. It's faster but usually compresses less; stateful compression looks at previous data to decide how to compress current data, it's slower but compresses much better.

like image 38
Vinko Vrsalovic Avatar answered Sep 15 '25 22:09

Vinko Vrsalovic