Skip to content

7. Advanced Transaction Processing

24.1 Transaction-Processing Monitors

  • Examples: Tuxedo, TopEnd, Encina, and Transaction server.
  • Types of TP monitors:
    • Process-per-client model:
      • Each client has its own process on the server.
      • Memory requirement is high because each process needs memory for its own stack, open file descriptors, and other data structures.
      • The overhead of context switching is high.
    • Single-server model:
      • The server is a single process that handles all the clients.
      • This process is multi-threaded, and each thread handles a client.
      • Problem: All apps run on the same process (security risk).
      • Problem: it is not suited for parallel or distributed databases since the single process can not run on multiple machines.
    • Many-server, single-router model:
      • Suitable for parallel and distributed databases, where a router process receives all requests from clients and forwards them to the appropriate server.
      • These server nodes can be on the same machine or on different machines.
      • A web server has a similar architecture.
    • Many-server, many-router model:
      • Many routers can route to many servers.
      • this increased the performance of the system.
  • TP monitors
  • Components of TP monitor:
    • Queue manager: queues the incoming requests.
    • Tp monitor components
  • Action primitives:
    • begin_transaction
    • commit_transaction
    • abort_transaction
    • prepare_to_commit_transaction (for 2-phase commit)
  • In client-server systems, clients often interact with servers via a remote-procedure-call (RPC) mechanism, where a client invokes a procedure call, which is actually executed at the server, with the results sent back to the client.

24.2 Transactional Workflows

  • A workflow is an activity in which multiple tasks are executed in a coordinated way by different processing entities; also called steps, task flows, or multisystem applications.
  • A task defines some work to be done and can be specified in a number of ways, including a textual description in a file or electronic mail message, a form, a message, or a computer program.
  • The processing entity that performs the tasks may be a person or a software system.
  • Two activities in general:
    • workflow specification: detailing the tasks that must be carried out and defining the execution requirements.
    • workflow execution: ensures computation correctness, data integrity, and durability.

24.3 Main-Memory Databases

  • Disk I/O is often the bottleneck for reads, as well as for transaction commits.
  • Disk-related limitations:
    • Log records must be written to stable storage before a transaction is committed.
    • Buffer blocks marked as modified by committed transactions still have to be written so that the amount of log that has to be replayed at recovery time is reduced.
    • If the system crashes, all of the main memory is lost. On recovery, the system has an empty database buffer, and data items must be input from the disk when they are accessed.
  • Main-memory database provides opportunities for optimizations:
    • Memory is costlier, in-memory databases must have internal data structures that reduce size.
    • There is no need to pin buffer pages in memory before data are accessed, since buffer pages will never be replaced.
    • Query processing should use less space so there is no need to use swap memory which is slow.
    • Locking and latching may be the new bottlenecks, so they should be optimized.
    • Recovery algorithms should be optimized so that no need to write log records to disk.
  • TimesTen and DataBlitz are two main-memory database products.

24.4 Real-Time Transaction Systems

  • Systems with deadlines are called real-time systems.
  • In real-time systems, deadlines, rather than absolute speed, are the most important issue.
  • In-memory databases are often used in real-time systems.

24.5 Long-Duration Transactions

  • Transactions that involve human interaction are called long-duration transactions.
  • Characteristics of such transactions:
    • Long duration. Once a human interacts with an active transaction, that transaction becomes a long-duration transaction from the perspective of the computer, since human response time is slow relative to computer speed.
    • Exposure of uncommitted data. Data generated and displayed to a user by a long-duration transaction are uncommitted, since the transaction may abort.
    • Subtasks.
    • Recoverability. Long-duration transactions must be recoverable, since the user may not be able to complete the transaction before a system failure.
  • If a subtransaction of T is permitted to release locks on completion, T is called a multilevel transaction.
  • If locks held by a subtransaction ti of T are automatically assigned to T on completion of ti, T is called a nested transaction.
  • Compensating transaction is a transaction that undoes the effects of a previous transaction.

24.6 Transaction Management in Multi databases

  • Multi database system creates the illusion of logical database integration, in a heterogeneous database system where the local database systems may employ different logical data models, data definition, and data manipulation languages, and may differ in their concurrency-control and transaction-management mechanisms.

References

  • Silberschatz, A., Korth, H.F., & Sudarshan, S. (2001). Database System Concepts (4th ed.). New York, NY: McGraw-Hill. Available at Database System Concepts 4th Edition By Silberschatz-Korth-Sudarshan.pdf Chapeter 24: Transaction Processing.