advanced
Event Sourcing Architecture Design
Design a complex event sourcing system with a focus on consistency and event versioning.
📝 Contenido del prompt
Design the core architecture for a high-frequency trading platform using Event Sourcing and CQRS. Specifically, address how you would handle event schema evolution over time when the structure of domain events changes. Explain the mechanisms for: 1) Converting old events to new formats on-the-fly during replay (upcasting). 2) Ensuring eventual consistency across read models in a distributed environment. 3) Handling duplicate events or out-of-order delivery. Provide a detailed logical flow for the 'Command Handler' and 'Event Store' interaction, including error handling and rollback considerations for transactional integrity.