Reputation: 3322
I am trying to understand how event driven architecture is more efficient than traditional architecture. Of course it is loosely coupled.
Lets imagine this. We have 2 spring-boot microservices.
micro-service-A raises an event and micro-services-B listens to the event and does some action. With EDA approach, micro-service-B processes all those events sequentially one by one. In order to scale , I have to run multiple micro-service-B instances. But If I had used traditional approach, multiple HTTP requests would have been processed in parallel by a single server. So, with EDA approach, single threaded and sequential processing is not a good way of resource utilization right?
Upvotes: 1
Views: 1561
Reputation: 19640
Event-driven doesn't imply linear event streams, event ordering or using Kafka for that matter.
Just as it has nothing to do with Event Sourcing, Domain-Driven Design or sagas. All you need to do is publish an event to some messaging infrastructure, so downstream systems can consume it.
Event-driven is essentially messaging. It's not new and all messaging patterns are properly described in the "Patterns of Enterprise Application Architecture" book by Martin Fowler. There is nothing in messaging that says a single word about sequential single-threaded processing.
Just as you load-balance HTTP calls, you use competing consumers with a message broker to scale horizontally. All popular message brokers support competing consumers, it's a well-known pattern that the industry uses for decades.
Upvotes: 0