Data - Transaction (Trans(versal?) actions)

Data System Architecture

About

A single logical operation on the data is called a transaction. A physical operation is called a request and therefore a transaction is a queue of request.

For example, a transfer of funds from one bank account to another, even though that might involve multiple changes (such as debiting one account and crediting another), is a single transaction.

A transaction has a beginning and an end.

This is the command pattern for data.

Example

A single transaction consists of one or more independent units of work, each reading and/or writing information to a database or other data store. When this happens it is often important to ensure that all such processing leaves the database or data store in a consistent state.

Examples from double-entry accounting systems often illustrate the concept of transactions. In double-entry accounting every debit requires the recording of an associated credit. If one writes a check for €100 to buy groceries, a transactional double-entry accounting system must record the following two entries to cover the single transaction:

  • Debit €100 to Groceries Expense Account
  • Credit €100 to Checking Account

A transactional system would make both entries — or both entries would fail. By treating the recording of multiple entries as an atomic transactional unit of work the system maintains the integrity of the data recorded. In other words, nobody ends up with a situation in which a debit is recorded but no associated credit is recorded, or vice versa.

Transaction Process

A simple transaction is usually issued to the database system in a language like SQL wrapped in a transaction, using a pattern similar to the following:

  • Begin the transaction
  • Execute several data manipulations and queries
  • If:
    • no errors occur, commit the transaction
    • errors occur then rollback the transaction
  • End the transaction

Purposes of Transactions

Transactions in a database environment have 4 purposes (Data Property - ACID (atomicity, consistency, isolation, durability))

  • atomicity: Transactions provide an “all-or-nothing” proposition, stating that each work-unit performed in a database must either complete in its entirety or have no effect whatsoever.
  • consistency: To provide reliable units of work that allow correct recovery from failures and keep a database consistent even in cases of system failure, when execution stops (completely or partially) and many operations upon a database remain uncompleted, with unclear status.
  • isolation: To provide isolation between programs accessing a database concurrently. Without isolation the programs' outcomes are possibly erroneous.

SQL Database

In the context of databases (“transactional databases”), a transaction is a logical, atomic unit of work that contains a series of SQL statements (one or more)

A database transaction consists of one or more statements. Specifically, a transaction consists of one of the following:

A commit ends the current transaction and makes permanent all changes performed in the transaction.

Documentation / Reference





Discover More
Data System Architecture
Asynchronous programming (Concurrency | Parallel)

application Asynchronous programming is notoriously difficult because the order of operations is highly unpredictable. From a classic computing perspective, concurrent and parallel are clearly synonyms...
Data System Architecture
Atomic Commit

An Atomic commit is a commit that implements atomicity for a transaction. Either all the tasks in a transaction must happen, or none of them. The transaction must be completed, or else it must be undone...
Data System Architecture
Auto-Commit Mode

autocommit mode is an application mode that performs the commit automatically. The commit is triggered by some condition that is dependent of your application. Most of the time, the commit is executed...
Card Puncher Data Processing
Code design - (Connection|Session)

During the use of a product, a session or connection is a execution context that holds identification data (if any) and group actions (such as interaction or transaction) that take place within...
Data System Architecture
Concurrency - Concurrency

Data concurrency means that many thread (that may represents users) can access and modify data at the same time. Data concurrency ensures that users can access data at the same time ...reubenbond/status/662061791497744384/photo/1Reuben...
Data System Architecture
Concurrency - Lock (Mutex)

A lock is a synchronizationmechanism designed to enforce a mutual exclusion of threads. A lock is also known as a mutex. Type: binary semaphore - yes / no Most locking designs block the execution...
Data System Architecture
Data - (Transaction|Action) Atomicity

An atomic action is one that effectively happens all at once. An atomic action cannot stop in the middle: it either happens completely, or it doesn't happen at all. No side effects of an atomic action...
Card Puncher Data Processing
Data Integration - Methods / Design Pattern

With multiple applications in your IT infrastructure reading and writing to and from different data stores in varying formats, it is imperative to implement a process that will let you integrate the data...
Data System Architecture
Data Management - (Transaction|Request|Commit|Redo) Log

(Transaction|Request|commit) logs are structured log file store all changes made to the data as they occur. They permits the implementation of : transaction isolation undoable operation. recovery...
Card Puncher Data Processing
Data Processing - Data Flow (ETL | Workflow | Pipeline)

A data flow is a workflow specialized for data processing Any system where the data moves between code units and triggers execution of the code could be called dataflow Dataflow_architecturecomputer...



Share this page:
Follow us:
Task Runner