Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing Domain Events (DDD-CQRS) on Azure

Microsoft docs provides an article on "Domain events: design and implementation" for DDD & CSRS.

How could domain events be implemented on Azure. In particular which Azure services are suitable, and how do you combine them.

Relatively little has been written on this topic so far. This presentation seems good. In part it talks about possible implementations; e.g. Azure Functions vs Azure Logic Apps; and Azure Service Bus vs Azure Event Grid.

like image 790
Neil Avatar asked Aug 12 '18 05:08

Neil


Video Answer


1 Answers

I suspect you are talking about integration events, not domain events. In the second paragraph of the article you linked to it describes the difference, which is basically that domain events are created and consumed within the domain (normally, but not necessarily, in the same address space), while integration events tie different domains together. Domain events can be managed using an in-process mediator service such as Mediatr. Integration events would be sent out to some external service for delivery.

You should also make sure you are working with events and not messages. Messages are typically short lived, carry a full data payload, and request some action to be performed. Events are short or long lived, carry a minimal payload, and notify interested parties that an action has already been performed.

The other decision you need to make is if you want an event stream or simply distribution. A stream will keep the events around for an extended period of time (days, weeks, months) whereas distribution will throw the event away after push-delivery to all subscribers.

Here is a good article on the three Azure options available – Event Grid, Event Hubs, and Service Bus. Service Bus is for messaging, Event Hub is for event streams, and Event Grid is for event distribution.

like image 131
Brad Irby Avatar answered Oct 01 '22 06:10

Brad Irby