Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed Elixir Compatibility #62

Closed
benwilson512 opened this issue Jul 16, 2017 · 4 comments
Closed

Distributed Elixir Compatibility #62

benwilson512 opened this issue Jul 16, 2017 · 4 comments

Comments

@benwilson512
Copy link

Hey!

I'm really just getting started along the process of evaluating CQRS as a pattern for us, and I'm curious if you can speak to how this works in a clustered environment. Using something like Postgres for the actual event log solves the issue of having a consistent view of events but how does that work for any in memory state held?

We're looking at an upcoming project that seems to be a good fit for a CQRS/ES approach but I confess I'm still at the point where it makes sense as a diagram on someone's slide deck but I am unclear about what a project's code actually looks like.

@slashdotdash
Copy link
Member

slashdotdash commented Jul 16, 2017

The short answer is that it doesn't. Commanded only supports running on a single node. There's an open issue to support running on a cluster of nodes (#39) and an open pull request with further discussion on this topic (#60).

The approach will likely be to distribute aggregate, event handler, and process manager processes amongst the nodes in the cluster. So they run as singleton instances, but the load is distributed (e.g. user1 aggregate on node1, user2 aggregate on node2). In a net split scenario only one half of the cluster will continue functioning. This is to ensure consistency and prevent duplicate aggregates/handlers running. I'm open to suggestions, and pull requests, for alternative ways of tackling this.

An alternative approach, that you could implement now, is to use a single event store and Commanded instance per bounded context (microservice). Then you can deploy each service to its own node for distribution. You would need a way of message passing between each service for commands and events. This could be a REST API endpoint for commands and an event handler that pushes events onto a message bus for the other services to consume.

Feel free to chat about Commanded on Gitter.

@benwilson512
Copy link
Author

Gotcha. Is there any literature on established techniques used in other platforms?

@slashdotdash
Copy link
Member

slashdotdash commented Jul 16, 2017

Here are a couple of relevant projects that implement distributed event sourcing:

@slashdotdash
Copy link
Member

Closing this issue. Refer to related issue "Support running on a cluster of nodes" (#39) instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants