These are chat archives for RBMHTechnology/eventuate

19th
Jan 2016
Mike Mazur
@mikem
Jan 19 2016 04:46
Consider a web app which uses Eventuate. It stores events in Cassandra. If I want to run multiple instances of the web app behind a load balancer, will I need to configure each instance as an Eventuate location?
I think I’ve asked this question before and know the answer...
Martin Krasser
@krasserm
Jan 19 2016 07:16
@mikem I discussed a related question with @Tvaroh some times ago. Assuming your setup uses wep app instances that share the same Cassandra cluster, their availability is not independent of each other any more, so it makes only limited sense to configure them as individual locations. You may therefore want to consider them as part of the same location. Within a location, event-sourced actor should be operated as singletons, failing over to a backup instance if the primary fails. An exception is discussed here. Dedicated support for configuring application cluster nodes as individual locations will come with RBMHTechnology/eventuate#143.
Mike Mazur
@mikem
Jan 19 2016 07:29
@krasserm right, I remember reading through that conversation.
You say within a location, event-sourced actors should be operated as singletons — so that means a single instance running per location. In my case, I’d have N app servers running behind a load balancer, but they would all talk to a single instance of an event-sourced actor?
Martin Krasser
@krasserm
Jan 19 2016 07:47
@mikem Within a location, we usually operate Eventuate in a similar way as akka-persistence. Use whatever tool is needed to ensure cluster-wide singletons. On the other hand, if you want to run each app node as separate location, be aware that this has additional event replication overhead across between locations. If this is ok for you, nothing speaks against that setup (except the availability dependency mentioned before).
Martin Krasser
@krasserm
Jan 19 2016 07:56
@mikem What you can not do is to write to the same local event log from two different JVMs. Both EventLog actor instances would modify the same event table in Cassandra and likely overwrite their entries. An local EventLog instance must be a single writer. Multiple local EventLog instances can be connected to a replicated event log via ReplicationEndpoints to support concurrent writes at multiple locations (each having its own local event log).
Mike Mazur
@mikem
Jan 19 2016 07:59
Yeah, this is becoming clearer. Currently each app has its own instances of event-sourced writers, so the easiest way forward it to have each app be a location. If we extracted our event-sourced writers into a service, then each app server could talk to that single service.
Do you have a description of a setup similar to what you’re doing you could share? You mentioned it’s similar to akka-persistance.
Martin Krasser
@krasserm
Jan 19 2016 08:09
We plan to write blog posts later this year describing the setup and architecture we're using at RBMH but there's nothing I can link to at the moment.
Mike Mazur
@mikem
Jan 19 2016 08:14
Alright, no worries. So am I on the right track? One JVM which is a “service” that has event-sourced writers, and process all commands. Other JVMs interact with this service when they receive commands.
Martin Krasser
@krasserm
Jan 19 2016 08:23
Yes, that's an option. BTW do you mean event-sourced writers (EW) or actors (EA)? EAs are usually those that process commands to produce new events. EWs only consume events and write to a query DB.
Mike Mazur
@mikem
Jan 19 2016 08:23
I meant event-sourced actors. Thanks for catching that :-)
Martin Krasser
@krasserm
Jan 19 2016 08:24
Alright :smile: