Examples of Lossy Systems

Toggle original/dithered image

Lossy Systems

There’s a pattern in software engineering which I call the ’lossy system’. A ’lossy’ system is any system designed to return only incomplete answers, either to make a problem at all tractable, or just to keep costs down.

Data compression is the easiest example. If you’re fine with storing “imperfect” images, you use JPEG. JPEG will throw away some of the data inside of your image, in return for making the image smaller.

The lines are blurry: Is reaching for the most common image format a “lossy system pattern”? No, not really. Yes, lossiness is built into JPEGs, but reaching for them is just the industry standard.

It becomes a pattern when you make a deliberate decision to drop data that you were previously processing, to approximate data, to compress, or to serve stale data, etc.

Big fucking whoop, who cares, etc., why is any of this interesting?

Sufficiently large systems inevitably become lossy. It’s what lets them scale, it’s also what makes big tech so complex, and explains why YouTube or Twitter’s algorithm only serves you hot garbage (maybe).

Additionally, your system is already lossy. Any distributed system has to account for data being dropped, components breaking, etc. Some systems are designed around this and resilient, other systems just break entirely.

In the following, let’s go over a short list of examples, each of which illustrates a different instance of what lossy systems look like.

This post is not going to be deeply technical, and it’s not a complete list. It’s just examples. Concepts. To get the basic shape. I may come back to it if I ever figure out a clean taxonomy.

Examples

No, really, why does it matter?

You live in a society governed by technology.

A small script on your computer behaves fundamentally differently from the mess that’s a big tech corporate technology microservice stack.

Understanding a few principles of how large-scale systems work may help you understand the technology that surrounds you.

We can couple our examples to obtain a worst possible outcome:

You urgently need to go somewhere. You reach for Google maps and enter the information you received. Now, imagine that:

  1. For whatever reason, the worker process that would’ve found the place you are looking for never returned. Therefore, you cannot find the place on Maps.
  2. When you try to repeat the search, the previous result was cached. So instead of finding it on the second search, it keeps telling you that the place doesn’t exist.
  3. Due to sampling reasons, your complaint / bad experience never even makes it anywhere, it just silently gets dropped.

This is (almost certainly) not how Google Maps actually works, but you can see the issue. Each piece of lossy friction within the system can increase the risk of errors or data loss, and multiple errors can combine into something worse than the sum of their parts.


  1. i.e. you cannot just count the number of queries you receive. ↩︎

  2. i.e. you cannot just check how many users are signed up, some of them are not using your service right now. ↩︎