Redis Compression Cuts Storage, but Precision Sets the Limit
Redis compression cut LogicMonitor's numerical model storage by 85%; I'd test recovered values, peak-load latency, and rollback before adopting its approach.
- Topic
- Database
- Reading time
- 10 min
- Length
- 2,101 words
- Published
- Nov 9, 2026
08:24 pm IST
In this article
- What changed in the stored model
- Does Redis compression really save 85%?
- Choosing between lossless compression and fewer digits
- Testing compressed numerical payloads in an existing service
- Capture a reference payload and its behavior
- Isolate rounding with a small fixture
- Evaluate the complete float16 round trip
- Exercise peak load and recovery before rollout
- The float16 accuracy gap still needs an answer
- When I would leave the payload alone
Redis compression can shrink an application's payloads before Redis ever sees them. LogicMonitor reduced a numerical model from approximately 80,000 bytes to 11,383 bytes using float16 arrays, Blosc with ZLib, and Base64 encoding. No Redis server setting did that; the application changed how it represented the data. An 85% saving is enough to get my attention and make me test the approach. It isn't a number I'd promise anyone before running that test on the payloads I actually need to store.
The interesting part of LogicMonitor's compression comparison, for me, is that two things changed: the numbers being stored and the packaging around them. Those decisions ended up in one pipeline, but I'd still keep them separate in a review. Measuring a smaller stored value is the easy part. Showing that the model recovered from that value is still useful calls for different evidence, and I don't want the byte count standing in for it.
What changed in the stored model
LogicMonitor's stateless anomaly-detection microservice shared training data across pods through centralized Redis clusters. The numerical lists grew. Storage demand grew with them. In the original model, repeated structure in the keys and values gave LZ4 enough to work with to cut the size substantially. The longer floating-point lists weren't as cooperative: they contained less statistical redundancy for a compressor to exploit. That distinction matters more to this investigation than simply finding a different compression library.
At that point, choosing another compressor could only be part of the investigation. Long decimal representations associated with Python's default double-precision values were also making the stored string larger. The team compared decimal rounding against a different representation built from NumPy arrays. Now the question included precision, not just compression. I'd want that change in scope made explicit before looking at the storage results.
The final pipeline converted those arrays to float16 before turning them into lists, compressed them with Blosc using its internal ZLib codec, and applied Base64 encoding. It then decoded the encoded result as UTF-8 text for inclusion in JSON. I'd write out that whole sequence in an implementation review. Calling it “ZLib compression” is shorter, but it hides too much of what changed. The measured result belongs to the complete pipeline; neither Base64 nor ZLib deserves the credit on its own.
Does Redis compression really save 85%?
For LogicMonitor's larger numerical model, yes. That doesn't establish the same saving for an arbitrary Redis workload. Even within this comparison, the starting sizes aren't all the same. That would stop me from putting the percentages together on a chart without making each baseline plainly visible. Otherwise, the chart would invite a comparison I wouldn't be comfortable making from these results alone.
- LZ4 on the original model: approximately 39,739 bytes became 16,208 bytes, reported as a 60% saving.
- Uniform decimal rounding: approximately 80,000 bytes became approximately 36,000 bytes, reported as a 55% saving.
- Magnitude-dependent rounding: approximately 80,000 bytes became approximately 35,000 bytes, reported as a 56% saving.
- The float16 pipeline: approximately 80,000 bytes became 11,383 bytes, reported as an 85% saving.
These aren't successive reductions to one unchanged payload. In particular, the LZ4 result belongs to the earlier, smaller model. For a comparison in my own service, I'd capture an input and run every candidate against that exact input. Until I'd done that work, I wouldn't read the figures above as a ranking I could transfer directly to my service. They're results worth investigating, not a substitute for that comparison.
LogicMonitor picked uniform rounding to four decimal places rather than magnitude-dependent rounding. The storage results were similar, while the uniform rule avoided the extra complexity and reduced precision of the magnitude-dependent approach. Rounding had an insignificant effect on its algorithm. That's useful validation. I'd be careful about what it validates, though: the rounding experiment passed that check, but the final float16 representation doesn't automatically inherit the result. Those are still different changes to the numbers.
Choosing between lossless compression and fewer digits
Before picking a compressor, I'd ask what the application promises about its numbers. Must the existing values come back unchanged? If so, LZ4 is the lossless candidate in this comparison; LogicMonitor initially chose it for speed and ease of integration. If approximate values are acceptable, I'd put rounding and float16 into the tests too. I still wouldn't choose either without an explicit acceptance test. “Approximate” needs to mean something the application can actually accept.
My preference is to change fewer things at once. I'd first measure compression without changing numerical precision, then evaluate the precision changes separately. Otherwise, I could get a very good storage result and still have no clear answer about which change affected the algorithm. That is an awkward place to finish a test: the byte count is settled, but the question with more consequence for the application remains open.
I'd keep the same distinction in numerical data analysis. Check the stored representation, then separately check what the recovered values mean. Changing values doesn't automatically make a representation the wrong choice, and I wouldn't reject it just for that. What I would reject is a migration that never defines which changes are acceptable. Without that definition, I don't have a basis for deciding whether the recovered model passes.
Testing compressed numerical payloads in an existing service
Capture a reference payload and its behavior
I'd start by keeping an uncompressed reference model, recording its stored size, and preserving the algorithm's output for that input. The test set needs the kinds of numerical lists the service actually stores, not just an example that's easy to work with. A convenient payload that happens to compress well might be useful to inspect. It wouldn't be enough for me to make the decision.
Next I'd measure the complete application path around Redis Get and Set. I'd record compression and decompression work alongside transaction elapsed time, so neither disappears from the comparison. LogicMonitor compared transactions with and without prior compression; I'd preserve that distinction in my own measurements. I want the storage saving to be visible, certainly. I also want to see the additional application processing rather than let the smaller payload obscure the work needed to produce and read it.
For a newsroom feature involving numerical models, my first question would be whether the changed representation preserves the behavior that feature relies on. A result for training arrays wouldn't convince me to treat article bodies or editorial metadata the same way indiscriminately. The presence of Redis doesn't, by itself, give me a reason to change representations. I'd first want a measured payload problem to investigate, then a test tied to the behavior the feature needs.
Isolate rounding with a small fixture
I'd open the precision discussion with something small enough to read without tools getting in the way. This original training-data fragment gives me a fixture for comparing rounding, with the value that changes visible rather than buried somewhere inside a larger model:
{ "algorithm-1-training-data": { "training-data-value": [12.43, 0.4312444] } }
For the matching fixture rounded to four decimal places, that same input becomes:
{ "algorithm-1-training-data": { "training-data-value": [12.43, 0.4312] } }
These are test inputs. They aren't a compression implementation. I'd run both through the algorithm that consumes them and compare the outputs against a tolerance agreed for the application. Then I'd repeat the check with representative captured models. The small fixture has one specific job: it lets me see exactly what rounding changed. It can't establish that every numerical input is safe to round, however reassuring the result from this particular pair might be.
Evaluate the complete float16 round trip
For the encoded-array candidate, I'd follow the actual storage and recovery path all the way through, rather than stop once compression succeeds. Too much is still unanswered at that point. My acceptance checks would ask two separate questions: can I recover the stored representation, and do the recovered values produce acceptable behavior in the algorithm that uses them? I'd need an answer to both before treating the candidate as ready.
I'd keep the original input available for the entire comparison. It gives me a stable reference for checking recovered values and the algorithm's output, not merely a starting byte count to beat. That's also the discipline I want in production AI engineering: decide what acceptable behavior means before getting excited about the smaller artifact. Otherwise, it's too easy for a clear storage result to draw attention away from an unanswered behavior question.
I'd record the chosen representation alongside the model's format information, too. The simplified LogicMonitor model included model and configuration versions, plus a last timestamp for each resource. Each individual training section had its own versions, values, timestamps, and parameters. I'd be just as explicit about the representation choice in my design. Whoever reads the model shouldn't have to guess how a value was encoded, and I wouldn't want that choice left implicit among otherwise explicit format details.
Exercise peak load and recovery before rollout
Compression adds processing work. Under peak load, that extra work can increase latency and reduce throughput. I'd compare the candidates under the same access pattern, including what the application spends on encoding and decoding, rather than look only at the compressed values. A quiet test can still be useful. It just wouldn't settle my deployment decision, because I want to see how the candidate behaves when that processing cost matters to the service.
I'd also need a way back to the previous representation in the rollout plan. That means testing recovery from a failed decode, keeping backups, and verifying retrieval regularly. An altered bit can leave a compressed block unreadable; error checking and validation are part of dealing with that risk. I want the failure path to be deliberate and tested. I don't want the consumer's first encounter with it to be an unexpected exception after the representation has already changed.
The float16 accuracy gap still needs an answer
The final representation has a clear result for stored size. Numerical accuracy is another matter: it isn't quantified. That's the unanswered question I care about most here. The compression result is attractive, but I wouldn't use it to wave away the missing accuracy check. An insignificant effect from decimal rounding on one algorithm doesn't validate a different representation, even if both approaches make the stored model smaller.
I'd ask for acceptable error at the algorithm boundary, not just a successful decode. Recovering an array shows that the representation can be read. Whether I'd accept it depends on what the application does with those recovered values, and on whether that behavior stays within the agreed variation. If nobody can define acceptable variation yet, I'd stay with a lossless option while that requirement gets clarified. A passing decode test cannot settle that requirement for us.
There's no published numerical latency benchmark here that I could carry into a capacity plan, either. Compressed transactions showed substantial elapsed-time improvements in LogicMonitor's comparison, but the measurements needed to estimate the improvement for another service are absent. I'd keep my claims inside that limit. The storage percentage alone isn't enough for a performance promise, and I wouldn't turn it into one just because the transaction comparison points in an encouraging direction.
When I would leave the payload alone
If stored size is already acceptable and processing capacity is constrained, I wouldn't adopt the float16 pipeline just because it produced the smallest model in this comparison. I'd make that decision around the resource actually limiting the application, as well as whether the algorithm tolerates the representation. The smallest stored value doesn't answer either question on its own. For me, those unanswered questions would matter more than winning the byte-count comparison.
Before committing every value to the same treatment, I'd test selective compression as well. Compressing certain data types or less frequently accessed data is another option in this comparison, and I'd give it a place in the test rather than assume every payload needs the same handling. If processing cost becomes the constraint, I'd also evaluate a lightweight compressor such as LZ4. I wouldn't keep chasing a smaller payload while leaving that processing constraint unanswered.
For the next test, I'd keep the original numerical training arrays as the reference and run lossless compression first. If the remaining storage demand justified a precision experiment, I'd then put the float16 pipeline through the full round trip. Before shipping it, I'd require three checks to pass: the recovered model, the service under load, and the recovery path. I'd write down the acceptable algorithm error before running that experiment, not after seeing the smaller byte count. If that tolerance still can't be defined, I'd leave the precision unchanged.
Sources
https://www.trickyworld.in/database/nosql-databases/redis-compression-logicmonitor-s-85-reduction/
This is the source this article is based on. Many articles on this blog are drafted with AI and checked against their source automatically; the editorial policy explains how, and how to report a mistake.
Frequently asked
Is this a Redis server compression setting?
No. This approach transforms the payload in the application before storage. The application must also recover the encoded representation when reading it.
Should I replace LZ4 with Blosc and float16?
I would not switch based on the reported percentages alone. LZ4 was tested on a different, smaller model. I'd compare both approaches on the same payload and validate the numerical effects of float16 separately.
Does Base64 produce the reported storage saving?
The reported saving belongs to the complete pipeline: float16 conversion, Blosc with its internal ZLib codec, and Base64 encoding. It is not a result attributable to Base64 alone.
Will compression make Redis Get and Set faster?
LogicMonitor observed elapsed-time improvements for compressed transactions, but no numerical latency benchmark is provided here. Extra application processing can also increase latency and reduce throughput under peak load, so I'd measure the complete path.
Weekly newsletter
Liked this? Get the next one by email
One short email a week with new articles on React, Node.js, TypeScript and AI engineering. No spam. Unsubscribe in one click.
Further reading
Related tutorials from ByteMuni, my developer publication.
- JavaScriptTypeScript in Rust: What the tsrs Port Means for DevelopersTsrs offers a Rust-based enhancement of TypeScript, bringing speed and memory improvements.
- Node.jsWhat's New in Node.js 24.22.0 LTS: Key Changes for DevelopersNode.js 24.22.0 introduces new crypto, net, and performance features.
- SQL Databasespg_hint_plan 1.9.0: Updates and Compatibility with PostgreSQL 19Pg_hint_plan 1.9.0 with PostgreSQL 19 support and key updates.