Questions tagged [consistency]
13 questions
10
votes
6 answers
How to ensure data consistency in system with multiple databases?
Let's say, in a rather big application suite with multiple more or less integrated products, data is stored across multiple databases. Some of them are SQL-ish DB clusters, some are MongoDB clusters.
Some entities (= "rows" or "documents", depending…
cis
- 255
7
votes
4 answers
How to maintain consistency when retrieving partial vs. full data in an API Resource
I'm working on a API for the logistics department, and I have a resource called logisticTransport, which is an entity in our database. I'm facing a challenge with maintaining consistency when retrieving data from this resource.
In some parts of our…
danidcode
- 81
4
votes
2 answers
Do coherence and transactional isolation mean the same?
About coherence vs consistency, https://en.wikipedia.org/wiki/Consistency_model says
Coherence deals with maintaining a global order in which writes to a
single location or single variable are seen by all processors.
Consistency deals with the…
Tim
- 5,545
3
votes
1 answer
Should I use transactions in this scenario?
I am writing a API endpoint in NodeJs, The code is roughly like this:
function myApi(myUserId, userIdToDelete){
if ( checkIfIAmAdmin(myUserId) ) {
deleteUser(userIdToDelete);
}
}
Now, checkIfIAmAdmin() and deletUser() perform…
Alessandro
- 69
3
votes
2 answers
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 record can be updated around the same time in both the…
mantadt
- 39
3
votes
1 answer
A size-type vs index-type conundrum
Suppose I'm writing C or C++ code which deals with... ok, let's make it citizens in a state. In this state, citizens have numeric id's (not strings - numbers); and for reasons of performance, or compatibility with other software, it is assumed there…
einpoklum
- 2,752
2
votes
2 answers
When should I be worried of Time of check time of use vulnerabilities during database queries?
I am having difficulties on understanding when I should be worried about TOCTOU vulnerabilities and how to avoid them because yes, we can use database transactions but there are different level of transactions and using the one which is the safest…
Alessandro
- 69
2
votes
2 answers
Is sequential consistency equivalent to performing memory accesses by a processes in program order and performing each memory access atomically?
In Fundamentals of Parallel Multicore Architecture, by Yan Solihin, p304 defines sequential consistency memory model:
Overall, we can express programmers’ implicit expectation of memory
access ordering as: memory accesses coming out of a processor…
Tim
- 5,545
1
vote
3 answers
Does quorum protocols circumvent fundamental limitations posed by the CAP theorem?
I can have multiple replicas of my database to ensure high availability. Then I can have a quorum such that R+W > N to ensure consistency.
So does strategies like quorum base read/write or consensus algorithms circumvent fundamental limitations…
rahulaga-msft
- 1,450
0
votes
1 answer
Feedback on Multi-Process Software Architecture
I am building an embedded linux system where fault tolerance is important. There are multiple independent tasks, say {P1, P2, P3} that do not need to share any system resources, so I chose to split them into individual daemons started on boot…
Dennis
- 9
0
votes
1 answer
Which techniques to follow to make a fast and consistent message consumer that writes to a RDBMS
I am building a consumer application that reads messages from a queue and runs basic sanitization and deduplication and persists them to an RDBMS.
The functional requirements are
messages must not be lost
Validate and sanitize the arriving messages…
Sujal Mandal
- 131
0
votes
2 answers
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 decreased availability (increased 500 responses)…
Bob Dole
- 421
-1
votes
1 answer
Unexpected shutdown before a saga completion
Suppose we have some microservices and a saga will run to do a transaction in 6 microservices.
What if the whole system dies(unexpected shutdown), on middle of saga process in the step number 4?(System died, So state is lost)
Amin Shojaei
- 117