-
Notifications
You must be signed in to change notification settings - Fork 55
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
Read Preference of Event Consumer #23
Comments
Sure I think that's doable. It should be a fairly small change to both drivers. If you want to use replica sets, you should also use the Majority write concern instead of simply Journaled. After reading a couple of aphyr's posts on MongoDB, I have taken a step back on the product that I work on in my day job as far as horizontally scaling mongo to rethink things. They're worth looking at if you're considering reading from slaves, or even just using MongoDB in general. I'd take them as serious arguments against taking MongoDB horizontal, at least until the Mongo team shores up replication. I know that's an HA trade-off, but from what aphyr found that HA may be purely theoretical, especially during a partition event. https://aphyr.com/posts/284-call-me-maybe-mongodb |
Thanks, that got me thinking. For event sourcing and CQRS we use some constraints at application level that simplify things:
Question is if even so, for the write side of CQRS+ES, some of aphyr's observations still might imply event loss under horizontal scaling of MongoDB, even when using Majority write concern and Primary read concern and with a current MongoDB version. |
After watching aphyr's talk http://www.ustream.tv/recorded/61443262 I think the answer is yes. During a network partition situation with two active primaries events can be lost when the degenerate primary finally resides and its recorded data is discarded by MongoDB. |
It would be nice to have the choice of MongoDB read preference at the event consumer side to achieve some serious load balancing.
Using the casbah driver we are interested in Secondary and SecondaryPreferred:
http://mongodb.github.io/casbah/api/index.html#com.mongodb.casbah.ReadPreference$
Is there already a way to configure akka-persistence-mongo to achieve this with casbah and ReactiveMongo drivers?
Are there any serious arguments against using a read preference with reads across MongoDB replicas? If one replica already has some events, and the other does not, this could perhaps disrupt a particular consumer actor in some way.
The text was updated successfully, but these errors were encountered: