Your team wants to rebuild a derived table by replaying a topic from the start. What do you check before doing it?
Sketch your own answer first, then compare it with the one below.
A strong answer
First, retention. The log holds only what its retention window keeps. If the history you need was deleted, replay cannot recover it, and a compacted or archived copy is needed.
Second, side effects. Consumers that act on messages, such as sending email, must not repeat effects during a replay. Use a separate group for the rebuild, with output going to a new table, and switch over when it has caught up.
Third, capacity and ordering. A replay competes with live traffic, so throttle it. Keys must stay in order, and the code has to handle old message formats. All of this works because a log does not delete messages on read.
Sources
- Jay Kreps, Neha Narkhede, Jun Rao (2011). Kafka: a distributed messaging system for log processing.
- Martin Kleppmann (2017). Designing Data-Intensive Applications.
- Tyler Akidau and others (2015). The Dataflow Model.