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

How to write a custom atomic method in Java?

Consider a critical application and I have to make two external calls to do a transaction, the second call depends on the status of the first call. If I have to make this method atomic, ie, I want to make sure either the entire transaction happens…
Joe
  • 326
  • 3
  • 11
0
votes
0 answers

SQL - ACID relationships between two varying entities

Let's say there is a a system and you have three entities: User Team (group of users) Role And you want to setup up some permission relationships, with the flexibility in the database anyway, to say: User X can change permissions of User Y User X…
mgibson
  • 6,103
  • 4
  • 34
  • 49
0
votes
2 answers

T-SQL transactions - is this begin/commit implementation sufficient?

I'm creating a SQL Server batch file to create new database objects, insert data into tables, etc. If one of these actions fails, then I don't want any of the other actions to be committed. Is the following wrapper sufficient to accomplish what…
user9393635
  • 1,369
  • 4
  • 13
  • 32
0
votes
1 answer

How do I know if a transaction has failed and been rolled back?

I am currently using the spring @transactional annotation to make a series of database changes. Upon any exception that is not thrown by me (e.g. my UPDATA clause violates the column constraints in the table), the transaction is successfully rolled…
The Yellow
  • 47
  • 8
0
votes
1 answer

Data consistency during multiple threads

Say I have 3 threads, T1, T2 and T3 from an application all starting at the exact same time. They all read the same value from a certain table, row and column. Lets say this value is 50. 1. T1 is fast. Completes in 100ms. Upon completion, it…
latestVersion
  • 458
  • 1
  • 6
  • 17
0
votes
0 answers

Using database with Hadoop cluster

Currently I have a small Hadoop cluster that performs a MapReduce task on my input data and generates some output. What I would like to do is store this data in a database so that it can be queried for analysis. I would like the database to simulate…
Nick_4810
  • 1
  • 2
0
votes
0 answers

Is Mongodb appropripate for transactions in related collections?

This is very basic question regarding mongodb. Suppose, in my application, i have an entity "user". User has various data to store like its personal information, hobbies, education detail, professional detail, settings, contacts, photos etc. I have…
Tanu Gupta
  • 602
  • 1
  • 11
  • 26
0
votes
1 answer

MySQL isolation levels in nodejs. Is each query in connection isolated or each pool isolated?

My current isolation level for MySQL is tx_transaction = REPEATABLE-READ for each session. So when I run the below code in different terminals the transactions are serially executed, meaning before the commit of the first transaction, the second…
forJ
  • 4,309
  • 6
  • 34
  • 60
0
votes
0 answers

MongoDB MMAPv1 uses collection-level locks?

I've read that MongoDB has two types of storage engine you can choose from: MMAPv1 and WiredTiger. It seems that one of the differences between the two is the granularity of consistency locks. MMAPv1 seems to have collection/document-level locks and…
StevenDaGee
  • 127
  • 1
  • 6
0
votes
0 answers

Rollback is throwing an SQL error

Trying to do a rollback, when the rollback kicks in it throws an SQL Exception. What am I doing wrong??? I've checked the other posts but cant find anything to explain how to fix this. I've tried using savepoints and it says those are not able to be…
Cameron2222
  • 41
  • 1
  • 7
0
votes
0 answers

How to update row of a table conccurently in mysql maintaining consistency of data

How to update row of a table in mysql maintaining consistency of data. For Example : Algo : do{ CreditBalance credit = getCreditBalance(initialDeductionCreditRequest.getUserId(), creditMetadata.getId()); …
kavetiraviteja
  • 2,058
  • 1
  • 15
  • 35
0
votes
2 answers

Hive Merge command is not working in Spark HiveContext

I am running hive merge command using Spark HiveContext in 1.6.3 spark version, but it is failing with below error. 2017-09-11 18:30:33 Driver [INFO ] ParseDriver - Parse Completed 2017-09-11 18:30:34 Driver [INFO ] ParseDriver - Parsing command:…
Hokam
  • 924
  • 7
  • 19
0
votes
1 answer

Consistency in Different Context (Distributed System vs Memory Model vs Database)

I am confused by the term "Consistency". It's been used in many different context, i.e Distributed System, Memory Model and Database. People/Wikipedia summarize all different Consistency Model in the same page. But I don't really think that they are…
Oliver Young
  • 578
  • 1
  • 4
  • 12
0
votes
1 answer

Hive delete row with composite primary key

The ACID properties in Hive allow to delete rows from a table using the following syntax : DELETE FROM table WHERE id IN (SELECT id FROM raw_table) But what's the best solution to delete rows when the primary_key is composed of several columns ? I…
Jean.W
  • 11
  • 4
0
votes
1 answer

Db checks and concurrent transactions

How do dbms guarantee that the checks\comstraints we define are always true after commit ? I mean they might use special technique because just executing the checks just before commit, like we can do, just wouldn't work because of multiple…
GionJh
  • 2,742
  • 2
  • 29
  • 68