Skip to content

Instantly share code, notes, and snippets.

@DanielHe4rt
Created July 3, 2023 18:15
Show Gist options
  • Save DanielHe4rt/a5db7e2e65c9944aa6fa092c5b184b0a to your computer and use it in GitHub Desktop.
Save DanielHe4rt/a5db7e2e65c9944aa6fa092c5b184b0a to your computer and use it in GitHub Desktop.
ACID Database Studies
  • Acronym
    • Atomicity
      • One operation per time, independent on which one (INSERT, UPDATE, DELETE etc), preventing any error to be persisted. Basically: every piece of your query should be ok "atomically speaking" to be considered a successful operation.
      • If any part of the operation fails, it will roll everything back.
    • Consistency
      • Let you only write data that is predefined previously. Like a table modeling with specifics data types, constraints, cascades, indexes or any other modeled clause.
    • Isolation
      • Each operation per time without interfere in other operations;
      • Each operation is independent of other transactions;
      • Syncronous operation;
    • Durability
      • A successful operation will be permanently stored in your database.
  • Transactions
    • Database process that is threated as an unit: everything inside this transaction should met all the requirements to be considered ok.
    • On all the requirements I mean ACID
    • Good to have when you need to ensure the shape and the reliability.
    • Not good to have when you already trust your data integrity and needs to speed things up.
  • Conclusions
    • ACID databases is hard to scale since needs more CPU and a huge queue
    • If used as a primary database on a higher throughput application, it will cost a lot. Still a possibility, if your name is Jeff Bezos.
    • Highly recommended for structures that needs complex and durable queries
    • Not recommended for higher throughput applications.
  • Things to research
    • Why ACID is contested by the tech community?

https://en.wikipedia.org/wiki/Durability_(database_systems) https://en.wikipedia.org/wiki/Consistency_(database_systems) https://www.scylladb.com/glossary/database-consistency/ https://www.databricks.com/glossary/acid-transactions https://en.wikipedia.org/wiki/Atomicity_(database_systems)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment