{"id":1043,"date":"2026-10-30T12:16:10","date_gmt":"2026-10-30T12:16:10","guid":{"rendered":"https:\/\/blog.debuggersspace.com\/?p=1043"},"modified":"2026-10-30T14:12:02","modified_gmt":"2026-10-30T14:12:02","slug":"what-do-the-acid-properties-mean","status":"publish","type":"post","link":"https:\/\/blog.debuggersspace.com\/index.php\/2026\/10\/30\/what-do-the-acid-properties-mean\/","title":{"rendered":"What do the ACID properties mean?"},"content":{"rendered":"<div class='booster-block booster-read-block'>\n                <div class=\"twp-read-time\">\n                \t<i class=\"booster-icon twp-clock\"><\/i> <span>Read Time:<\/span>1 Minute, 43 Second                <\/div>\n\n            <\/div>\n<p class=\"wp-block-paragraph\">ACID describes what a database guarantees for a <strong>transaction<\/strong>, a group of statements that must succeed or fail together. Use one example for all four: moving \u20b91,000 from account A to account B.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>BEGIN;\nUPDATE accounts SET balance = balance - 1000 WHERE id = 'A';\nUPDATE accounts SET balance = balance + 1000 WHERE id = 'B';\nCOMMIT;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Atomicity: all or nothing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If the server crashes after the first update, the database rolls it back. A is never debited without B being credited.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Consistency: rules always hold<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The transaction takes the database from one valid state to another. Constraints such as <code>CHECK (balance &gt;= 0)<\/code>, foreign keys and unique keys are enforced; if one would break, the whole transaction fails.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Isolation: transactions do not see each other&#8217;s half-done work<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Two transfers running at once behave as if they ran one after another (at the strictest level). Databases offer levels that trade safety for speed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Level              Dirty read  Non-repeatable read  Phantom read\nREAD UNCOMMITTED   possible    possible             possible\nREAD COMMITTED     no          possible             possible\nREPEATABLE READ    no          no                   possible*\nSERIALIZABLE       no          no                   no\n* MySQL InnoDB also blocks most phantoms at this level.<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Dirty read<\/strong>: reading another transaction&#8217;s uncommitted change.<\/li>\n\n\n<li><strong>Non-repeatable read<\/strong>: the same row gives a different value when read twice.<\/li>\n\n\n<li><strong>Phantom read<\/strong>: re-running a query returns new rows.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Defaults differ: PostgreSQL, Oracle and SQL Server use READ COMMITTED; MySQL InnoDB uses REPEATABLE READ.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Durability: committed means saved<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once <code>COMMIT<\/code> returns, the change survives a crash or power cut, because it is written to a write-ahead or redo log on disk before the commit is acknowledged.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Follow-ups<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What is a deadlock and how does the database resolve it?<\/li>\n\n\n<li>Optimistic versus pessimistic locking.<\/li>\n\n\n<li>How do microservices keep consistency without one ACID transaction (sagas, the outbox pattern)?<\/li>\n\n\n<li>What does BASE mean in NoSQL databases?<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><em>This answer was written by Debugger&#8217;s Space as practice material. It is asked in most Indian IT services interviews (TCS, Infosys, Wipro, HCLTech, Tech Mahindra, LTIMindtree, Accenture, Cognizant, Capgemini, IBM). See each company&#8217;s hiring steps and practice questions on <a href=\"https:\/\/www.debuggersspace.com\/companies\">Debugger&#8217;s Space<\/a>.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Atomicity, consistency, isolation and durability explained with a bank transfer, plus isolation levels and the read anomalies they prevent.<\/p>\n","protected":false},"author":43,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[263],"tags":[234,283,236,235,267,231,237,229,233,265,228,232,230],"class_list":["post-1043","post","type-post","status-publish","format-standard","hentry","category-common-interview-questions","tag-accenture","tag-acid","tag-capgemini","tag-cognizant","tag-dbms-interview-questions","tag-hcltech","tag-ibm","tag-infosys","tag-ltimindtree","tag-sql-interview-questions","tag-tcs","tag-tech-mahindra","tag-wipro"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Himanshu Namdeo","author_link":"https:\/\/blog.debuggersspace.com\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Atomicity, consistency, isolation and durability explained with a bank transfer, plus isolation levels and the read anomalies they prevent.","_links":{"self":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/1043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/users\/43"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/comments?post=1043"}],"version-history":[{"count":1,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/1043\/revisions"}],"predecessor-version":[{"id":1084,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/posts\/1043\/revisions\/1084"}],"wp:attachment":[{"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/media?parent=1043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/categories?post=1043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.debuggersspace.com\/index.php\/wp-json\/wp\/v2\/tags?post=1043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}