Eventual Consistency is a guarantee that when an update is made in a distributed database, that update will eventually be reflected in all nodes that store the data, resulting in the same response every time the data is queried.
Why is eventual consistency used?
Eventual consistency is a consistency model used in distributed computing to achieve high availability that informally guarantees that, if no new updates are made to a given data item, eventually all accesses to that item will return the last updated value.
How do you work around eventual consistency?
Let's figure out how to handle this eventual consistency.
...
Poll the read model
...
Poll the read model
- Additional latency is caused due to the polling read models.
- If we poll too frequently we could add load to the database.
- If we poll less frequently we will add wait time even after the read model has been updated.