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
16
votes
4 answers

Not nesting version of @atomic() in Django?

From the docs of atomic() atomic blocks can be nested This sound like a great feature, but in my use case I want the opposite: I want the transaction to be durable as soon as the block decorated with @atomic() gets left successfully. Is there a…
guettli
  • 25,042
  • 81
  • 346
  • 663
15
votes
2 answers

Memory Mapped files and atomic writes of single blocks

If I read and write a single file using normal IO APIs, writes are guaranteed to be atomic on a per-block basis. That is, if my write only modifies a single block, the operating system guarantees that either the whole block is written, or nothing at…
Martin Probst
  • 9,497
  • 6
  • 31
  • 33
14
votes
2 answers

NoSQL Database for Online Money Transaction Management?

I am planning to use a NoSQL database like MongoDB as the back-end for my web product. For design concept, there would be around daily minimum 1,000 users. I have doubts: I have read in a blog that NoSQL database are not so good for Online Money…
Akamad007
  • 1,551
  • 3
  • 22
  • 38
14
votes
5 answers

What Applications Don't Need ACID?

Sorry for the ignorant question, but what kind of applications wouldn't require an ACID compliant database server? I have a SQL Server background where ACID has always "been there", and now researching other DBMSs has me thinking. Most every…
skaz
  • 21,962
  • 20
  • 69
  • 98
14
votes
1 answer

How do distributed transactions work (eg. MSDTC)?

I understand, in a fuzzy sort of way, how regular ACID transactions work. You perform some work on a database in such a way that the work is not confirmed until some kind of commit flag is set. The commit part is based on some underlying…
Martin
  • 5,945
  • 7
  • 50
  • 77
14
votes
6 answers

Example of a task that a NoSQL database can't handle (if any)

I would like to test the NoSQL world. This is just curiosity, not an absolute need (yet). I have read a few things about the differences between SQL and NoSQL databases. I'm convinced about the potential advantages, but I'm a little worried about…
ascobol
  • 7,554
  • 7
  • 49
  • 70
13
votes
2 answers

Raw sql transactions with golang prepared statements

I'm having trouble finding some examples that do three of the following things: 1) Allow raw sql transactions in golang. 2) Use prepared statements. 3) Rollback on query failures. I would like to do something like this, but with prepared…
Alexander Kleinhans
  • 5,950
  • 10
  • 55
  • 111
13
votes
2 answers

in sqlite3, can a select succeed within a transaction of insert?

I begin a transaction, which is to insert several records into a table. Can I select the latest inserted record out of the database before the transaction commit?
user26404
  • 1,371
  • 4
  • 27
  • 38
13
votes
3 answers

how do non-ACID RethinkDB or MongoDB maintain secondary indexes for non-equal queries

This is more of 'inner workings' undestanding question: How do noSQL databases that do not support *A*CID (meaning that they cannot update/insert and then rollback data for more than one object in a single transaction) -- update the secondary…
V P
  • 845
  • 10
  • 28
12
votes
3 answers

Transactionally writing files in Node.js

I have a Node.js application that stores some configuration data in a file. If you change some settings, the configuration file is written to disk. At the moment, I am using a simple fs.writeFile. Now my question is: What happens when Node.js…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
11
votes
1 answer

Atomic counter - redis vs postgres or other?

I need an implementation of an Atomic Counter on cloud to produce a serial integer from concurrent connections. The business behind is a tracking server. Requirements by priority: (MUST) Durable - be sure that once a clients gets a number, no other…
naviram
  • 1,445
  • 1
  • 15
  • 26
11
votes
2 answers

How Cassandra handles concurrent updates?

How does Cassandra handle concurrent updates to the same key by multiple users? Does Cassandra follow the "Isolation" property from ACID?
sras
  • 818
  • 7
  • 18
10
votes
4 answers

Write Skew anomaly in Oracle and PostgreSQL does not rollback transaction

I noticed the following occurrence in both Oracle and PostgreSQL. Considering we have the following database schema: create table post ( id int8 not null, title varchar(255), version int4 not null, primary key (id)); create…
Vlad Mihalcea
  • 142,745
  • 71
  • 566
  • 911
10
votes
3 answers

Will database file of SQLite3 be damaged when suddenly power-off or OS crash?

I open the database file and obtain a database connection using open() method of sqlite3 and the connection will not be closed until program exits. If there occurs an unexpected error such as computer's suddenly power-off or OS crash, will the mode…
quantity
  • 4,051
  • 3
  • 23
  • 20
9
votes
7 answers

Patterns for implementing transactions outside of a database

I have to send an email, write to a file, and call a web service. To maintain consistency, all steps must happen. If any step throws an exception or errors out, all steps must be rolled back. Before I go rolling my own object ACID engine, are there…
Ryan Michela
  • 8,284
  • 5
  • 33
  • 47
1
2
3
22 23