Too Many Parts
Easy · system design problem
Every service inserts its events into ClickHouse one row at a time. A traffic spike doubles the inserts and the merges cannot keep up.
event-api writes each event into ClickHouse with its own INSERT: 5,000 single-row inserts/s. Every INSERT creates a data part that ClickHouse must merge, so a single-row insert costs about as much as an analytical query. Analysts query the same cluster. At T+20s a campaign doubles events for the rest of the day. Events may reach ClickHouse up to a minute late; resharding would mean re-inserting the history.
Topics
More
Codelays runs in your browser: turn on JavaScript to use it.