-
Notifications
You must be signed in to change notification settings - Fork 2
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
Handle distributed database #2
Comments
Eventual consistency will always be an issue in any CQRS implementation but not necessarily a show stopper if you plan to deal with it. This solution will only commit events when the stored version of the given aggregate matches the expected version provided when sending commands, otherwise a concurrency error is thrown. Most applications won’t be highly concurrent at the aggregate level though. |
The problem with firebase is that it is distributed, and each insert is eventual consistent. Example: someone in Asia is executing an command, resulting in a new event that is stored in the eventstore. Maybe an check function running on each insert, checking the event consistency, might work? |
Events are committed inside a transaction and Firestore transactions are supposed to be ACID across regions. It would be nice if we can find official confirmation since I haven’t tested these type of scenarios and it would be a real issue if that’s not the case. |
You are right, the official documentation backs your statement. When using transactions, note that: Read operations must come before write operations.
|
Hi,
how is your solution to handle the fact, that multiple firebase instances may have a different "currentState"? I mean if you store an event in the database does not guarantee that, while reading it in another instance, you get the same result "in time". As the whole database is eventual consistent
The text was updated successfully, but these errors were encountered: