McKabue
McKabue

Reputation: 2222

CQRS and Event Sourcing Guide

I want to create a CQRS and Event Sourcing architecture that is very cheap and very flexible and very uncomplicated.

I want to make sure that events never fail to at least reach the publisher/event store, ever, ever, because that's where business is.

Now, i have several options in mind:

Azure

With azure, i seem to not know what to use.

  1. Azure service bus
  2. Azure Function
  3. Azure webjob (i suppose this can be replaced with Azure functions)
  4. ?? (something else i forgot or dont know?)

How reliable are these azure server-less solutions??

Custom

For this i am thinking of using RabbitMQ, the problem is the cost of a virtual machine to run it.


All in all, i want:

  1. Ability to replay the messages/events in case of failure.
  2. Ability to easily add subscribers.
  3. Ability to select the subscribers upon which to replay the messages.
  4. The Event store should be able to store very large sizes of event messages (or how else shall queue an image or file??).
  5. The event store MUST NEVER EVER get chocked, or sleep.
  6. Speed of implementation/prototyping would be an added advantage.

What does your experience suggest?

What about other alternatives? (eg: apache-kafka)?

Upvotes: 1

Views: 841

Answers (3)

kboom
kboom

Reputation: 2339

Your requirements are too vague to make the optimal choice. You need to consider a lot of things, one of them would be, for instance, the numbers of events per one aggregate, the number of aggregates (note that this has to be statistical). Those are important primarily because if you allow tens of thousands of events for each aggregate then you would need to have snapshotting which adds complexity which you might not need.

But for regular use cases you could just use a relational database like Postgres as your (linearizable) event store. It also has a listen/notify functionality to you would not really need any message bus either and your application could be written in a reactive way.

Upvotes: 0

kimathie
kimathie

Reputation: 426

I am a java user, I have been using hornetq (aka artemis which I dont use) an alternative to rabbitmq for the longest; the only problem is it does not support replication but gets the job done when it comes to eventsourcing. For your custom scenario, rabbitmq is a good choice but try running it on a digital ocean instance for low costs. If you are looking for simplicity and flexibility you have only 2 choices , build your own or forgo simplicity and pick up apache kafka with all its complexities but will give you flexibility. Again you can also build an eventstore with mongodb. https://www.mongodb.com/blog/post/event-sourcing-with-mongodb

Upvotes: 0

Adam Dymitruk
Adam Dymitruk

Reputation: 129564

Why not run Event Store? Created by Greg Young himself. Host where you need.

Upvotes: 2

Related Questions