Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [eventual-consistency]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
132 views

Avoid updating multiple Aggregates in Library Application

I am currently analysing the project ddd-library which is really helping in learning designing a system based on DDD principles. However there is one thing I have a problem with. In case of placing a ...
securita's user avatar
0 votes
0 answers
126 views

Event sourcing, bulk update and storing multiple events vs one event with multiple ids

Event-sourcing often implies to have one row per aggregate id : event_id event_type entity_type entity_id event_data 102 OrderCreated Order 101 {...} 103 OrderUpdated Order 101 {...} This is ...
djflex68's user avatar
0 votes
1 answer
385 views

Ordering events across multiple topics in a distributed system

Our platform is growing in the number of events we're raising, and these different events are often related to one another: ProductCreated ProductUpdated ProductTakenOffSale ProductPutOnSale ...
FBryant87's user avatar
  • 323
1 vote
2 answers
77 views

Phantom read race condition keeping RDBMS in sync with external storage

Here's an interesting scenario, consider a cache with many buckets, and resources that can be shared between buckets: Bucket Highest to lowest priority Foo A, B, C, D Bar B, C, D Baz A In the ...
danielrs's user avatar
  • 111
3 votes
0 answers
233 views

Microservice architecture but with strong data consistency [closed]

I'm working on a project that has microservice based architecture. Recently we started facing problems where a single user requests requires updating multiple microservices each having it's own ...
JavaLearner's user avatar
0 votes
0 answers
54 views

Designing Aggregate Roots with Logic Spanning over Roots

This seems like a common scenario that someone must have solved by now! I have a setup where a Company may have a set of Default Roles assigned, and Users of that Company should inherit those roles. ...
BuddhiP's user avatar
  • 193
2 votes
1 answer
429 views

Internal/external commands in CQRS

I have several questions related to CQRS in eventually consistent systems with a need of resilient Command/Event processing. Is it OK to have external/public synchronous Commands (triggered by API, e....
Andrew Dunai's user avatar
0 votes
1 answer
931 views

Handling asynchronous domain events with multiple handlers & allowing them to fail independently

We're building a service using DDD, CQRS, & Hexagonal Architecture that allows the user to upload a CSV feed for which every row will be transformed and sent to a third party over HTTP. We have ...
Andrew Dunai's user avatar
2 votes
3 answers
292 views

Foreign key check without data duplication in separate microservices

If for example we have a user, project and a task service where a task is assigned to a single user and user can be part of multiple projects - how can one enforce a rule so that one cannot assign a ...
kisibip183's user avatar
1 vote
2 answers
234 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,...
GenZ Dev's user avatar
  • 121
-1 votes
2 answers
300 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 ...
AleksG's user avatar
  • 115
0 votes
1 answer
210 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 ...
cah1r's user avatar
  • 302
2 votes
1 answer
172 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 ...
JamesBoyZ's user avatar
  • 245
3 votes
2 answers
522 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 ...
Igneous01's user avatar
  • 2,333
0 votes
2 answers
744 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 ...
Bob Dole's user avatar
  • 421
2 votes
1 answer
872 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 ...
Leandro Costa's user avatar
0 votes
3 answers
1k 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/...
CodeBreaker's user avatar
3 votes
2 answers
645 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 ...
mantadt's user avatar
  • 39
2 votes
2 answers
994 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 ...
FedeC87p's user avatar
-2 votes
2 answers
313 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 ...
darkmoonstone's user avatar
0 votes
1 answer
159 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 ...
Merrion's user avatar
  • 166
4 votes
4 answers
4k 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 ...
Ergwun's user avatar
  • 512
4 votes
1 answer
3k 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 ...
TanguyB's user avatar
  • 467
1 vote
1 answer
157 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 ...
krismath's user avatar
  • 133
1 vote
3 answers
817 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 ...
Snorlax's user avatar
  • 111
0 votes
3 answers
212 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 ...
Chris's user avatar
  • 207
-4 votes
3 answers
656 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 ...
Tim's user avatar
  • 5,465
-4 votes
1 answer
69 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....
Tim's user avatar
  • 5,465
1 vote
2 answers
159 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 ...
Héctor's user avatar
  • 727
2 votes
3 answers
2k 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 ...
David Jiménez Martínez's user avatar
3 votes
2 answers
795 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 ...
Kloar's user avatar
  • 139
0 votes
0 answers
201 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 ...
m_d_p29's user avatar
  • 894
1 vote
1 answer
882 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 ...
David Osborne's user avatar
1 vote
0 answers
124 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-...
cah1r's user avatar
  • 302
0 votes
1 answer
213 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 ...
Mihail Malostanidis's user avatar
-1 votes
1 answer
301 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 ...
Ian Swift's user avatar
0 votes
1 answer
41 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 ...
Marshall Tigerus's user avatar
0 votes
1 answer
855 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 ...
Igor Gatis's user avatar
3 votes
1 answer
479 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 ...
RBanerjee's user avatar
  • 139
0 votes
1 answer
663 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 ...
Stefan Rendevski's user avatar
10 votes
2 answers
11k 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 ...
Stéphane Appercel's user avatar
2 votes
2 answers
67 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 ...
Pavel Voronin's user avatar
12 votes
4 answers
6k 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 ...
Ray Saltrelli's user avatar
2 votes
0 answers
214 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 ...
Anisha Agrawal's user avatar
3 votes
0 answers
450 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 ...
Anisha Agrawal's user avatar
3 votes
3 answers
256 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 ...
timetofly's user avatar
  • 209
0 votes
1 answer
867 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 ...
Josh L's user avatar
  • 103
4 votes
3 answers
1k 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 ...
Alex's user avatar
  • 169
5 votes
2 answers
523 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 ...
Ashish Negi's user avatar
0 votes
1 answer
1k 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 ...
kitta's user avatar
  • 697