Maximum compression ratio with Zip/Gzip/Deflate

Quite a while ago an issue was reported for Akka HTTP where incoming data, compressed using Content-Type: gzip, was uncompressed without applying any limits, in the worst case leading to an OutOfMemoryException and a shutdown of the server. This can be used for a classical denial of server attack, a…

Base64 vs. Gzip

For personal projects I mostly try to avoid using databases. Instead, I try to use what I call the "JSON repository" pattern. I create a file structure that contains my data in JSON format. I often use the directory structure as an index by placing the JSON data…

Losing Track (Part 2)

In part 1, I introduced the problem of debugging cycling code using stack traces. We have seen that we already lose debugging information if tail call optimization kicks in. Let's see what happens if the control flow isn't linear but there are concurrently running threads of execution. Let's run concurrently…

Losing track (Part 1)

Code has bugs. If you are lucky you spend only half of your life as a coder on debugging code. Most kind of bugs are easy to find and simple to fix. However, there are kinds of bugs that are hidden deeply under a stack of indirection. In that case,…