Using events to migrate from legacy architectures By David Boyne
Using events to migrate from legacy architectures By David Boyne
When we build event-driven architectures we use events to communicate between services and domains, these events are often used to trigger async processes downstream, and we can use event-driven architectures to create decoupled and scalable solutions.
It’s also important to know that the events we use to communicate can also be valuable for businesses and create new opportunities (e.g. Using events to process data in real-time).
Rather than going big bang migrations that could take months or years, slice up your architecture/features and delivery them over time (commonly seen in strangler pattern). We can use events here to help us, and move us towards an event-driven architecture.
Fire events from legacy applications
- Integrate your legacy application with your event/message broker
- Requires up front cost, but allows you to start publishing events from application
- Downstream consumers (new architecture) can consume events
- Cloud example pattern could be using
PutEvents
from Amazon EventBridge to publish events from legacy application into AWS, where new consumers can react.
Mapping into new domain models
- Careful not to take “legacy events” as they are, you may want to map them into a new format/domain for your architecture
- Make sure legacy implementation details in events are not integrated within your new architecture (unless you identify that the models are similar)
- Use context mappings to map events from a legacy language into a new one. You have options here: Conformist pattern, anti-corruption Layer, open-host service.
Domains may have evolved
- Your legacy application may have been written years ago, things change. Your models/domains may have changed from inception years ago.
- Use techniques like Event Storming to highlight existing behaviours of your system and new domains you want to evolve into.
- You don’t have to mimic the same language in your new architecture. You may want to start using bounded contexts and ubiquitous language away from your legacy application (if it makes sense)
Extra Resources
- Minimum Variable Migrations - Some of these ideas were inspired by the work Ben Ellerby is doing with Minimum Variable Migrations.
- Find events in your exisiting application - EventStroming can help you identify events for new applications, but also systems that already exist, this can help find events in your legacy application.
- To conform or not conform to legacy events? - Careful taking events from legacy applications as they are (conformist pattern), you may want to map. This visual can help
Explore other visuals
Want to work together?
If you're interested in collaborating, I offer consulting, training, and workshops. I can support you throughout your event-driven architecture journey, from design to implementation. Feel free to reach out to discuss how we can work together, or explore my services on EventCatalog.
Download EDA Visuals
Join over 10,000 others learning EDA and download all the EDA visuals directly to your computer. This document updates everytime a new visual is added so make sure you come back to get the latest.