intermediateSubscription Queries & Event Replay

Why is it safe to delete a projection's read model table and rebuild it from scratch?

It's safe because a projection is a derived, disposable calculation over the event store, never the actual source of truth. The event store holds the complete, permanent history of everything that has ever happened, and a projection is nothing more than that history processed through the projection's event-handling logic into a query-friendly shape. Deleting the read model and resetting the relevant tracking event processor's token causes Axon to replay every event from the very beginning, rebuilding the read model exactly as it would have looked had the current projection code been running from day one. This is what makes it possible to fix a bug discovered in a projection's logic months after it went live: correct the code, delete the read model, and replay — no manual data migration required, and no risk of missing a row.

Ready to master this question?

Generate a complete walkthrough — background, the full answer in plain language, a working code example explained line by line, a real-world scenario, common mistakes, and how this same question gets asked in different ways.

Sign in to generate a response

Next Step

Continue to When is it acceptable for one microservice to keep a local copy of data owned by another service?← Back to all Event-Driven Microservices questions