A pipeline that drops data under load gives no sign of it. That is the failure I design against first.
A data pipeline here means the chain of programs that takes records in from many sources, reshapes them and stores them. I build them by four rules. The main place I applied them is the multi-tenant SIEM, and the observability platform is how I watched its pipeline.
- Taken inmany formats, one common schema
- Taggedtenant and data type attached
- Routedby explicit rules in configuration
- Storedtags still attached
- Replay keeps original timestamps
- Every stage throughput, queue, time
Slow down before dropping
Backpressure is what happens when a stage that cannot keep up makes the stage before it wait. I choose it over dropping records because a slow upstream is visible and dropped data is not. A queue that is backing up shows on a dashboard.
Make a stage safe to run twice
A stage is idempotent when running it twice gives the same result as running it once. I make stages idempotent where possible, so a retry does no harm.
Replays are the harder case. Historical data sometimes has to go through again, and it gets a dedicated path that keeps each record’s original timestamp. Without that, last month’s data would arrive stamped with the time it was replayed.
Keep routing in configuration
Records arrive in several formats and are normalized to one common schema with consistent metadata. The tenant and the type of data are attached when a record is taken in, and they stay attached through to storage. Where a record goes is then decided by explicit rules in configuration, not by logic buried in code.
Measure every stage from the first version
I treat instrumentation as part of the first design, not as a later optimization. Each stage reports its throughput, its queue depth and its processing time. With those three numbers per stage, a slow pipeline can be traced to the stage causing it.
Scott Tompkins