PGDCA, BCA, B-Tech, MCA, M-Tech, B.Sc computer science राजस्थान सूचना सहायक व कंप्यूटर शिक्षक विशेष नोट्स: इस अध्याय में हम ACID Properties of Transactions: Atomicity and Consistency (ACID गुण: परमाणुता (Atomicity) और स्थिरता (Consistency) के नियम) की संपूर्ण थ्योरी, मुख्य तकनीकी बिंदु, तुलनात्मक तालिका और विगत परीक्षाओं के पैटर्न पर आधारित 20 अति-महत्वपूर्ण बहुविकल्पीय प्रश्न (MCQs) विस्तृत हिंदी व अंग्रेजी व्याख्या सहित पढ़ेंगे।
Overview: Within the ACID model introduced by Härder and Reuter, Atomicity guarantees 'all-or-nothing' execution so partial updates never persist after crashes or aborts, while Consistency guarantees that every completed transaction transforms the database from one valid invariant-preserving state to another. Recovery Managers enforce Atomicity via Write-Ahead Logging (UNDO), whereas Consistency relies jointly on schema constraints and valid application logic.
अध्याय सार: ACID मॉडल में Atomicity (परमाणुता) 'सब कुछ या कुछ भी नहीं' (All-or-Nothing) का नियम सुनिश्चित करती है ताकि क्रैश होने पर अधूरे बदलाव न बचें, जबकि Consistency (स्थिरता) यह सुनिश्चित करती है कि ट्रांजैक्शन डेटाबेस को एक वैध अवस्था से दूसरी वैध अवस्था में ले जाए। Atomicity को रिकवरी मैनेजर लॉग (UNDO) से और Consistency को कन्स्ट्रेंट्स व सही प्रोग्रामिंग से लागू किया जाता है।
ACID Properties of Transactions: Atomicity and Consistency: Detailed Notes & Architecture (ACID गुण: परमाणुता (Atomicity) और स्थिरता (Consistency) के नियम)
1. Historical Origin of ACID & Concept of Atomicity (ACID का उद्भव और परमाणुता (Atomicity) का सिद्धांत)
[EN] While Jim Gray laid the foundational transaction model in the late 1970s, Andreas Reuter and Theo Härder coined the acronym ACID in 1983. Atomicity treats every transaction as an indivisible atomic unit: either ALL write operations of a transaction are permanently reflected in the database, or NONE of them take effect. For example, in a ₹10,000 bank transfer from Account A to Account B, if power fails right after debiting A and before crediting B, Atomicity mandates undoing the debit so money never vanishes.
[HI] ACID संक्षिप्त नाम 1983 में हार्डर और रोइटर (Härder & Reuter) ने दिया था। Atomicity का अर्थ 'All-or-Nothing' है—अर्थात किसी ट्रांजैक्शन के या तो सभी कार्य पूरे होंगे या एक भी नहीं। उदाहरणार्थ खाता A से ₹10,000 काटने के बाद और खाता B में जोड़ने से पहले बिजली चली जाए, तो Atomicity कटौती को भी वापस अनडू कर देती है।
2. Implementing Atomicity: UNDO Logs & Shadow Paging (परमाणुता लागू करने की तकनीकें: UNDO लॉग व शैडो पेजिंग)
[EN] Atomicity is implemented by the Transaction Recovery Management component using Write-Ahead Logging (WAL) or Shadow Paging. Under WAL, before any modified data block hits disk, the DBMS writes an UNDO log record <Ti, X, old_val, new_val> to stable log storage. If Ti aborts or crashes prior to committing, the Recovery Manager replays UNDO records backward to restore old_val; under Shadow Paging, a separate shadow page table points to unmodified original pages until commit atomically flips the root directory pointer.
[HI] परमाणुता को Recovery Manager मुख्यतः Write-Ahead Logging (WAL) के UNDO लॉग द्वारा लागू करता है। डेटा बदलने से पहले पुराना मान (old_val) स्थायी लॉग में लिखा जाता है ताकि क्रैश या ROLLBACK होने पर पुराना मान वापस भरा जा सके। शैडो पेजिंग तकनीक में भी कमिट होने तक मूल डिस्क पेजों को छुआ नहीं जाता।
3. Consistency: Explicit Constraints vs Semantic Invariants (स्थिरता (Consistency): स्कीमा कन्स्ट्रेंट्स व एप्लीकेशन नियम)
[EN] Consistency guarantees that executing a transaction in isolation preserves all database integrity rules—moving from one consistent state to another. These rules include explicit DBMS constraints (PRIMARY KEY, FOREIGN KEY, CHECK, NOT NULL, UNIQUE, Triggers) and implicit application invariants (such as sum(Balance) across accounts remaining unchanged before and after a transfer). Notice that Consistency during an Active transaction CAN be temporarily violated mid-execution (right after debiting A before crediting B), provided it holds at transaction boundaries (start and commit).
[HI] Consistency सुनिश्चित करती है कि अकेले चलने पर कोई ट्रांजैक्शन डेटाबेस के सभी नियमों—जैसे PRIMARY KEY, FOREIGN KEY, CHECK कन्स्ट्रेंट और कुल बैलेंस अचर रहने जैसे बिज़नेस इनवैरिएंट्स—को भंग न करे। ध्यान रहे कि चलते हुए ट्रांजैक्शन के बीच में (जैसे A से पैसा घटाने और B में जोड़ने के बीच) अस्थायी रूप से असंगति आ सकती है, पर कमिट के समय स्थिरता बहाल होनी आवश्यक है।
4. Who Enforces Consistency: Programmer + DBMS Responsibility (स्थिरता की साझा जिम्मेदारी: डेवलपर और DBMS)
[EN] Unlike Atomicity and Durability (purely DBMS engine duties), Consistency is a shared responsibility. The DBMS automatically validates declared SQL constraints (immediately per statement or deferred until commit via SET CONSTRAINTS DEFERRED), and preserves consistency across concurrent users via Isolation. However, the application programmer must write logically correct SQL (e.g., forgetting to credit B after debiting A will commit cleanly as an atomic transaction if no SQL constraint checks total sum, breaking business Consistency!).
[HI] जहाँ Atomicity पूरी तरह DBMS की जिम्मेदारी है, वहीं Consistency डेवलपर और DBMS की साझा जिम्मेदारी है। DBMS घोषित SQL कन्स्ट्रेंट्स की जांच करता है (तुरंत या DEFERRED कमिट पर), लेकिन यदि प्रोग्रामर कोड में खाता B को क्रेडिट करना ही भूल जाए, तो DBMS की नज़र में एक अधूरा लॉजिक भी कमिट होकर बिज़नेस स्थिरता तोड़ सकता है।
Syntax, Formula & Technical Example (ACID Properties of Transactions: Atomicity and Consistency)
-- Enforcing Atomicity & Consistency in Bank Transfer (A -> B)
CREATE TABLE Ledger (acc_id INT PRIMARY KEY, bal DECIMAL(10,2) CHECK (bal >= 0));
START TRANSACTION;
UPDATE Ledger SET bal = bal - 5000 WHERE acc_id = 1; -- Temporarily Sum is -5000
-- Suppose acc_id = 2 fails CHECK or network drops here:
UPDATE Ledger SET bal = bal + 5000 WHERE acc_id = 999; -- 0 rows or error!
ROLLBACK; -- Recovery Manager uses UNDO log -> restores acc_id = 1 (Atomicity)
-- Total sum across Ledger remains strictly invariant (Consistency).
ACID Properties of Transactions: Atomicity and Consistency Quick Reference & Comparison Table
| ACID Aspect / Mechanism | Primary Role & Enforcement | Exam Focus Detail |
|---|---|---|
| Atomicity (All-or-Nothing) | Prevents partial updates from surviving abort/crash | Enforced by Recovery Manager using UNDO log / WAL |
| Consistency (Correctness) | Transitions DB from one valid state to another | Joint duty of App Programmer + DBMS Constraints |
| Deferred Constraints | Checks integrity rules at COMMIT rather than per DML line | Handles temporary mid-transaction invariant violations |
| Shadow Paging | Maintains original read-only pages until atomic pointer swap | Alternative to WAL needing no UNDO/REDO log replay |
ACID Properties of Transactions: Atomicity and Consistency Top 20 Bilingual MCQs with Answers
Q1. Who coined the acronym ACID in 1983 to formalize transaction properties?
(1983 में ट्रांजैक्शन गुणों को औपचारिक रूप देने के लिए ACID संक्षिप्त नाम किसने दिया था?)
(A) Peter Chen and Michael Stonebraker
(B) Andreas Reuter and Theo Härder
(C) Edgar F. Codd and Raymond Boyce
(D) Leslie Lamport and Jim Gray (coined 1983)
Correct Answer: (B)
[EN] Andreas Reuter and Theo Härder coined 'ACID' in their 1983 paper building upon Jim Gray's foundational transaction concepts.
[HI] एंड्रियास रोइटर और थियो हार्डर (Reuter & Härder) ने 1983 में ACID शब्द दिया था।
Q2. Which ACID property ensures that either ALL operations of a transaction reflect in the database or NONE do?
(ACID का कौन सा गुण सुनिश्चित करता है कि ट्रांजैक्शन के या तो सभी कार्य डेटाबेस में लागू हों या एक भी नहीं?)
(A) Atomicity
(B) Consistency
(C) Durability
(D) Isolation
Correct Answer: (A)
[EN] Atomicity enforces the strict 'all-or-nothing' execution semantics so aborted or crashed transactions leave zero partial changes.
[HI] Atomicity (परमाणुता) 'All-or-Nothing' सिद्धांत लागू करती है जिससे अधूरे बदलाव डेटाबेस में नहीं टिकते।
Q3. Which DBMS subsystem and mechanism primarily implement Atomicity?
(मुख्यतः कौन सा DBMS घटक और तकनीक Atomicity (परमाणुता) को लागू करते हैं?)
(A) Network Layer using TCP Windowing
(B) Recovery Manager using UNDO log records (Write-Ahead Logging)
(C) Lock Manager using Shared Locks only
(D) Query Optimizer using B+ Trees
Correct Answer: (B)
[EN] The Recovery Manager writes UNDO records (old values) before overwriting pages so failures can roll back uncommitted effects.
[HI] Recovery Manager डेटा बदलने से पहले UNDO लॉग लिखकर क्रैश या अबॉर्ट की स्थिति में पुराने मान बहाल करता है।
Q4. In a funds transfer from Account A to Account B, total sum (A + B) drops temporarily right after debiting A and before crediting B. Does this violate ACID Consistency?
(खाता A से रुपये काटने के ठीक बाद और खाता B में जोड़ने से पहले कुल योग (A + B) अस्थायी रूप से कम दिखता है; क्या यह ACID Consistency का उल्लंघन है?)
(A) No — temporary intermediate inconsistency during Active execution is permitted as long as Consistency holds at COMMIT
(B) No — only Isolation cares about A + B
(C) Yes — Atomicity immediately aborts the transaction
(D) Yes — every single SQL line must preserve A + B immediately
Correct Answer: (A)
[EN] ACID Consistency is required at transaction boundaries (start and commit), allowing temporary mid-transaction state shifts.
[HI] Consistency की शर्त ट्रांजैक्शन शुरू होने और COMMIT होने के बिंदुओं पर लागू होती है; बीच में अस्थायी परिवर्तन मान्य हैं।
Q5. Who holds responsibility for maintaining the 'Consistency' property of a database transaction?
(डेटाबेस ट्रांजैक्शन की 'Consistency' बनाए रखने की जिम्मेदारी किसकी होती है?)
(A) Strictly the Operating System Kernel
(B) Strictly the Hardware RAID Controller
(C) Both the Application Programmer (valid logic) and the DBMS (enforcing integrity constraints + Atomicity/Isolation)
(D) Strictly the DBMS Query Optimizer alone
Correct Answer: (C)
[EN] The DBMS checks declared constraints like CHECK/FOREIGN KEY, while the programmer must ensure application logic preserves business invariants.
[HI] एप्लीकेशन डेवलपर (सही तर्क लिखना) और DBMS (कन्स्ट्रेंट्स जांचना) दोनों मिलकर Consistency सुनिश्चित करते हैं।
Q6. What does a Write-Ahead Logging (WAL) UNDO record contain so Atomicity can revert an aborted transaction?
(परमाणुता हेतु अबॉर्ट हुए ट्रांजैक्शन को पलटने के लिए WAL के UNDO लॉग रिकॉर्ड में क्या संग्रहित होता है?)
(A) Only the user's password hash
(B) Only the timestamp of the next checkpoint
(C) Transaction ID, Data Item ID, and the Old Value (before-image) of the item
(D) Only the SQL query text string
Correct Answer: (C)
[EN] Storing the old value (before-image) lets recovery overwrite any partial buffer/disk modifications back to the prior state.
[HI] UNDO रिकॉर्ड में ट्रांजैक्शन आईडी, डेटा आइटम और उसका पुराना मान (Old Value) सेव रहता है ताकि रोलबैक संभव हो।
Q7. Which SQL feature lets integrity constraints remain temporarily unsatisfied until COMMIT time inside a transaction?
(कौन सी SQL सुविधा ट्रांजैक्शन के बीच में कन्स्ट्रेंट्स की जांच को रोककर सीधे COMMIT के समय जांचने की अनुमति देती है?)
(A) AUTOCOMMIT = TRUE
(B) ON DELETE CASCADE
(C) SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
(D) SET CONSTRAINTS ... DEFERRED
Correct Answer: (D)
[EN] Deferrable constraints postpone foreign key or check verification until COMMIT, facilitating cyclic or multi-step updates.
[HI] DEFERRED कन्स्ट्रेंट्स प्रत्येक कथन पर जांच करने के बजाय COMMIT के समय जांच करते हैं।
Q8. If a CHECK (bal >= 0) constraint fails on the 2nd UPDATE of a transaction and triggers rollback, which TWO ACID properties just worked together?
(यदि ट्रांजैक्शन के दूसरे UPDATE पर CHECK (bal >= 0) नियम फेल होकर पहला UPDATE भी रोलबैक कर दे, तो कौन से दो ACID गुण काम कर रहे हैं?)
(A) Consistency (detected invalid balance) and Atomicity (rolled back first UPDATE)
(B) Isolation and Normalization
(C) Durability and Partition Tolerance
(D) Durability and View Serializability
Correct Answer: (A)
[EN] Consistency caught the illegal state via CHECK, and Atomicity undid the earlier debit so neither update persisted.
[HI] CHECK नियम तोड़ने से रोकने में Consistency ने काम किया और पहले UPDATE को वापस लेने में Atomicity ने काम किया।
Q9. In Shadow Paging, why are explicit UNDO log replays unnecessary for enforcing Atomicity?
(Shadow Paging तकनीक में Atomicity लागू करने के लिए UNDO लॉग रीप्ले की आवश्यकता क्यों नहीं पड़ती?)
(A) Because Shadow Paging automatically runs COMMIT after every byte
(B) Original disk pages remain untouched while new writes go to shadow copies; abort simply discards the current page table
(C) Because Shadow Paging disables all writes
(D) Because Shadow Paging runs everything in CPU L1 cache
Correct Answer: (B)
[EN] Since original pages are never overwritten in place, keeping the shadow page table restores the exact pre-transaction state instantly.
[HI] शैडो पेजिंग में मूल पेज कभी सीधे ओवरराइट नहीं होते; फेल होने पर बस शैडो पेज टेबल को रखकर पुराने पेज वापस मिल जाते हैं।
Q10. Suppose an active transaction updates 1,000 rows in memory, the server loses power before COMMIT, and the database restarts. According to Atomicity, how many of those 1,000 rows remain changed?
(मान लीजिए एक एक्टिव ट्रांजैक्शन ने मेमोरी में 1,000 पंक्तियाँ बदलीं और COMMIT से पहले बिजली गुल हो गई; रीस्टार्ट के बाद Atomicity के अनुसार कितनी पंक्तियाँ बदली दिखेंगी?)
(A) Approximately 500 rows
(B) 0 rows (all partial changes are rolled back or discarded)
(C) All 1,000 rows
(D) 1 row only
Correct Answer: (B)
[EN] Because the transaction never committed, Atomicity ensures zero partial effects survive crash recovery.
[HI] ट्रांजैक्शन कमिट नहीं हुआ था, इसलिए क्रैश रिकवरी के बाद शून्य (0) पंक्तियों में बदलाव बचेगा।
Q11. If a programmer accidentally writes 'UPDATE A = A - 500;' and commits without writing 'UPDATE B = B + 500;', which property is violated from the banking business perspective?
(यदि प्रोग्रामर गलती से केवल 'A = A - 500;' लिखकर COMMIT कर दे और B को +500 लिखना भूल जाए, तो बैंकिंग नियम की दृष्टि से कौन सा गुण टूटेगा?)
(A) 1NF Normalization
(B) Consistency (business invariant A + B constant is violated even though Atomicity committed the single statement)
(C) Atomicity (the single UPDATE ran partially)
(D) Durability (the disk forgot A = A - 500)
Correct Answer: (B)
[EN] The single statement was atomic and durable, yet defective application logic violated the business Consistency invariant.
[HI] एकल कथन तो परमाणु (Atomic) रहा, लेकिन अधूरे तर्क से कुल राशि स्थिर रहने का Consistency नियम टूट गया।
Q12. In a <Ti, X, V1, V2> log record, which value is applied during UNDO recovery for Atomicity?
(लॉग रिकॉर्ड <Ti, X, V1, V2> में जहाँ V1 पुराना मान व V2 नया मान है, Atomicity हेतु UNDO करते समय कौन सा मान X में भरा जाता है?)
(A) NULL
(B) V1 + V2
(C) V1 (the old before-image value)
(D) V2 (the new after-image value)
Correct Answer: (C)
[EN] UNDO restores the pre-transaction value V1, whereas REDO reapplies the committed new value V2.
[HI] UNDO के समय पुराना मान V1 वापस लिखा जाता है (जबकि REDO में नया मान V2 पुनः लागू होता है)।
Q13. What does 'Transaction Atomicity' mean when nested subtransactions or SQL SAVEPOINTs are used?
(जब ट्रांजैक्शन में SAVEPOINT या बाहरी रोलबैक का उपयोग होता है, तब मुख्य ट्रांजैक्शन की Atomicity का क्या अर्थ है?)
(A) Unless the outer transaction itself commits, the entire transaction's work is still rolled back atomically upon failure or full ROLLBACK
(B) SAVEPOINT permanently locks the whole database forever
(C) Atomicity no longer applies when SAVEPOINT exists
(D) Each SAVEPOINT becomes independently durable even if the server crashes before COMMIT
Correct Answer: (A)
[EN] Savepoints only permit controlled partial undo while active; durability and full commit remain atomic at the outer transaction boundary.
[HI] SAVEPOINT केवल चलते समय आंशिक रोलबैक देता है; अंतिम COMMIT या पूर्ण विफलता पर पूरा ट्रांजैक्शन परमाणु (Atomic) ही रहता है।
Q14. Under the STEAL buffer policy (dirty uncommitted pages may be written to disk before commit), why is Atomicity still preserved?
(STEAL बफर नीति (जहाँ अनकमिटेड डेटा भी डिस्क पर जा सकता है) में Atomicity कैसे सुरक्षित रहती है?)
(A) Because STEAL never allows crashes
(B) Because Write-Ahead Logging ensures the UNDO log reaches disk BEFORE the dirty page overwrites disk
(C) Because dirty pages are automatically converted to committed
(D) Because STEAL forbids reading from disk
Correct Answer: (B)
[EN] The WAL rule guarantees old values are already safely on disk log before dirty pages hit data files, enabling complete UNDO.
[HI] WAL नियम सुनिश्चित करता है कि डर्टी पेज डिस्क पर जाने से पहले ही उसका UNDO लॉग डिस्क पर सेव हो चुका हो।
Q15. Which statement is FALSE regarding Atomicity and Consistency?
(Atomicity और Consistency के संबंध में कौन सा कथन असत्य (FALSE) है?)
(A) Atomicity ensures aborted transactions leave no partial side effects
(B) Declared foreign keys and CHECK constraints help the DBMS enforce Consistency
(C) Write-Ahead Logging (WAL) supports Atomicity via UNDO records
(D) Consistency is guaranteed solely by hardware UPS and RAID without needing programmer logic or constraints
Correct Answer: (D)
[EN] UPS/RAID protect power/media availability, not semantic data Consistency or integrity constraint correctness.
[HI] केवल UPS और RAID हार्डवेयर से Consistency नहीं आती; इसके लिए सही प्रोग्राम तर्क व डेटाबेस कन्स्ट्रेंट्स आवश्यक होते हैं।
Q16. In ACID, why is Consistency directly dependent on BOTH Atomicity and Isolation?
(ACID में Consistency गुण Atomicity और Isolation दोनों पर सीधे निर्भर क्यों करता है?)
(A) Because C comes between A and I alphabetically
(B) Because Consistency disables Isolation locks
(C) Partial aborts (broken Atomicity) or concurrent interference (broken Isolation) can corrupt invariants even when each transaction's logic is valid
(D) Because Atomicity automatically creates Primary Keys
Correct Answer: (C)
[EN] Even bug-free transactions break invariants if half-executed (Atomicity failure) or interleaved unsafely (Isolation failure).
[HI] यदि सही कोड भी अधूरा रुक जाए (Atomicity टूटे) या दूसरे से टकरा जाए (Isolation टूटे), तो डेटाबेस की स्थिरता बिगड़ जाएगी।
Q17. Within ACID Properties of Transactions: Atomicity and Consistency, which acid aspect / mechanism directly maps to: "Prevents partial updates from surviving abort/crash"?
(ACID Properties of Transactions: Atomicity and Consistency में कौन सा ACID Aspect / Mechanism सीधे "Prevents partial updates from surviving abort/crash" से संबंधित है?)
(A) Deferred Constraints
(B) Atomicity (All-or-Nothing)
(C) Shadow Paging
(D) Consistency (Correctness)
Correct Answer: (B)
[EN] In ACID Properties of Transactions: Atomicity and Consistency, 'Atomicity (All-or-Nothing)' handles 'Prevents partial updates from surviving abort/crash' (Enforced by Recovery Manager using UNDO log / WAL).
[HI] ACID Properties of Transactions: Atomicity and Consistency में 'Atomicity (All-or-Nothing)' का कार्य/विवरण 'Prevents partial updates from surviving abort/crash' (Enforced by Recovery Manager using UNDO log / WAL) है।
Q18. Which option accurately describes 'Consistency (Correctness)' in ACID Properties of Transactions: Atomicity and Consistency?
(ACID Properties of Transactions: Atomicity and Consistency के संदर्भ में 'Consistency (Correctness)' की सही विशेषता कौन सी है?)
(A) Transitions DB from one valid state to another
(B) Prevents partial updates from surviving abort/crash
(C) Maintains original read-only pages until atomic pointer swap
(D) Checks integrity rules at COMMIT rather than per DML line
Correct Answer: (A)
[EN] 'Consistency (Correctness)' provides 'Transitions DB from one valid state to another' — key point: Joint duty of App Programmer + DBMS Constraints.
[HI] 'Consistency (Correctness)' का मुख्य विवरण 'Transitions DB from one valid state to another' है (Joint duty of App Programmer + DBMS Constraints)।
Q19. In ACID Properties of Transactions: Atomicity and Consistency, identify the correct parameter for the specification: "Checks integrity rules at COMMIT rather than per DML line".
(ACID Properties of Transactions: Atomicity and Consistency में "Checks integrity rules at COMMIT rather than per DML line" विवरण किस विकल्प के लिए सही है?)
(A) Shadow Paging
(B) Consistency (Correctness)
(C) Atomicity (All-or-Nothing)
(D) Deferred Constraints
Correct Answer: (D)
[EN] 'Deferred Constraints' corresponds to 'Checks integrity rules at COMMIT rather than per DML line' (Handles temporary mid-transaction invariant violations).
[HI] 'Deferred Constraints' का संबंध 'Checks integrity rules at COMMIT rather than per DML line' (Handles temporary mid-transaction invariant violations) से है।
Q20. Considering ACID Properties of Transactions: Atomicity and Consistency, what key behavior defines 'Shadow Paging'?
(ACID Properties of Transactions: Atomicity and Consistency में 'Shadow Paging' की मुख्य भूमिका या मान क्या है?)
(A) Transitions DB from one valid state to another
(B) Prevents partial updates from surviving abort/crash
(C) Maintains original read-only pages until atomic pointer swap
(D) Checks integrity rules at COMMIT rather than per DML line
Correct Answer: (C)
[EN] 'Shadow Paging' represents 'Maintains original read-only pages until atomic pointer swap' (Alternative to WAL needing no UNDO/REDO log replay).
[HI] 'Shadow Paging' का अर्थ/मान 'Maintains original read-only pages until atomic pointer swap' है (Alternative to WAL needing no UNDO/REDO log replay)।
ACID Properties of Transactions: Atomicity and Consistency — Exam FAQs
Q1: Why is Atomicity called 'All-or-Nothing'?
Atomicity को 'All-or-Nothing' नियम क्यों कहा जाता है?
[EN] Because a transaction cannot finish halfway: either all of its database updates apply together at commit, or every single partial change is undone on rollback or crash.
[HI] क्योंकि ट्रांजैक्शन आधा नहीं चल सकता—या तो उसके सभी अपडेट साथ में कमिट होकर लागू होंगे, या असफल होने पर हर छोटा बदलाव भी वापस हट जाएगा।
Q2: What is the difference between Atomicity and Consistency?
Atomicity और Consistency में क्या मुख्य अंतर है?
[EN] Atomicity is about execution completeness (no half-done transactions survive), whereas Consistency is about data correctness (constraints and invariants hold true before and after the transaction).
[HI] Atomicity कार्य के पूरा होने या न होने (Completeness) से जुड़ी है, जबकि Consistency डेटा के सही व नियमबद्ध (Correctness) बने रहने से जुड़ी है।
Q3: Can a DBMS guarantee Consistency if the user defines NO constraints at all?
यदि डेटाबेस टेबल में कोई भी कन्स्ट्रेंट न लगाया गया हो, तो क्या DBMS अकेले बिज़नेस Consistency की गारंटी दे सकता है?
[EN] DBMS still preserves Atomicity and Isolation, but without declared SQL constraints (CHECK, FK, UNIQUE), the DBMS cannot detect application-level logic errors made by programmers.
[HI] DBMS Atomicity व Isolation तो बनाए रखेगा, लेकिन घोषित कन्स्ट्रेंट्स के बिना वह प्रोग्रामर द्वारा की गई व्यावसायिक तार्किक गलतियों को पकड़ नहीं सकता।
Post a Comment
Post a Comment