1

I'm creating a set of Microservices following Event-Driven Architecture using Event-Carried State Transfer to move state from one service to another.

Given the following services;

  • Order service
  • Shipping service

The Shipping service will subscribe to OrderStarted, ProductAddedToOrder OrderAccepted events and use those events to build up a local datastore.

However, I'm a little confused as to whether an enterprise service bus (Azure Service Bus) or an event streaming service (Azure Event Hubs, Kafka etc) would be more appropriate.

For this type of architecture which would be more ideal and why?

1

For your scenario, an enterprise service bus like Azure Service Bus is better suited as they are designed specifically for it. Because of this, you can benefit from several features like retries, automatic deadlettering, transactional sends with receive, automatic deduplication, etc.

Event streams are most suited for scenarios with huge amounts of events (even millions per second) where the speed of processing is what's most important, that's why some of the previously mentioned features are not available (to make the message delivery as light as possible).

  • Event streams have another benefit: they are a data source. You can treat the event stream as the single source of truth and consider all databases as derived views of that event stream. See for example the NYT architecture: confluent.io/blog/publishing-apache-kafka-new-york-times – Joeri Sebrechts Jan 8 at 8:30
  • What you mention is not a benefit of Event Streams, but of Event Stores. You can use Kafka as an event store, but you can't use Azure Event Hub for that ("Event Hubs Standard tier currently supports a maximum retention period of seven days. Event hubs are not intended as a permanent data store."). In any case, I wouldn't personally go that route for the question's scenario. I still prefer the benefits from the service bus that I mention in my answer. But thanks for the article, it's very interesting. – Francesc Castells Jan 9 at 6:32
  • Ordering is quite important given the pattern we are using. I think Event Hubs ordering is a lot easier to manage over Service Bus's sessions however the other features of Service Bus are appealing. – fml Feb 7 at 12:15
  • I personally don't like to rely on the transport to ensure message ordering. You can deal with out of order messages in your code when it makes sense, as it's not always necessary. In most cases, if an unexpected message arrives, sending it back to the queue and retrying later solves the ordering problem. – Francesc Castells Feb 10 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.