You are on page 1of 2

A transactional 

database  is a DBMS where write operations on the database are able to be rolled back if they are not completed properly.

If a transactional database system loses electrical power half-way through a transaction, the partially completed transaction will be rolled back and
the database will be restored to the state it was in before the transaction started.

Transactional Database has the functionality or an important role required to maintain consistency and integrity
in the database.

Any database transaction (read from database or write into the database) must be Atomic, Consistent and have
Integrity, Durability popularly called in short as the ACID property of the database design.

1) A database management system should be able to recover from any kind of failure during a transaction
automatically like power failures or other interruptions.

2) A database should provide isolation between transactions happening concurrently.

Imagine that a front-end application is sending a customer order to a database system. The front-end application
sends the request to product to the customer and subtract the product from inventory. The front-end application
is about to send the request to create an invoice for the customer and suddenly the front-end application
crashes.

A transactional database can then roll back the partially


completed transaction.

An alternative to using a transactional database is to use atomic


operations.

Purpose of Transactional Database:


Transactional Database performs a roll back DBMS operation
whenever a WRITE function is not completed for success. It is
very important to maintain integrity and consistency in the
database design, transactional database achieves the integrity
and consistency.

Imagine, you are making shopping a toy for 10 dollars. You


provide your credit card to the merchant. The swipe the card and
your credit card get charged for the amount, but there is an issue
or power failure in the server where the 10 dollar is not getting credited to the merchant account. The merchant
will not be able to complete the transaction neither he is going to give you shopped due to this unsuccessful
transaction which is only half way through. You are not going to get your money back neither you are going to get
the toy which you tried to purchase. It is going to be a loss for one or other party involved in such transactions
transaction.

Transactional database provides functionality called ‘Roll back’ to overcome such losses. When a transaction did
not complete the roll back statement rolls the database to the state before beginning of the transaction which
failed. This helps to avoid any kind of loss and lets you start the transaction again afresh.

Transaction Database performs


1) A BEGIN statement to indicate the beginning of the transaction.
2) A set of SQL statements to indicate the required transaction to be performed over the database.
3) If the SQL statements fail, the transactional database rolls back the database to beginning state else if the SQL
statements are successful, A commit statement would be issued in order to confirm and complete the
transaction.

You might also like