Streams and Schema Evolution
Moving data between systems without losing or corrupting it. Covers logs and consumer groups, what exactly-once really means, change data capture, event time and late data, and how to change a schema without breaking anyone.
Lessons
- 01Ask whether the input ever endsA batch job reads a finished input and exits, while a stream processor reads input with no end and must decide when each result is ready.
- 02Treat the log as the backboneA partitioned log keeps records after they are read, so many consumers can move through it independently, with ordering guaranteed inside each partition.
- 03Get one effect from repeated deliveryIn practice, “exactly once” means a record may be delivered more than once while its effect is applied only once.
- 04Follow the database’s own logChange data capture reads committed changes from a database’s replication log, so derived copies such as search indexes and caches can follow without extra writes in application code.
- 05Decide when a window is completeGrouping events by when they happened rather than when they arrived requires a watermark, an estimate of when a time window has all its data.
- 06Change a schema while old data existsOld and new code read each other’s records during a rollout, and a log keeps old records for longer, so every schema change needs a compatibility direction and a deployment order.