Rust ingestion and indexers
The problem
Most ingestion code is Python, and most of the time that is the correct choice. Some paths are different. A websocket feed sends many messages a second. An indexer must decode every block and keep up with the chain head. A parser runs on every event and its cost adds up. In these paths, garbage collection pauses, high memory use or slow parsing become the bottleneck.
What a good solution looks like
- A small, single-purpose service. It reads one source, decodes it, and writes typed records. Business logic stays in the warehouse.
- Predictable memory. No unbounded buffers. A queue between reader and writer with a fixed size, and a clear rule for what happens when it is full.
- A measured hot path. Latency and throughput are measured on recorded data, so a change can be compared with the last version.
- The same contracts as the rest of the platform. The service writes the same schema that the Python loads would write, so the warehouse does not care which one produced a row.
- Replay from a capture. Recorded input lets you test a fix against the exact data that broke the last version.
How DataBlock approaches it
- Measure first. Find where time and memory go in the current path. Often a fix in the existing code is enough, and DataBlock will say so.
- Replace only the hot path. Keep orchestration, models and tests where they are.
- Build with replay and benchmarks from the first commit.
- Hand over with docs, a benchmark your team can run, and a runbook.
DataBlock builds its own tools in Rust, such as the static site generator behind edwardplata.com. Edward Plata also built Titan, a C++20 market-data ingester that keeps in-memory order books from a public websocket feed and measures tick-to-book latency on every update. Its hot path uses no locks and no heap allocation. The write-up is on edwardplata.com.
Service
This use case maps to Web3 data for indexers, and to data platform engineering for other ingestion paths. DataBlock does not sell general Rust development.
Is one ingestion path slowing down your whole platform?