Splitter Pattern By David Boyne
Splitter Pattern By David Boyne
EDA visuals and the book is free thanks to our sponsors:
The Splitter Pattern from Enterprise integration patterns, takes an event/message and splits it into many for downstream consumers.
Splitting Messages
- If you have a large message/event you can use a splitter to split it into many messages/events for downstream consumers.
- Using a queue an example could be the splitter takes a message from a queue, splits it and puts it back onto a new queue/channel.
- This pattern can be helpful if you want to process large messages or events, or have a business use-case where it might make sense to split. Example could be taking an order and splitting into it’s sections (as seen here).
Enrich with original event
- When you split your event, you may want to duplicate the information into the child events, depending on your data strategy. If you duplicate then downstream consumers may have the information they need to process, or the can go back to producer/API to get information they need.
- Splitter consumes original event, uses information to build payload for child events.
Change data capture into many events
- Databases that support change data capture events allow us to react to events when data is changed in databases.
- An example use-case could be listening for database changes (using change data capture) and transforming these events into multiple events downstream.
- An example of this could be using DynamoDB stream, into EventBridge Pipes to create many events downstream. Example here.
Extra Resources
- Splitter pattern from enterprise integration patterns - This pattern is from the enterprise integration pattern book, if you want to learn more, recommended checking this out.
- Aggregator pattern - The opposite to the splitter, this takes events in, aggregates them into one message/event downstream.
- Example using DynamoDB with EventBridge Pipes - Some code examples to show you how you can do this with AWS services, all open source.
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.