akka-blog-example icon indicating copy to clipboard operation
akka-blog-example copied to clipboard

Scalability consideration

Open idoshamun opened this issue 8 years ago • 2 comments

First of all, I would like to thank you for the great blog post and code example!

Second, I have followed many blog posts about Akka and event sourcing and all of them use in-memory storage for storing the current state of the application. In your case it is the blog posts lists, what happens in case when the list is getting very big, like millions of posts, how does Akka handle it?

idoshamun avatar Jul 29 '17 16:07 idoshamun

What I'd do is start splitting up posts by author. I can't imagine any one particular blogger would write more posts than can be stored in memory. From there, you could also shard by date and not bother loading up older posts into memory until necessary. Really, the design tradeoffs would be completely relevant to how quickly you need the data available.

jvz avatar Jul 29 '17 22:07 jvz

I have seen also an implementation of creating a dedicated actor for each entity. For example, an actor for a blog post and then you can create a repository actor to supervise everything. But everything feels a little bit like implementing a database, don't you think?

idoshamun avatar Jul 30 '17 05:07 idoshamun