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
3
votes
1 answer

fsync() atomicity across data blocks

When calling fsync() on a file, can the file become corrupted? For example, say my file spreads across to disk blocks: A B |---------| |--------| | Hello, | -> | World! | |---------| |--------| | 1234567 | | 89abcd…
magnus
  • 4,031
  • 7
  • 26
  • 48
3
votes
0 answers

Are Oracle and MySQL ACID compliant?

PostgreSQL claims one of they main features is ACID compliance. I have not managed to find clear statements regarding Oracle and MySQL on that.
Draif Kroneg
  • 743
  • 13
  • 34
3
votes
2 answers

Is the data system for ATM-machines using eventual consistency?

I wounder how the world-wide ATM-systems are architected. It must be pretty hard for the banks to design a consistent system world wide. Do they use eventual consistency for this or do they use a great ACID system? I can be in Sweden one day, where…
Jonas
  • 121,568
  • 97
  • 310
  • 388
3
votes
0 answers

What's the most ACID settings with H2 Database?

We have a product running with some issues because of two power off. The H2 database is on 1.3.x version but we are intended to update something to improve resiliency and durability, specially diminishing database corruption chances because our…
3
votes
1 answer

What to do if Cassandra reports failure but did a partial write?

Cassandra does not guarantee atomic behavior so there is a slight chance that one replica fails but other replica do persist the change. Are there any information how to defend against this and what to do in order to heal it if it happens? Does…
Martin Kersten
  • 5,127
  • 8
  • 46
  • 77
3
votes
4 answers

Transaction Isolation on select, insert, delete

What could possibly go wrong with the following transaction if executed by concurrent users in the default isolation level of READ COMMITTED? BEGIN TRANSACTION SELECT * FROM t WHERE pid = 10 and r between 40 and 60 -- ... this returns tid = 1, 3,…
Bradford
  • 4,143
  • 2
  • 34
  • 44
3
votes
2 answers

Data is still visible after deletion within the same MySQL transaction

Lately I've been testing my PHP framework's database wrapper class which is based on PHP Data Objects. I've successfully passed all the tests with Oracle database and started to do the tests with MySQL when I came across to a bug which seems like an…
3
votes
1 answer

MySQL Transactions vs Locks

I'm building an application in which users can submit a post, and people can reply to the post. When a user posts a post, he can select which users can view the post. This is the posts table: | id | poster-id | title | message | ... | This is the…
untitled
  • 405
  • 4
  • 16
3
votes
1 answer

What transactions diminish data integrity?

I've learned a decent bit about database integrity, and know I should be using transactions if I "require multiple statements be performed as a unit to keep the data in a consistent state." Database development mistakes made by application…
Raekye
  • 5,081
  • 8
  • 49
  • 74
3
votes
1 answer

Haskell: Yesod and state

I was reading through the code for a Toy URL Shortener. However, there's significant parts I just can't get my head around. It has the following code: data URLShort = URLShort { state :: AcidState URLStore } For testing purposes, I wrote something…
Clinton
  • 22,361
  • 15
  • 67
  • 163
2
votes
3 answers

Does using NOLOGGING in Oracle break ACID? specifically during poweroutage

When using NOLOGGING in Oracle, say for inserting new records. Will my database be able to gracefully recover from a power outage? if it randomly went down during the insert. Am I correct in stating that the the UNDO logs will be used for such…
vicsz
  • 9,552
  • 16
  • 69
  • 101
2
votes
2 answers

Why aren't NoSQL Databases ACID compliant?

Possible Duplicate: Is there any NoSQL that is ACID compliant? So, I heard NoSQL Databases are not ACID compliant, why is this?
Steffan Harris
  • 9,106
  • 30
  • 75
  • 101
2
votes
2 answers

What operation ordering guarantees are there without durability (mongo)?

Suppose you have an ACID database. Without an explicit guarantee about operation ordering, you can still infer ordering as a result of durability. e.g. I insert x into a database and the statement returns Now I insert y because of a Durability…
Mark Bolusmjak
  • 23,606
  • 10
  • 74
  • 129
2
votes
3 answers

Does a typical ACID RDBMS sync to disk every commit?

The 'D' in ACID means "Durability" which is defined by Wikipedia as: "every committed transaction is protected against power loss/crash/errors and cannot be lost by the system and can thus be guaranteed to be completed". However, this would mean…
Tim Cooper
  • 10,023
  • 5
  • 61
  • 77
2
votes
1 answer

What is the need for undo log if redo(WAL) exists?

If there is WAL (redo) log available, then it would allow us to persist to disk the records and commit the transaction without needing to update the data structures first. Since you can always re-apply from the redo log and update the data…
user855
  • 19,048
  • 38
  • 98
  • 162