{"id":4907,"date":"2026-02-01T00:12:35","date_gmt":"2026-02-01T06:12:35","guid":{"rendered":"https:\/\/ykim.synology.me\/wordpress\/?p=4907"},"modified":"2026-02-01T08:45:13","modified_gmt":"2026-02-01T14:45:13","slug":"database-acid","status":"publish","type":"post","link":"https:\/\/ykim.synology.me\/wordpress\/database-acid-4907\/","title":{"rendered":"Database ACID"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/www.geeksforgeeks.org\/dbms\/acid-properties-in-dbms\/\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/media.geeksforgeeks.org\/wp-content\/uploads\/20250728165405585326\/acid_properties.webp\" alt=\"\" style=\"width:auto;height:300px\"\/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Think of <strong>ACID<\/strong> as the &#8220;Gold Standard&#8221; for database transactions. It is a set of four properties that guarantee a database remains reliable and accurate, even if the power goes out, the system crashes, or multiple people try to change the same data at once.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To make this real, imagine you are transferring <strong>$100<\/strong> from your Savings account to your Checking account.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" style=\"padding-left:0\">The Four Pillars of ACID<\/h2>\n\n\n\n<div class=\"wp-block-group\" style=\"padding-left:var(--wp--preset--spacing--60)\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-container-core-group-is-layout-a071c00b wp-block-group-is-layout-constrained\">\n<h3 class=\"wp-block-heading\">1. Atomicity (&#8220;All or Nothing&#8221;)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Atomicity ensures that a transaction is treated as a single &#8220;unit.&#8221; Either the entire operation succeeds, or none of it happens.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In our bank example, the transaction has two steps:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Subtract $100 from Savings.<\/li>\n\n\n\n<li>Add $100 to Checking.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If the system crashes after step 1 but before step 2, Atomicity ensures the $100 isn&#8217;t just &#8220;lost&#8221; in the void. The database will <strong>roll back<\/strong> the change so your Savings balance stays exactly where it was.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Consistency (Rules Stay Intact)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Consistency ensures that a transaction takes the database from one valid state to another, following all predefined rules (constraints).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your bank has a rule that an account balance can never be negative, and you try to transfer $500 when you only have $200, the database will reject the transaction because it violates the &#8220;Consistency&#8221; of the data rules.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Isolation (No Peeking)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In a busy database, thousands of transactions happen at once. Isolation ensures that concurrent transactions don&#8217;t interfere with each other.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are transferring money while your spouse is simultaneously checking the joint account balance, Isolation ensures they see either the balance <strong>before<\/strong> the transfer or <strong>after<\/strong>\u2014never a confusing &#8220;in-between&#8221; state where the money has left one account but hasn&#8217;t arrived in the other.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. Durability (Built to Last)<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Once a transaction is &#8220;committed&#8221; (confirmed as successful), it stays saved\u2014even if the power fails or the database crashes immediately afterward. The record is written to non-volatile memory (like a hard drive or SSD) so it can\u2019t be wiped out of temporary RAM.<\/p>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Why does it matter?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\" style=\"margin-left:var(--wp--preset--spacing--60)\">Without ACID, databases would be prone to &#8220;corrupt data&#8221;\u2014missing money, duplicate records, or ghost entries. While some modern &#8220;NoSQL&#8221; databases trade off some ACID properties for extreme speed (often called <strong>BASE<\/strong>), ACID remains the backbone of financial systems, healthcare records, and any application where data integrity is non-negotiable.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Summary Table<\/h3>\n\n\n\n<figure style=\"margin-right:var(--wp--preset--spacing--80);margin-bottom:0;margin-left:var(--wp--preset--spacing--60)\" class=\"wp-block-table\"><table><thead><tr><td><strong>Property<\/strong><\/td><td><strong>Plain English Definition<\/strong><\/td><\/tr><\/thead><tbody><tr><td><strong>Atomicity<\/strong><\/td><td>The whole transaction succeeds or fails together.<\/td><\/tr><tr><td><strong>Consistency<\/strong><\/td><td>The data follows all the &#8220;rules&#8221; of the system.<\/td><\/tr><tr><td><strong>Isolation<\/strong><\/td><td>Transactions don&#8217;t trip over each other.<\/td><\/tr><tr><td><strong>Durability<\/strong><\/td><td>Once saved, the data is permanent.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" style=\"margin-top:var(--wp--preset--spacing--60);margin-bottom:var(--wp--preset--spacing--60)\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Gemini<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<div style='text-align:center' class='yasr-auto-insert-overall'><\/div><div style='text-align:center' class='yasr-auto-insert-visitor'><\/div>","protected":false},"excerpt":{"rendered":"<p>Think of ACID as the &#8220;Gold Standard&#8221; for database transactions. It is a set of four properties that guarantee a database remains reliable and accurate, even if the power goes out, the system crashes, or multiple people try to change the same data at once. To make this real, imagine you are transferring $100 from&#8230;<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","yasr_overall_rating":0,"yasr_post_is_review":"","yasr_auto_insert_disabled":"","yasr_review_type":"","fifu_image_url":"","fifu_image_alt":"","iawp_total_views":0,"footnotes":""},"categories":[10,353],"tags":[],"class_list":["post-4907","post","type-post","status-publish","format-standard","hentry","category-software-slug","category-database-slug"],"yasr_visitor_votes":{"stars_attributes":{"read_only":false,"span_bottom":false},"number_of_votes":0,"sum_votes":0},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/4907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/comments?post=4907"}],"version-history":[{"count":4,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/4907\/revisions"}],"predecessor-version":[{"id":4913,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/posts\/4907\/revisions\/4913"}],"wp:attachment":[{"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/media?parent=4907"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/categories?post=4907"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ykim.synology.me\/wordpress\/wp-json\/wp\/v2\/tags?post=4907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}