BranislavLazic / akka-cqrs-activator

Issue tracker PoC application written in Scala (Akka) and JavaScript (React) that demonstrates event sourcing and CQRS
Apache License 2.0
32 stars 2 forks source link

[Discussion] Scalability #3

Closed kennedyoliveira closed 7 years ago

kennedyoliveira commented 7 years ago

Hello!

Thank you for making this source code available, it's very useful, i'm studying akka and searching for patterns, best practices and ways of doing things, and i have a doubt based on this implementation.

How it's supposed to scale? Since it creates a new Actor for each issue, if a have billions of issues, how can i scale it?

BranislavLazic commented 7 years ago

Hi. In such scenario, I would probably introduce Akka cluster sharding for the IssueRepository actor and add more Cassandra instances in its cluster. In such case, I would have an even distribution of load over the cluster of application instances (sharding region). You can take a look at Reactive Flows. As far as I remember, that example covers scaling too while my example is mostly focused on ES and CQRS.

kennedyoliveira commented 7 years ago

Hello @BranislavLazic, thanks for the answers, i'll check the link you pointed, looks like a great example too! I'll check akka cluster sharding, i still didn't used this one. I have a question, maybe learning the cluster sharding would answer it, but i'll ask anyway, using sharding, the IssueRepositoryManager would still be needed?

BranislavLazic commented 7 years ago

Yes. To forward messages toward issue repository sharding region.

kennedyoliveira commented 7 years ago

Thank you!