Questions tagged [eventual-consistency]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
127 views

How is cross device eventual consistency achieved in real time?

Assume there is a distributed system which works on the principles of eventual consistency. Let's consider a scenario where I update my profile picture using my phone. If I log in using another system,...
user avatar
  • 111
-1 votes
2 answers
79 views

Transactional and eventual consistency together -- which operations MUST be transactionally consistent?

I find a lot of resources regarding strong consistency versus eventual consistency, and when to choose one or the other. I'm wondering how and when you would have both together. Consider this specific ...
user avatar
  • 15
0 votes
1 answer
58 views

Is publishing to the same event store stream from multiple places an anti pattern in a distributed transaction?

Below is a little context to the problem I'm trying to solve. There are two separate microservices with separate frontends , APIs and databases. Customer Microservice - Manages customers Orders ...
user avatar
  • 302
2 votes
1 answer
137 views

How do we maintain consistent-read promise to clients + handling ID collision when using a fallback queue?

In my company, we are using Event Sourcing pattern to implement a storage for all changes to the price of a booking. Across the company, different services might try to append events to a booking ...
user avatar
  • 245
3 votes
2 answers
193 views

Foreign Keys and Eventual Consistency

We have a project that loads metric data from various etls and services into an AWS SQS queue, where that data is processed and inserted into a metrics database, also running on AWS RDS. When we ...
user avatar
  • 2,343
0 votes
2 answers
441 views

Why is it considered hard to maintain strong consistency in a distributed system?

Why can't you just use strongly consistent reads for all your DB reads, with retries on 500 responses? According to CAP theorem increasing consistency should probably lower availability, but can't the ...
user avatar
  • 421
2 votes
1 answer
501 views

Communication between services in a microservices architecture, is direct communication okay?

I've been reading a lot on why one should use messages (w/ event sourcing/CQRS) for microservices communication and I get it. But most of the stuff I read online state that the main reason for using ...
user avatar
0 votes
3 answers
696 views

How to handle data inconsistency in microservice architecture?

Let's assume we have two services - user and auth with a message broker in between. user service handles CRUD action on user entity and auth service handles authentication. When a user is created/...
user avatar
1 vote
2 answers
163 views

Multiple sources of truth - Optimistic concurrency & Eventual consistency

I have a couple of web applications that write to their own databases. They also share a few entities, for example, the customer entity. My business case is such that the same field for the same ...
user avatar
  • 19
2 votes
2 answers
495 views

In which database CQRS Command performs a Query?

I read the discussion Should CQRS Command perform a Query? But I don't understand in which database the query is performed, because I have two distinct databases - one for reads (queries) and one for ...
user avatar
-2 votes
2 answers
176 views

How can one choose between consistency and availability if the system you are designing is Tiny URL

I am putting together a system design for something similar to Tiny URL. It provides an API for mapping a URL to a short URL. Once created the short URL can be used to access the original URL. This ...
user avatar
0 votes
1 answer
45 views

How to deal with second hand reference data in event driven architectures?

What is the best way of dealing with secondary reference data in event driven architectures? For example, if you have an event from an "Employee" domain that includes some reference data ...
user avatar
  • 156
3 votes
3 answers
2k views

What are the problems with command handlers returning data in CQRS?

I have a system using CQRS/ES, where: The command handlers are actually implemented as an application service layer, which executes synchronously. I.e. events are persisted in the event store before ...
user avatar
  • 502
2 votes
1 answer
1k views

When to publish domain events when handling transactions in the application service

This is something that has been bothering me for quite some time, I tried different approaches over the past year but I always come back to reflect on this, so I'll throw myself out here ! So, first ...
user avatar
  • 427
1 vote
1 answer
113 views

Is weak consistency still relevant in systems that record timestamps?

There are multiple aspects and quality that are desirable for a distributed system. Among these are consistency and availability. According to the CAP theorem, if partition tolerance is a must, the ...
user avatar
  • 133
1 vote
3 answers
445 views

Be sure to send email only once

I'm thinking about "simple" problem. I have database with messages and email adresses to send: emailAddress string message string Sent bool Is it possible to write a system in which I can be sure ...
user avatar
  • 119
0 votes
3 answers
145 views

Keeping up logical order in a messaging environment

My setting is the following (Please assume that this points are entirely rock solid unchangeable, some for good reasons some: "just because"): In a super scalable microservice environment i receive ...
user avatar
  • 207
-4 votes
3 answers
400 views

How does a distributed system both tolerate network partition and achieve consistency?

In the CAP theorem, there are only three possible cases: C and A without P C and P without A A and P without C How can we have both P and C in the second case? Doesn't propagation of update from ...
user avatar
  • 5,271
-4 votes
1 answer
64 views

Does stale data due to weak level of consistency count as Byzantine failure?

I have difficulty understand Section 18.3 Fault Tolerance Services under Ch18 Replication in Coulouris' Distributed Systems. If my reading and understanding is correct (which might not), Section 18....
user avatar
  • 5,271
1 vote
2 answers
116 views

Aggregating data between microservices in twitter-like application

I'm developing a Twitter-like app and I have some doubts about my service oriented architecture. I have a User Service with a REST endpoint POST /users/{userId}/follow so the "connected" user starts ...
user avatar
  • 717
2 votes
3 answers
1k views

CQRS - How can a command properly validate when queries are required?

I'm aware that this question has been asked several times, but I have some concerns regarding querying from the write side that I don't see addressed in the already existing questions, more ...
user avatar
3 votes
2 answers
534 views

How to make cross-service transactions in a microservice architecture? [duplicate]

One question im struggling with is how to make linear, cross-service operations/transactions in a distributed system. For example, I have two services: Orders and Payments. How would the Orders ...
user avatar
  • 139
0 votes
0 answers
155 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 ...
user avatar
  • 844
0 votes
1 answer
457 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 ...
user avatar
1 vote
0 answers
81 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-...
user avatar
  • 302
0 votes
1 answer
125 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 ...
user avatar
-1 votes
1 answer
166 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 ...
user avatar
0 votes
1 answer
37 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 ...
user avatar
0 votes
1 answer
495 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 ...
user avatar
3 votes
1 answer
437 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 ...
user avatar
  • 139
0 votes
1 answer
442 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 ...
user avatar
9 votes
2 answers
8k 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 ...
user avatar
2 votes
2 answers
65 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 ...
user avatar
9 votes
4 answers
4k 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 ...
user avatar
2 votes
0 answers
200 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 ...
user avatar
2 votes
0 answers
306 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 ...
user avatar
2 votes
3 answers
211 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 ...
user avatar
  • 199
0 votes
1 answer
709 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 ...
user avatar
  • 103
3 votes
1 answer
686 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 ...
user avatar
  • 159
5 votes
2 answers
402 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 ...
user avatar
0 votes
1 answer
881 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 ...
user avatar
  • 647
4 votes
3 answers
1k 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 ...
user avatar
  • 2,715
2 votes
1 answer
329 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 ...
user avatar
6 votes
0 answers
87 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 ...
user avatar
  • 249
6 votes
2 answers
973 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 ...
user avatar
  • 113
6 votes
2 answers
304 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 ...
user avatar
  • 4,761
15 votes
3 answers
5k 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 ...
user avatar
  • 11.5k
3 votes
1 answer
2k 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. ...
user avatar
15 votes
2 answers
11k 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 ...
user avatar
  • 1,829
26 votes
6 answers
16k 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 ...
user avatar
  • 701