Giter VIP home page Giter VIP logo

transactionalatomicity's Introduction

Atomicity

Refer to this article written by me: Ensuring Consistent Transactions I've tried to showcase how atomicity in transactions actually take place.

Example

We're taking an example of 2 accounts (id = 3 and 4). A transaction takes place where money is supposed to get deducted from account id = 3 and should be added to account id = 4. If this wasn't atomic, this transaction might fail when money is deducted from account id = 3 before adding the same to other account.

Let's see a happy scenario.

  1. Initially these are the account balances.

  1. After the transaction happens successfully:

Now, when an error occur in between the transaction - Let's say account 4 does not exist anymore:

  1. Atomic transaction - Balance of account 3 remains same when the transaction fails due to account 4 not being present in DB.
  2. Non-Atomic Transaction - setting auto commit true for each statement.

transactionalatomicity's People

Contributors

simrank0 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.