Questions tagged [eventual-consistency]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
21
votes
5answers
10k views

Microservices: Handling eventual consistency

Assume we have a function that updates a User's password. Once the 'Update Password' button is clicked, an UpdatePasswordEvent is sent to a topic where 3 other services are subscribed: A service ...
17
votes
8answers
1k views

How do I write tests against an eventually consistent service?

I'm building a service on top of Google App Engine Datastore, which is an eventually consistent data store. For my application, this is fine. However, I'm developing tests that do things like PUT ...
12
votes
3answers
3k views

Rehydrating Aggregates from a “snapshots” projection rather than the Event Store

So I've been flirting with Event Sourcing and CQRS for a while now, though I've never had the opportunity to apply the patterns on a real project. I understand the benefits of separating your read ...
12
votes
2answers
2k views

Patterns for maintaining consistency in a distributed, event sourced system?

I've been reading on event sourcing lately and really like the ideas behind it but am stuck with the following problem. Let's say you have N concurrent processes which receive commands (e.g. web ...
6
votes
2answers
189 views

Is the C in ACID is not the C in CAP?

We know that for Database Systems - the Consistency in ACID properties is part of the acronym: A - Atomicity C - Consistency I - Isolation D - Durability We know that for NoSQL Systems, the ...
6
votes
2answers
551 views

Designing event-driven architecture for multiple services

I've created about a dozen services for a intranet. Now I've gotten to the point that these services are more coupled to each other than I'm comfortable with, and I've been having problems where once ...
6
votes
0answers
84 views

Is the C in the CAP theorem the same as the I in ACID? [duplicate]

This article states that: Consistency in CAP actually means linearizability, which is a very specific (and very strong) notion of consistency. In particular it has got nothing to do with the C ...
5
votes
4answers
1k views

How to handle transactional operations in an event-driven architecture?

I'm trying to flesh out an eCommerce system using microservices (.NET Core and Kubernetes), event sourcing (Kafka), and CQRS. The particular use case I've been thinking about is as follows. There is ...
5
votes
1answer
2k views

Event Sourcing , sagas, bus and eventual consistency

I am currently learning about Event Sourcing via the book Microsoft .NET - Architecting Applications for the Enterprise. Event sourcing is, in my own words, an architectural pattern of storing "events"...
5
votes
2answers
289 views

How is Eventual Consistency (EC) better than Strong Consistency (SC) when N = 3, R=W=2 when SC gives better consistency gurantee in same config?

In dynamo paper, it says that in production most of the users set N = 3, R = 2 and W = 2. The common (N,R,W) configuration used by several instances of Dynamo is (3,2,2). These values are chosen to ...
4
votes
2answers
103 views

How to to send a file and record that it has been sent in an atomic way?

I'm not sure how to best approach this problem. I've got an object in my local database, for example this one: { title: "my-object", uploaded: false } I convert this to a file, say my-object.txt and ...
3
votes
2answers
3k views

DDD: Why is it a bad practice to update multiple aggregate roots per transaction?

Quoting from Vaughn Vernon: When two or more Aggregates have at least some dependencies on updates, use eventual consistency. He further goes on to suggest that one could make use of Domain Events ...
3
votes
2answers
511 views

User interface and process that involves asynchronous communication between several microservices

System consists of several micro-services and each of them is in charge of it's own context, such as booking, payment, products and notifications. Let's imagine we have a traveler who is seeking ...
3
votes
1answer
363 views

How to recognize consumers in AMQP architecture

I'm doing an project where I'm using a microservice architecture. All the services within this architecture communicate with each other using an AMQP broker (RabbitMQ). When something happens in a ...
3
votes
1answer
235 views

Domain Events Grouping/Buffering

Suppose I have 3 domain events, Event1 Event2 and Event3. When command arrives at my Service Layer, I can rise 2 commands at the same time - e.g. Event1 and Event2. One Class has event listener for ...
2
votes
2answers
1k views

What is eventual consistency?

I've heard people talking about "eventual consistency" (for example in this question and this answer). What is "eventual consistency"? How does it compare to "transactional consistency"? When does it ...
2
votes
4answers
1k views

CQRS: Query write model

Context: User wants to edit entity details, say user name. Assuming the fact that the Read Model is eventually consistent with the Write Model is it conceptually wrong to query write model in order ...
2
votes
2answers
57 views

How to implement semantics of serializability in eventually consistent system?

In a distributed asynchronous system serializability cannot be achieved, but we still have to somehow provide the semantics. Consider quite natural requirement that user must have unique email or no ...
2
votes
3answers
120 views

How are new bounded contexts deployed, and bugs fixed, in message-driven “autonomous” microservice architectures?

I'm coming from the monolith background, using a single large relational database. From my research, many proponents of the microservice architecture favor the event-driven rather than REST driven ...
2
votes
2answers
270 views

DDD: deciding when to lean towards eventual vs transactional consistency

I am reading Vaughn Vernon's series of articles about effective aggregate design. On the subject of deciding between transactional vs eventual consistency, it states the following: Discussing this ...
2
votes
1answer
761 views

Can “REST without PUT” support optimistic locking using ETags?

Rest without PUT models immutable, append-only (event-sourced) state changes by favouring POST-ing new reified change resources over PUT-ing updates to original. Example: making and then changing a ...
2
votes
1answer
1k views

DDD - Effective Aggregate Design Questions

I just read Effective Aggregate Design, by Vaughn Vernon. Summarizing the takeaway: Model true invariants Design small aggregates Reference other aggregates by identity Use eventual consistency ...
2
votes
2answers
1k views

DDD - Domain events vs application events

I'm considering two types of notifications: Domain events used internally within a bounded context Application events used to exchange notification messages between bounded contexts Each aggregate ...
2
votes
1answer
175 views

High scale architecture using Event Sourcing and Eventual Consistency

I want to share with you and know what your opinion/improvements are regarding a solution I was tasked with a technical interview I faced. The exercise: You need to create an API which will indicate ...
2
votes
1answer
869 views

Event-driven architecture and synchronization with a “First-timer microservice”

I'm working on a distributed application and getting deeper into Event-Driven architectures with Microservices. Let's say I have been running two Microservices, CustomerService and AccountService. ...
2
votes
1answer
182 views

is Event sourcing using Database CDC considered good architecture?

When we talk about sourcing events , we have have a simple dual write architecture where we can write to database and we can write the events to a queue like Kafka . Other downstream system can read ...
2
votes
1answer
894 views

Event Driven Microservice Race Condition

Say we have 4 services, A through D, which communicate (for the most part) through some sort of asynchronous event-driven system. When a new entity is created in A, B & C receive that event. B ...
2
votes
2answers
551 views

Domain driven design with eventual consistency

My domain aggregate is struggling with simple business logic so I feel like I have modeled it incorrectly. The architecture I have right now uses domain driven design with event sourcing. The domain ...
2
votes
0answers
91 views

UI syncing in case of bulk operation api

In a CQRS system, the convention that we follow is we render the detail view of an aggregate(i.e getById) using the write model and views containing multiple aggregates(like a dashboard) using read ...
2
votes
0answers
88 views

How to design a sync api exposed to third party which involves a business transaction across aggregates?

Business Domain In the Sales domain, I have 3 entities - Lead, Contact and Opportunity. A lead is injected into the system from many sources and nurtured. If it is a prospect then it is converted ...
2
votes
2answers
510 views

How to model a shopping scenario using event sourcing

I am trying to program a simple shopping scenario using event sourcing: --------------- --------------- ---------------- | OrderService | | ProductService | | PaymentService | ---------...
1
vote
2answers
233 views

Saga's and Query model transaction ordering

I have the following Ubiquitous language defined by our domain expert: A User can find UserGroups and add himself to it. A user can query a list of UserGroups where he is member of and remove himself ...
1
vote
1answer
78 views

Strategy for ensuring consistency when integrating using an API?

How do I ensure consistency between two separate systems which store and maintain the same set of data, when the method of communication between them is REST APIs and webhooks? Is it possible? I find ...
0
votes
1answer
199 views

CQRS, What reasons cause read model update delay? How to prevent user from taking inconsistence data?

I am considering CQRS for building a realtime game server (not gameplay but the economy). For some reasons. Scaling, Event logging, Model changing. However in realtime game when player upgrade, for ...
0
votes
1answer
39 views

Where to store side effect state in an event sourcing system

I also had a look at How do I deal with side effects in Event Sourcing? but the solution wasn't clear to me. If I store "EmailSent" event in the event stream, I might issue the external request to ...
0
votes
1answer
46 views

How can an event subscriber catch up with missed events?

At a conceptual level, what ways can a subscriber catch up with events it has potentially missed but needs to know about at a later time. For example, a service is running and subscribes to events on ...
0
votes
1answer
31 views

Updating a Bound Context in One Database From A Master Database

Let's say I have two domains: Customers and Jobs. Customers is responsible for knowing what customers a user has access to. Jobs is responsible for knowing what jobs a user has access to (by ...
0
votes
1answer
134 views

How to synchronize databases using event streams?

Say you have a bunch of microservices each accessing dedicated databases. Due to business logic reasons, data from some DBs need to be replicated to other DBs (e.g. to serve as local cache). One way ...
0
votes
1answer
100 views

DDD - Handling temporary inconsistency when handling domain events

I realize that DDD advocates eventual consistency, thus allowing for a certain period of time in which the system might be inconsistent. Embracing eventual consistency, we can therefore model our ...
0
votes
1answer
454 views

Eventual consistency and event sourcing

How to handle a next kind of situation in general: I've defined two aggregate root types AR1 and AR2. The AR2 holds value-based identity of the AR1. I have to keep eventual consistency between those ...
0
votes
0answers
54 views

What is a good design for maintaining consistency in a last write wins database without event sourcing

We have an application which on every resource update(resource update, create, delete)creates a message and puts it on a queue. This message is picked up by a worker process, converted to a format ...
0
votes
0answers
19 views

How are changes populated to FrontEnd in Microservices Event First scenario?

I've been reading recently about Event First approach to microservices where Event Store is a Single Source of Truth for all the applications (https://dzone.com/articles/data-consistency-in-...
0
votes
1answer
254 views

Dealing with eventual consistency when persisting and publishing events

Currently working on a DDD application that is using event sourcing with redis as my main persistence store. So unfortunately I do not have built in rollbacks should something fail. The application is ...
-1
votes
1answer
81 views

Is it a bad idea to persist a javascript function?

I'm working on eventual consistency. In short I have a bunch of promises and I want to make sure they get retried until they succeed. It would make my life a lot easier if I could just persist the ...