What applications do not need ACID?

Sorry for the uninformed question, but which applications will not require an ACID compatible database server? I have a SQL Server background where the ACID has always been there, and now, exploring other DBMSs, I think. Most applications that I can think of would like either atomicity or isolation. Thanks!

+8
database rdbms-agnostic acid
source share
5 answers

Anything based on a NoSQL-type database sacrifices ACID compliance in exchange for something, usually speed.

Twitter, Facebook, Reddit, Digg, etc ... all partially non-acid

-one
source share

This is a paradox that every RDBMS guy thinks that the sky will fall without ACID, but most NoSQL guys happily deploy and support end-user applications without even thinking that "my application will be better with ACID." Unlike Marc B's answer, NoSQL databases are not databases in which updates are accidentally lost or data is accidentally corrupted. The main difference is that in NoSQL databases you use limited versions of atomicity and isolation, etc., But to perform transactions of arbitrary complexity, an exponential amount of effort is required.

There is no reason why you cannot implement a banking system using a database other than ACID. Most NoSQL databases allow you to use micro-transactions that subtract money from one account and add it to another, with a 0% chance of changing the total amount of money in the system.

To discuss this issue in the context of real-life examples, I will describe our application. My company sells software in high school, primarily for scheduling, as well as roll-call voting, managing absenteeism / replacement of teachers, excursions and booking rooms. Our software is based on our own advanced database engine, other than ACID, called Mrjb (available only domestically), which has limitations specific to NoSQL databases.

An example of the difference between an ACID and a NoSQL related to an end user is that if 2 users try to mark the same throw exactly at the same time, there is a (very) small chance that the end result will be a combination of data. submitted by both users. The ACID database ensures that the end result is either one user information or another, or it is possible that one user update fails and returns an error message to the user.

In this case, I do not think that our users will care about whether the status of the "absence" of individual students corresponds to one user update or a combination of them, although they would be concerned that we assigned absence statuses that are contrary to the input of both users. This example should not happen in practice, and if it does, then this is a "race condition", where there is practically no right answer about which user we consider.

A question was asked regarding our Mrjb database about whether we can implement such restrictions as “should not allow the Student object to exist without the corresponding family object”. ("C" in "ACID" = consistency). In fact, we can and support this limitation - another example of micro-transaction.

Another example is downloading a new version of the cyclic school curriculum (usually a two-week cycle) on which the daily curriculum is based. It would be difficult for us to make this update operation atomic or to allow the execution of other transactions separately from this update. Thus, we basically have the choice to either “stop the world” while this major transaction is taking place, which takes about 2 seconds, or allows us to exclude that the student prints out a schedule containing a combination of data for the preliminary update and after the update (there are probably 100 ms in which this could happen). The option to “stop the world” is probably the best option, but in fact we are doing the latter. You can argue that a mixed schedule is worse than a preliminary update, but in both cases we need to rely on a school in which the process notifies students that the schedule has changed - a student working outside an outdated schedule is a big problem, even if it's an agreed schedule . Also note that students usually view their schedule online, in which case the problem is greatly reduced.

I also wrote a “file system-based Blob database” for http://brainresource.com to save their brain scans. This is an important database, and it does not have ACID properties, although they use RDBMS for other data about their subjects.

For reference, our company is described here: http://edval.com.au and our NoSql technology (described as a technique) is described here: http://www.edval.biz/memory-resident-programming-object-databases . There was concern that this post was spam, making it possible to connect to our company, but I would say that (a) the theoretical question cannot be answered only - you need examples from the real world and (b) any retention identifying information about the technology of the product or the database is not suitable.

+10
source share

What the other answers seem to be missing is that the generally applicable alternative to ACID is not “nothing”, it is called the final consistency (sometimes called BASE).

When people say that they need ACID semantics, often what they really mean, at least in terms of domain / business requirements, is simply data integrity. They want to make sure that the data is not lost or damaged. Many NoSQL databases still provide this guarantee; they simply provide it differently and on their terms.

Of course, you can use a NoSQL or BASE database as an unsafe alternative to a SQL or ACID database if you consider it to be just a "database other than ACID." Making an informed decision means that you understand what needs to be done at the application level to compensate for the lack of large-scale transactions and play into the EU's strengths. Some common methods:

  • An optimistic concurrency that is already being used to minimize locks in a transactional environment.

  • Idempotence of operations, for example, if a long-term operation is completed halfway, it can simply be repeated again and again until it succeeds.

  • Long-term transactions using compensation transactions , which are often called sagas in distributed systems, where several independent transactions are grouped using some correlation identifier, and the state of the entire operation is tracked independently. Often, they actually use ACID semantics for the state of the saga itself, but it is much lighter than a two-phase lock.

In fact, if you spend a lot of time on distributed systems - even those that have ACID semantics available in each of the individual subsystems, you will find many of the same methods that are used to control cross-system operations, because without them you just kill performance (think BizTalk and BPEL).

Once you have some experience with it, you will realize that this actually makes a lot of sense and is often easier than trying to apply ACID semantics. Computing processes are just models for real processes, and real-time processes can sometimes fail in the middle of a thread. You booked a flight, but suddenly you can no longer go. What do you do? You cancel. Perhaps you will return your money, maybe you won’t do it, or maybe it’s something in between - these are your business rules. Or maybe you started your reservation, but were distracted or distracted, or your strength went out, and now your session has come to its senses. What do you do? Just you start.

To really solve the question, I would answer like this:

You need ACID semantics if:

  • You can reasonably expect the simultaneous use of multiple users or processes on the same data.

  • The order in which transactions appear is extremely important,

  • You will never be able to transfer outdated data displayed to the user.

  • There is a significant and / or direct cost of incomplete transactions (for example, a financial system in which unbalanced totals can have serious consequences).

On the other hand, you do not need ACID semantics if:

  • Users tend to perform updates only on their personal data or do not perform updates at all (just add).

  • There is an implicit (business specific) transaction order. For example, if two customers compete for the last item in the warehouse, it really doesn't matter who gets it.

  • Users will usually be on the same screen for several seconds or minutes at the same time and therefore will look for outdated data anyway (this is actually described by most applications).

  • You have the opportunity to simply abandon incomplete transactions; there is no negative effect on them sitting in the database temporarily or in some cases forever.

The bottom line is that very few applications really need ACID semantics everywhere. However, many applications will require them somewhere - often in isolated pockets, such as saga status or message queues.

The next time you develop a new application or function, try to think about whether it is possible to simulate an atomic / isolated "transaction" as an asynchronous "chain of events" with a small additional state to bind them all together. In some cases, the answer will be no, but you may be surprised how often the answer is yes.

+9
source share

You pay a usage price for ACID semantics. In cases where you manage a very large amount of data and can accept random inconsistencies (i.e. you do not transfer money), solutions other than ACIDs (for example, most NoSQL solutions) may be preferable.

http://www.schoonerinfotech.com/solutions/general/what_is_nosql

Facebook was one of several high-profile companies that made this compromise early on. In fact, they wrote Cassandra as a data warehouse, more suitable for their data needs, and Cassandra clearly does not support ACID semantics.

+2
source share

Eric Brewer On Why Banks BASIC NOT ACID - Affordability Is Revenue

Topic here

Applications requiring ACID

0
source share

All Articles