Explore the essential differences between ACID and BASE transaction models in NoSQL databases. This quiz assesses key concepts, behaviors, and real-world scenarios involving consistency, availability, isolation, and durability in NoSQL systems.
Which property in the ACID model ensures that either all operations in a transaction are completed successfully, or none are applied?
Explanation: Atomicity guarantees that a transaction is treated as a single unit, so all changes occur or none at all. Availability is part of the BASE model, not ACID. Asynchrony relates to timing, not all-or-nothing execution. Adaptability is not relevant to transaction completion.
In the BASE model for NoSQL databases, what does the 'Eventually consistent' principle imply after an update?
Explanation: Eventually consistent means that, given enough time, all updates will propagate and all replicas will become consistent. Immediate consistency everywhere is typical of ACID, not BASE. BASE does not guarantee transaction rollback on failure. Updates are not lost; they just may not be immediately reflected everywhere.
Which transaction property is typically relaxed in BASE systems compared to ACID, using a scenario where data might be temporarily unavailable after a write?
Explanation: BASE systems can temporarily relax durability, meaning changes might not be available right after a write, while ACID systems emphasize immediate durability. Atomicity and isolation relate to transaction boundaries and visibility. Symmetry is unrelated to transaction guarantees.
A social app allows users to post comments instantly, but different users might see the new comment at different times. Which model best explains this?
Explanation: BASE, with its eventual consistency, allows temporary discrepancies in view as changes propagate. ACID demands immediate consistency for all users. BASIC and CASID are incorrect or misspelled variations with no recognized transaction meaning here.
Which statement correctly describes consistency in ACID and BASE models?
Explanation: ACID requires all transactions to leave the database in a consistent state, enforcing strict consistency. BASE, in contrast, allows temporary inconsistencies resolved over time, known as eventual consistency. The other options incorrectly describe the behavior or misstate the models.
If two transactions run at the same time and read each other's intermediate results, which ACID property is being violated?
Explanation: Isolation ensures that concurrent transactions do not see each other's unfinished work. Durability concerns the permanence of committed results. Scalability and elasticity deal with capacity and flexibility, not transaction isolation.
BASE models trade strict consistency for which desirable characteristic in large, distributed NoSQL systems?
Explanation: BASE systems relax consistency to maintain higher availability during network partitions. Tighter atomicity and greater isolation are traits of ACID, and permanent synchronization does not accurately describe the trade-off in BASE.
Which scenario best justifies the use of an eventual consistency model over a strongly consistent one?
Explanation: Eventual consistency works well when slight delays in updates are acceptable, as in a global product catalog. Banking, booking, and trading applications all require strict, immediate consistency to prevent errors and losses.
In the context of transactions, what does the 'B' in BASE stand for?
Explanation: BASE stands for Basically Available, Soft state, Eventually consistent. Binary, batch, and backend are unrelated terms, not part of the BASE acronym.
Which factor is most important in choosing ACID over BASE for a database system?
Explanation: ACID provides strict guarantees for consistency and integrity, making it vital where precision matters most. BASE systems better serve cases favoring scalability, temporary discrepancies, or reduced costs. The distractors relate to BASE features or are less important than data integrity for ACID.