Contents
1. DEFINITION .
2. EXAMPLE.
3. PROPERTIES.
4. TYPES.
5. WORKING.
6. LONG DURATION TRANSACTIONS.
7. ADVANTAGES & DISADVANTAGES.
8. LONG DURATION TRANSACTIONS.
DEFINITION
 A transaction can be defined as group of tasks. A single
task is the minimum processing unit which cannot be
divided further.
 It is an action, or series of actions that are being
performed by a single user or application program,
which reads or updates the information.
 A transaction processing system (TPS) is a type of
information system that collects , stores, modifies &
retrieves the data transactions of an enterprise.
Example Of A Transaction In DBMS
 Suppose a bank employee transfers Rs 500 from A's account
to B's account. This very simple and small transaction
involves several low-level tasks.
 A’s Account
Open_Account(A)
Old_Balance = A.balance
New_Balance = Old_Balance – 500
A.balance = New_Balance
Close_Account(A)
Continue…
 B’s Account
Open_Account(B)
Old_Balance = B.balance
New_Balance = Old_Balance + 500
B.balance = New_Balance
Close_Account(B)
PROPERTIES OF TRANSACTIONS
 There are properties that all transactions should follow
& possess.
 The four basic are in combination termed as ACID
properties.
 The ACID has a full form & is as follows:
1. ATOMICITY: Atomicity means that a transaction is
either completed in full or not at all.
Continue…
 For example, if funds are transferred from one account
to another , this only counts as a bone fide transaction
if both the withdrawal & deposit take place.
 If one account is debited & the other is not credited, it
does not quilify as a transaction.
 TPS systems ensure that transactions take place in
their entirety.
Continue…
2. Consistency: TPS systems exist within a set of operating rules (or
integrity constraints).
 If an integrity constraint states that all transactions in a database must
have a positive value, any transaction with a negative value would be
refused.
3. Isolation: Transactions must appear to take place in isolation.
 For example, when a fund transfer is made b/w two accounts the
debiting of one & the crediting of another must appear to take place
simultaneously.
 The funds cannot be credited to an account before they are debited
from another.
Continue…
4. Durability: Once transactions are completed they
cannot be undone.
To ensure that this is the case even if the TPS suffers
failure, a log will be created to document all completed
transactions.
TYPES OF TPS
 There are two types of TPS:
1. Batch Processing
2. Real Time Processing.
1. Batch Processing:
• Batch Processing is where the information is collected &
stored as a batch but not processed immediately.
• Batch processing is useful for enterprises that need to
process large amounts of data using limited resources.
Continue…
 Example: Payment by cheque, Credit card
transactions, etc.
2. Real Time Transaction Processing:
• Real Time Transaction Processing as the immediate
processing of data with the database updated as the
transaction is being carried out.
• Mostly in Online shopping.
Continue…
 Example: Bank ATM & POS terminal( Point of sale
terminal) , both of which have user input which
requires immediate feedback.
Working Of TPS
Advantages & Disadvantages Of
TPS
Advantages:
1. Batch or Real Time Processing available.
2. Reduction in processing time, lead time & order cycle
time.
3. Reduction in inventory, personnel & ordering cost.
4. Increase in productivity & customer satisfaction.
Disadvantages:
1. High setup costs.
2. Lack of standard formats.
3. Hardware & software incompatibility.
Long Duration Transactions
Traditional concurrency control techniques do not work
well when user interaction is required:
 Long duration: Design edit sessions are very long
 Exposure of uncommitted data: E.g., partial update to a
design
 Subtasks: support partial rollback
 Recoverability: on crash state should be restored even for
yet-to-be committed data, so user work is not lost.
 Performance: fast response time is essential so user time
is not wasted.
Continue…
 Represent as a nested transaction
 atomic database operations (read/write) at a lowest level.
 If transaction fails, only active short-duration transactions abort.
 Active long-duration transactions resume once any short
duration transactions have recovered.
 The efficient management of long-duration waits, and the
possibility of aborts.
 Need alternatives to waits and aborts; alternative techniques
must ensure correctness without requiring serializability.
THANK YOU

Transaction processing ppt

  • 2.
    Contents 1. DEFINITION . 2.EXAMPLE. 3. PROPERTIES. 4. TYPES. 5. WORKING. 6. LONG DURATION TRANSACTIONS. 7. ADVANTAGES & DISADVANTAGES. 8. LONG DURATION TRANSACTIONS.
  • 3.
    DEFINITION  A transactioncan be defined as group of tasks. A single task is the minimum processing unit which cannot be divided further.  It is an action, or series of actions that are being performed by a single user or application program, which reads or updates the information.  A transaction processing system (TPS) is a type of information system that collects , stores, modifies & retrieves the data transactions of an enterprise.
  • 4.
    Example Of ATransaction In DBMS  Suppose a bank employee transfers Rs 500 from A's account to B's account. This very simple and small transaction involves several low-level tasks.  A’s Account Open_Account(A) Old_Balance = A.balance New_Balance = Old_Balance – 500 A.balance = New_Balance Close_Account(A)
  • 5.
    Continue…  B’s Account Open_Account(B) Old_Balance= B.balance New_Balance = Old_Balance + 500 B.balance = New_Balance Close_Account(B)
  • 6.
    PROPERTIES OF TRANSACTIONS There are properties that all transactions should follow & possess.  The four basic are in combination termed as ACID properties.  The ACID has a full form & is as follows: 1. ATOMICITY: Atomicity means that a transaction is either completed in full or not at all.
  • 7.
    Continue…  For example,if funds are transferred from one account to another , this only counts as a bone fide transaction if both the withdrawal & deposit take place.  If one account is debited & the other is not credited, it does not quilify as a transaction.  TPS systems ensure that transactions take place in their entirety.
  • 8.
    Continue… 2. Consistency: TPSsystems exist within a set of operating rules (or integrity constraints).  If an integrity constraint states that all transactions in a database must have a positive value, any transaction with a negative value would be refused. 3. Isolation: Transactions must appear to take place in isolation.  For example, when a fund transfer is made b/w two accounts the debiting of one & the crediting of another must appear to take place simultaneously.  The funds cannot be credited to an account before they are debited from another.
  • 9.
    Continue… 4. Durability: Oncetransactions are completed they cannot be undone. To ensure that this is the case even if the TPS suffers failure, a log will be created to document all completed transactions.
  • 10.
    TYPES OF TPS There are two types of TPS: 1. Batch Processing 2. Real Time Processing. 1. Batch Processing: • Batch Processing is where the information is collected & stored as a batch but not processed immediately. • Batch processing is useful for enterprises that need to process large amounts of data using limited resources.
  • 11.
    Continue…  Example: Paymentby cheque, Credit card transactions, etc. 2. Real Time Transaction Processing: • Real Time Transaction Processing as the immediate processing of data with the database updated as the transaction is being carried out. • Mostly in Online shopping.
  • 12.
    Continue…  Example: BankATM & POS terminal( Point of sale terminal) , both of which have user input which requires immediate feedback.
  • 13.
  • 14.
    Advantages & DisadvantagesOf TPS Advantages: 1. Batch or Real Time Processing available. 2. Reduction in processing time, lead time & order cycle time. 3. Reduction in inventory, personnel & ordering cost. 4. Increase in productivity & customer satisfaction. Disadvantages: 1. High setup costs. 2. Lack of standard formats. 3. Hardware & software incompatibility.
  • 15.
    Long Duration Transactions Traditionalconcurrency control techniques do not work well when user interaction is required:  Long duration: Design edit sessions are very long  Exposure of uncommitted data: E.g., partial update to a design  Subtasks: support partial rollback  Recoverability: on crash state should be restored even for yet-to-be committed data, so user work is not lost.  Performance: fast response time is essential so user time is not wasted.
  • 16.
    Continue…  Represent asa nested transaction  atomic database operations (read/write) at a lowest level.  If transaction fails, only active short-duration transactions abort.  Active long-duration transactions resume once any short duration transactions have recovered.  The efficient management of long-duration waits, and the possibility of aborts.  Need alternatives to waits and aborts; alternative techniques must ensure correctness without requiring serializability.
  • 17.