Reputation: 352
I'm researching event-based architecture patterns, and in the context of the current project, I'm wondering, if it's acceptable to use an event bus in a monolithic application that supports context separation, in order to provide better isolation, or is it redundant?
Thanks!
Upvotes: 2
Views: 2193
Reputation: 644
For this purpose I will assume you mean event driven messaging rather than event souring. for example the customer subsystem will raise a customer created event, which the marketing subsystem could consume.
Seems fine to me, though it depends on if your application needs the properties granted by events. The decision to use events or not is, in my opinion, separate from if you are doing a monolith or micro-services.
The main advantage of event driven systems is that independent sections of the system can decide for themselves if they want to react to a specific event or not. though this adds complexity because now there is no one definition of a process, anything can listen to any event (in theory) and react as it wants.
So I would say it is more down to how your wish to model the problem domain.
If you are using a separate message broker or queue system, in addition to adding features like message persistence, it could be useful in the future if you decide to extract parts of the monolith into other processes.
Upvotes: 4