This is our second pseudo-production release of the Contoso Conference Management System. The plan was to explore the migration process to understand better how this works in a CQRS/ES implementation and to see if we could perform a no-downtime upgrade with our current infrastructure.
The picture below depicts a portion of our migrated read models (only some of which are actually in SQL Azure).
The following user stories made it into the release:
Providing a better user experience for zero-cost orders (in V1 the registrant was still taken to the payments system even if there was nothing to pay).
Displaying the number of remaining seats of each seat type in the UI (since there was no read model for this in V1).
Applying UX designs to the Conference Creation/Management BC.
Unfortunately, it was not possible this time to perform a no-downtime upgrade. This was due to:
- The fact that we weren’t storing all the integration events needed in order to regenerate some read models, nor did we have an API for querying the state of the system from an external Bounded Context. So we now have a message log for every message that goes through the service bus.
- Because of this, we have also decided to migrate the event store infrastructure to account for the additional metadata that the message log requires, and we will use as the base for replaying events when regenerating read models (as the message log is much easier to query and is already sorted by time).
Our migration resulted in ~6 min downtime.
Now that we have the infrastructure in place, a no-downtime upgrade seems to be an attainable goal for our V3 release.
In addition to the behind-the-scenes changes listed in the previous post, the team made the following changes:
- As mentioned above, there is a now a message log that persists all commands and events. This grew out of the need to persist the integration events. In addition to regenerating read models from events, this is also intended to future-proof the application by capturing everything that might be of interest at some point in the future.
- The Conference solution now includes a migration program to migrate the data to the new event store, re-create the integration events that the V1 release did not persist, and rebuild the read-models with additonal data.
- Several bug fixes (see the backlog for V2 or the commit history)
We are now starting work on V3 and you can track our progress against the V3 milestone.