Questions tagged [acid]

Guaranteed properties of many database systems - This is an acronym for Atomicity, Consistency, Isolation, Durability.

ACID (atomicity, consistency, isolation, durability) is a set of properties that guarantees that database transactions are processed reliably. This means that a database server that is ACID compliant can guarantee that it has not violated any constraints, even when a transaction fails to complete.

Most SQL-based systems are intended to be ACID-compliant. NoSQL systems, however, typically do not guarantee this. (They are usually attempting for This database terminology makes assurances about the data state which are BASE (Basically Available, Soft state, Eventual consistency).

  1. Atomicity : (All at Once) A transaction is completely executed, or if a part of the transaction fails, no changes are made.

  2. Consistency : (Never Breaks Rules) At no point is the database violating any of the constraints that exist in the system. This means that the system cannot implement constraints to occur after the data is written - it must guarantee that the current database state is always allowed.

  3. Isolation : (One at a time) If two database operations occur, they must either have a defined order (One transaction occurs before the other), or the order of the operations must be irrelevant to the transactions.

  4. Durability : (When it's done, it's done.) Once a transaction is complete, any modified, new, or removed data is now in the database, and it stays unless further modified. The transaction cannot be undone by, for instance, a power failure.

331 questions
307
votes
12 answers

How to debug Lock wait timeout exceeded on MySQL?

In my production error logs I occasionally see: SQLSTATE[HY000]: General error: 1205 Lock wait timeout exceeded; try restarting transaction I know which query is trying to access the database at that moment but is there a way to find out which…
Matt McCormick
  • 13,041
  • 22
  • 75
  • 83
251
votes
10 answers

What did MongoDB not being ACID compliant before v4 really mean?

I am not a database expert and have no formal computer science background, so bear with me. I want to know the kinds of real world negative things that can happen if you use an old MongoDB version prior to v4, which were not ACID compliant. This…
Lance
  • 75,200
  • 93
  • 289
  • 503
191
votes
32 answers

Is there any NoSQL data store that is ACID compliant?

Is there any NoSQL data store that is ACID compliant?
JustinT
  • 2,481
  • 3
  • 18
  • 11
183
votes
10 answers

How do ACID and database transactions work?

What is the relationship between ACID and database transaction? Does ACID give database transaction or is it the same thing? Could someone enlighten this topic.
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
70
votes
9 answers

Are disk sector writes atomic?

Clarified Question: When the OS sends the command to write a sector to disk is it atomic? i.e. Write of new data succeeds fully or old data is left intact should the power fail immediately following the write command. I don't care about what happens…
Eloff
  • 20,828
  • 17
  • 83
  • 112
45
votes
3 answers

MySQL InnoDB: Difference Between `FOR UPDATE` and `LOCK IN SHARE MODE`

What is the exact difference between the two locking read clauses: SELECT ... FOR UPDATE and SELECT ... LOCK IN SHARE MODE And why would you need to use one over the other?
pje
  • 21,801
  • 10
  • 54
  • 70
41
votes
1 answer

Mongo DB 4.0 Transactions With Mongoose & NodeJs, Express

I am developing an application where I am using MongoDB as database with Nodejs + Express in application layer, I have two collections, namely users transactions Here i have to update wallet of thousands of users with some amount and if…
Gaurav Kumar
  • 698
  • 1
  • 8
  • 15
35
votes
3 answers

What's a real-world example of ACID?

I'm looking for a real-world example for the various ACID properties of a database.
Fred Stanley
  • 361
  • 1
  • 3
  • 5
27
votes
2 answers

What happens if altering a stored procedure while it is running?

I have a minor, one line change (fixing a typo in a string), to a stored procedure that I would like to deploy to our production SQL Server 2005 server as soon as possible. The worry I have is what happens if at the exact time run the alter…
Kharlos Dominguez
  • 2,207
  • 8
  • 31
  • 43
21
votes
1 answer

Why write skew can happen in Repeatable reads?

Wiki says; Repeatable read: In this isolation level, a lock-based concurrency control DBMS implementation keeps read and write locks (acquired on selected data) until the end of the transaction. However, range-locks are not managed, so…
handora
  • 559
  • 5
  • 14
20
votes
3 answers

How do databases perform atomic I/O?

Databases like Oracle, SQL Server etc are very good at data integrity. If I wanted to write a data store that I knew would either store some data or fail (i.e. be ACID) then I would use a database like MySQL underneath it as the actual store because…
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
20
votes
5 answers

Does MySQL/InnoDB implement true serializable isolation?

It is not entirely clear from MySQL documentation whether the InnoDB engine implements true serializable isolation1 or snapshot isolation, which is often confusingly called "serializable" too. Which one is it? If MySQL InnoDB doesn't, are there any…
Roman Starkov
  • 59,298
  • 38
  • 251
  • 324
20
votes
1 answer

Why we still need innodb redo log when mysql binlog has been enabled?

In my understanding, mysql binlog can fully function as InnoDB's redo log. So, after the binlog is enabled, why does InnoDB have to write a redo log at the same time instead of just switching to use the binlog? Doesn't this significantly slow down…
ASBai
  • 724
  • 2
  • 7
  • 17
19
votes
3 answers

database atomicity consistency

What is difference between Atomicity and consistency ? it looks to me as both are saying same thing in different word. Atomicity All tasks of a transaction are performed or none of them are. There are no partial transactions. For example, if a…
Ram Sharan Mittal
  • 526
  • 2
  • 7
  • 16
17
votes
4 answers

How ACID is the two-phase commit protocol?

I came across a situation where I started doubting whether the two-phase commit protocol really guarantees the ACID properties, especially the 'A' part of it. Let's look at a theoretical distributed transaction involving 2 resources. (More practical…
1
2 3
22 23