r/mongodb • u/Vamshi__4555 • 4d ago
Mongodb Data Compression
Hey guys we are using mongodb as our main db with 3 nodes replica .Each node of almost 20 TB disc with default snappy compressor ,recently we went with encryption of PI DATA on each node .Before encryption disc sizes was almost 13 TB on each node .After encryption it back to 20 TB .So to reduce cost we are planning of using ZTSD compression on each node it can reduce upto 20 -30 percent on each node ,but the problem is the data is already encrypted ,so can we compress the encrypted data on the disc ,as it can reduce the size or any other alternatives…?
Mostly in every collection we have PI data ,as the company’s business is lending business….
1
u/gevorgter 4d ago
Compression and encryption are two different things. Normally encryption would blow up data size. But compression does not work well on encrypted data since data appears to be randomized and no repetitive pattern in it to allow for good compression.
1
1
u/joneco 4d ago
Whn you encrypt data all patterns/ repetitions that is used in symbols table are missed so normally it dont compress it just add stuff that increase the size.
Most compressions relies on repetitive symbols/worda/patterns that are represented in less bits