_examples/basic/6-cqrs-ordered-events/README.md
This application is using Watermill CQRS component.
Detailed documentation for CQRS can be found in Watermill's docs: http://watermill.io/docs/cqrs#usage.
This example, uses event groups to keep order for multiple events. You can read more about them in the Watermill documentation. We are also using Kafka's partitioning keys to increase processing throughput without losing order of events.
This application manages an email subscription system where users can:
The system maintains:
In this example, keeping order of events is crucial.
If events won't be ordered, and SubscriberSubscribed would arrive after SubscriberUnsubscribed event,
the subscriber will be still subscribed.
In this example, we are using global events and commands topics.
You can consider splitting them into smaller topics, for example, per aggregate type.
Thanks to that, you can scale your application horizontally and increase the throughput and processing less events.
docker-compose up