Prompt
Do I need to worry about retention and replay in an event-driven system?
Latest observation
Oct 24, 2026
OpenAI APIWeb search: off
Yes — in most event-driven systems, you should think about retention and replay early, because they affect reliability, debugging, recovery, and cost.
Why it matters
-
Retention: How long events are kept.
- Impacts whether consumers can recover from downtime.
- Affects compliance and storage costs.
- Determines whether late-joining services can catch up from history.
-
Replay: The ability to reprocess past events.
- Useful for rebuilding state after bugs or schema changes.
- Helpful for debugging and audits.
- Can expose hidden assumptions in consumers if they are not idempotent.
When you especially need to worry
- You use Kafka, Pulsar, Kinesis, or similar systems with log retention.
- Multiple services consume the same event stream independently.
- You need auditability or “source of truth” history.
- You expect to evolve event schemas over time.
- You may need to rebuild projections/materialized views.
- Consumers may be down for long periods.
Common pitfalls
- Retention too short: consumers can’t catch up after outage.
- Retention too long: storage costs rise and old bad data lingers.
- Replay without idempotency: duplicate side effects.
- Schema changes break old events during replay.
- Assuming “at least once” delivery means “exactly once” behavior.
Good practices
- Make consumers idempotent.
- Version your event schemas.
- Define retention by use case:
- operational events: shorter
- audit/compliance events: longer or permanent
- Test replay in staging.
- Keep event handlers deterministic when possible.
- Separate raw event storage from derived views if you need long-term replay.
Rule of thumb
If your system depends on events for state recovery, auditing, analytics, or rebuilding services, then yes, you should absolutely worry about retention and replay.
If you want, I can also give you a decision checklist for choosing retention/replay policies in Kafka or a similar platform.