What is a transaction? We will explain its meaning and basic role!
Home Transaction What is a transaction? We will explain its meaning and basic role!

What is a transaction? We will explain its meaning and basic role!

by

in

If you’re an aspiring programmer or engineer, you’ve probably seen or heard the word “transaction.” However, surprisingly many people, including current engineers, do not understand its meaning.

Therefore, in this article, we will explain the meaning of the word “transaction” and its basic role. If you are not familiar with transactions, please refer to this article to deepen your understanding of transactions.



What is a transaction?


First, I will explain the meaning of transaction.The word “transaction” has different meanings in the following two worlds.

  1. IT industry
  2. business

I will explain the meaning of each in turn.

 What is a transaction? We will explain its meaning and basic role!



In the IT industry, software processing methods


In the

IT

industry, “transaction” refers to a software processing method. The details of the processing method will be explained later, but this “transaction” processing method plays an especially important role in “database management systems.”

For IT system developers and programmers, it is very important to develop with transactions in mind.

 What is a transaction? We will explain its meaning and basic role!



commerce in business


In business, the word “transaction” refers to a “commerce transaction.” Specifically, it refers to each individual act in a transaction, such as purchasing or selling a product, making a payment, or receiving a product.

For example, the two acts of “purchasing” a product and “paying” are linked as a transaction. If the transaction (“purchase” and “payment”) is not completed, the transaction itself cannot be completed, such as “the product will not be delivered until the payment is completed.”

Transactions in business are an essential concept for the smooth progress of transactions, and require accurate and secure processing.

 What is a transaction? We will explain its meaning and basic role!



Origin of transaction


The word “transaction” comes from the Latin word “transactio.” It means “transaction, accomplishment, accomplishment” in Latin, and is also called “transaction” in English-speaking countries, and is widely used in business, finance, and the IT field.

In medieval Latin, the term was used to refer to the arrangement and execution of legal contracts. Since then, the term has come to be widely used in the business and financial fields, and has even become established in the IT field as a term referring to transaction processing on computers.

 What is a transaction? We will explain its meaning and basic role!



What is transaction processing?


Transaction processing is a system used for databases, online transactions, etc., and refers to a system that groups a series of operations into one logical processing unit and guarantees the completion of the processing.

In transaction processing, when there are multiple data processing steps, all operations can be undone if all steps are completed or if any one fails. If any problem occurs during a series of data processing, all operations up to that point are undone and the system is returned to its previous state in order to maintain data integrity.

Transaction processing is essential for maintaining data integrity and security, and is an essential technology for creating highly reliable systems.

 What is a transaction? We will explain its meaning and basic role!



Transaction processing example


I explained that transaction processing is “a system that organizes a series of operations into one logical processing unit and guarantees the completion of the processing.” To give you a better idea, I will introduce examples from several systems. Masu.

Examples of transaction processing include:

  1. Withdrawal from bank ATM
  2. Purchasing products at online shops
  3. Reservation processing in hotel and airline reservation systems

When withdrawing money from a bank ATM, the balance will be updated by deducting the amount withdrawn, but if for some reason the requested amount cannot be withdrawn, the entire process can be canceled.

When you purchase an item from an online shop, the stock quantity will be updated and the number of items will be reduced before payment is completed, but if payment is not completed, you can cancel the change in stock quantity.

In the reservation processing of hotel and airline reservation systems, when a user makes a reservation, a reservation slot is secured and the reservation information is stored in the database. However, if the reservation is not completed, the reservation You can return it.

Transaction processing is thus commonly used in familiar systems in our daily lives. Although we don’t really notice it in our daily lives, it is no exaggeration to say that the system functions properly due to transaction processing.

 What is a transaction? We will explain its meaning and basic role!



Transaction conditions


There are four conditions for transaction processing:

  1. Atomicity
  2. Consistency
  3. Independence
  4. Durability

I will explain each in turn.

 What is a transaction? We will explain its meaning and basic role!



Atomicity


Atomicity is the property that a transaction is complete only if all operations in the transaction have been completed or none have been performed.

If an error occurs during transaction execution and the process is interrupted, the transaction is invalidated by returning to its original state rather than reflecting the results up to that point in the database. .

This atomicity in transaction processing ensures data integrity, accurate database state, and high reliability.

 What is a transaction? We will explain its meaning and basic role!



Consistency


Consistency is the property that the state of the database before and after execution is consistent. When a transaction changes information in the database, it must be guaranteed that the change will be reflected after the transaction completes.

For example, suppose there is a transaction that reduces the balance in a bank account from 20,000 yen to 10,000 yen. After this transaction is completed, the bank account balance in the database should be 10,000 yen.

If an error occurs during transaction processing and the processing is interrupted, returning to the original state (with a balance of 20,000 yen) will invalidate the transaction and make the database state consistent. keep it in condition.



Independence


Isolation is the property that “even if multiple transactions are executed simultaneously, they do not affect each other.”

For example, let’s say you have a transaction that increases your bank account balance, and another transaction that also withdraws money from your bank account. In this case, it must be guaranteed that both transactions can be performed simultaneously without causing an error, and that the account balance will not change until each transaction is completed.

Database management systems have mechanisms such as exclusive control and concurrency control to guarantee the independence of transaction processing.



Durability


Persistence is the property that “after a transaction is completed, the processing results are permanently stored in the database.”

For example, if a transaction that increases the balance of a bank account is successfully completed, the results are stored in the database and reflected in subsequent transactions and balance inquiries. If the results of a transaction that increases the balance are completed and disappear from the database, there is a possibility that the balance will be insufficient for subsequent transactions.

Database management systems have a mechanism called a transaction log to persist the results of transaction processing. The transaction log records all database changes that occur when a transaction is executed, and is used to roll back or re-execute a transaction if necessary.

 What is a transaction? We will explain its meaning and basic role!



Relationship between transactions and blockchain


Transactions are also closely related to “blockchain”. A blockchain is a decentralized database managed by multiple participants. In reality, this blockchain is a collection of multiple transactions grouped into units called “blocks” and linked together like a list.

For example, remittance processing performed using virtual currency is transaction processing. If you want to transfer virtual currency from person A to person B, the process of recording the electronic signature and public key of the sender (person A), the amount to be transferred, the wallet address of the recipient (person B), etc. in a “block”. (transaction) will take place.

Each time a transaction occurs, information about that transaction is added to a new block. The new block is then chained together with the previous blocks, and a hash value is calculated to detect and invalidate any changes.

Additionally, transaction information is completely public on the blockchain and cannot be tampered with. This is because blockchain is a distributed ledger, so even if one node tampers with information, other nodes have the correct information and the tampering will be detected.

As described above, transactions and blockchain are closely related, and reliable recording of transactions is an essential element for blockchain technology to realize a distributed and highly reliable database.

Related articles
 What is a transaction? We will explain its meaning and basic role!



Terms related to transactions


Next, we will explain the following terms related to transactions.

  1. ACID characteristics
  2. distributed transaction processing
  3. TP monitor
  4. database management system
  5. SQL
  6. SQL query
  7. commit
  8. rollback
  9. backup

We will explain each in turn, so please use it as a reference for understanding the literature on transactions.



ACID characteristics


ACID characteristics is an acronym for the four characteristics explained in “Transaction Conditions” above.

The four characteristics are as follows.

  1. Atomicity
  2. Consistency
  3. Isolation
  4. Durability

The above four initials are called “ACID” characteristics.



distributed transaction processing


Distributed transaction processing is the process of executing transactions that span multiple databases and across multiple computers or networks.

Distributed transactions have the following advantages:

  1. Risk distribution in case of system failure
  2. Flexible response to system scale expansion

However, processing transactions across multiple databases can also introduce system complexity and latency issues. Therefore, distributed transaction processing requires careful design and implementation to ensure data consistency and integrity.



TP monitor


TP monitor is an abbreviation for “Transaction Processing Monitor” and is a tool for monitoring transaction processing systems.

TP Monitor can monitor transaction processing execution status, performance, errors, etc. in real time. Additionally, you can analyze errors and rerun or roll back transactions.

TP monitors are essential tools for monitoring and troubleshooting transaction processing systems, and many companies and organizations rely on them to ensure the performance and stability of their transaction processing systems.



database management system


Database Management System (DBMS) is software for managing databases. A database stores multiple related tables and data, and you can do the following with them:

  1. Data operations (search, update, delete, add, etc.)
  2. Definition of data types and structures
  3. Control of access rights to data
  4. Data backup and restore

The above features are essential for managing and protecting databases.

For reference, some common database management systems include:

  1. Oracle Database
  2. Microsoft SQL Server
  3. MySQL
  4. PostgreSQL

These are provided commercially or as open source, and each has different features and scope of application.



SQL


SQL stands for Structured Query Language and is the “standard” database language used for data manipulation and management in databases.

When using SQL in a transaction, you can manipulate data on the database by writing the operations (queries) that the transaction will perform in SQL statements and issuing them to the database management system.

Processing using SQL statements includes inserting, updating, deleting, and searching data. SQL has standardized syntax and functionality, and is compatible with many database management systems, making it a highly versatile and easy to learn language for programmers and database administrators.



SQL query


A SQL query is an SQL statement that performs data operations performed by a transaction on a database management system. SQL queries are instructions issued to a database management system to manipulate data on a database.

There are mainly following types of SQL queries:

  1. SELECT statement: Search and extract data
  2. INSERT statement: Insert data
  3. UPDATE statement: Updates data
  4. DELETE statement: deletes data

SQL queries are essential for working with databases, and are a very important skill for database administrators and developers.



commit


Commit is a process that indicates that a transaction has completed successfully in the database.

If the transaction is successful, perform a commit operation to persist the changed data and update the database state. On the other hand, if a transaction fails, a rollback process is performed to discard the changed data.

Commit processing and rollback processing are necessary for transaction completion, and are essential for guaranteeing atomicity and durability of transaction processing.



rollback


Rollback is the process of undoing changed data if a transaction fails.

If a transaction fails and the modified data remains intact, data corruption or inconsistencies occur. If a transaction fails, a rollback process is performed to return the database to the state it was in before the transaction started and discard the changed data.

This preserves atomicity and maintains data integrity even if a transaction does not complete successfully.



backup


Backup refers to saving the current state of the database before transactions affect the database. By performing a backup, you can easily restore the previous database state even if a transaction fails.

There are following types of backups:

  1. full backup
  2. differential backup
  3. incremental backup

A full backup is the process of creating a copy of all databases. A differential backup is a process that backs up only the data that has changed since the last full backup. Incremental backup is the process of backing up only the data that has been added since the last backup.

Backup is a part of transaction processing and is a very important process to maintain database consistency.

Related articles
 What is a transaction? We will explain its meaning and basic role!



summary


In this article, we explained the IT term “transaction” and its basic role. Transaction processing is often used in the various systems we use in our daily lives.

By maintaining data integrity through the four characteristics of transaction processing (atomicity, consistency, independence, and persistence), we can use various systems safely and securely in our daily lives. is.

If you are aspiring to become an engineer or programmer, or if you are an active engineer who feels that your understanding of transactions is shallow, read this article to deepen your understanding of transactions and develop with the concept of transactions in mind.