Menu

1 / 2

ACID vs BASE Transactions

DEV Community·丁久·6 months ago
#jfryFFKC
#acid#database#sql#software#base
Reading 0:00
15s threshold

This article was originally published on AI Study Room . For the full version with working code examples and related articles, visit the original post.

ACID vs BASE Transactions

ACID vs BASE Transactions

ACID vs BASE Transactions

ACID vs BASE Transactions

ACID vs BASE Transactions

ACID vs BASE Transactions

ACID vs BASE Transactions

ACID vs BASE Transactions

Consistency Models

ACID and BASE represent opposing philosophies for database consistency. ACID guarantees strict consistency while BASE prioritizes availability.

ACID Properties

Atomicity, Consistency, Isolation, Durability:

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\-- ACID transaction example

BEGIN TRANSACTION;

UPDATE accounts SET balance = balance - 100 WHERE account_id = 1;

UPDATE accounts SET balance = balance + 100 WHERE account_id = 2;

COMMIT;

BASE Properties

Basically Available, Soft state, Eventual consistency:

class EventualConsistentLedger:

def init (self):

self.pending = []

def transfer(self, sender, recipient,…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.