SlideShare a Scribd company logo
1 of 46
Chapter 24: Advanced Transaction Processing

Transaction-Processing Monitors
Transactional Workflows
High-Performance Transaction Systems
 Main memory databases
 Real-Time Transaction Systems

Long-Duration Transactions
Transaction management in multidatabase systems

1
Database System Concepts

24.1

©Silberschatz, Korth and Sudarshan
Transaction Processing Monitors
TP monitors initially developed as multithreaded servers to
support large numbers of terminals from a single process.
Provide infrastructure for building and administering complex
transaction processing systems with a large number of clients
and multiple servers.
Provide services such as:
 Presentation facilities to simplify creating user interfaces
 Persistent queuing of client requests and server responses
 Routing of client messages to servers
 Coordination of two-phase commit when transactions access
multiple servers.

Some commercial TP monitors: CICS from IBM, Pathway from
Tandem, Top End from NCR, and Encina from Transarc

2
Database System Concepts

24.2

©Silberschatz, Korth and Sudarshan
TP Monitor Architectures

3
Database System Concepts

24.3

©Silberschatz, Korth and Sudarshan
TP Monitor Architectures (Cont.)
Process per client model - instead of individual login session
per terminal, server process communicates with the terminal,
handles authentication, and executes actions.
 Memory requirements are high
 Multitasking- high CPU overhead for context switching between
processes

Single process model - all remote terminals connect to a
single server process.
 Used in client-server environments
 Server process is multi-threaded; low cost for thread switching
 No protection between applications
 Not suited for parallel or distributed databases

4
Database System Concepts

24.4

©Silberschatz, Korth and Sudarshan
TP Monitor Architectures (Cont.)
Many-server single-router model - multiple application
server processes access a common database; clients
communicate with the application through a single
communication process that routes requests.
 Independent server processes for multiple applications
 Multithread server process
 Run on parallel or distributed database

Many server many-router model - multiple processes
communicate with clients.
 Client communication processes interact with router
processes that route their requests to the appropriate server.
 Controller process starts up and supervises other processes.

5
Database System Concepts

24.5

©Silberschatz, Korth and Sudarshan
Detailed Structure of a TP Monitor

6
Database System Concepts

24.6

©Silberschatz, Korth and Sudarshan
Detailed Structure of a TP Monitor
Queue manager handles incoming messages
Some queue managers provide persistent or durable
message queueing contents of queue are safe even if
systems fails.
Durable queueing of outgoing messages is important
 application server writes message to durable queue as part of a
transaction
 once the transaction commits, the TP monitor guarantees
message is eventually delevered, regardless of crashes.
 ACID properties are thus provided even for messages sent
outside the database

Many TP monitors provide locking, logging and recovery
services, to enable application servers to implement ACID
properties by themselves.

7
Database System Concepts

24.7

©Silberschatz, Korth and Sudarshan
Application Coordination Using TP
Monitors
A TP monitor treats each subsystem as a resource manager
that provides transactional access to some set of resources.
The interface between the TP monitor and the resource
manager is defined by a set of transaction primitives
The resource manager interface is defined by the X/Open
Distributed Transaction Processing standard.
TP monitor systems provide a transactional remote
procedure call (transactional RPC) interface to their
service
 Transactional RPC provides calls to enclose a series of RPC calls
within a transaction.
 Updates performed by an RPC are carried out within the scope of
the transaction, and can be rolled back if there is any failure.

8
Database System Concepts

24.8

©Silberschatz, Korth and Sudarshan
Workflow Systems

Copyright: Silberschatz, Korth and Sudarshan

9
Transactional Workflows
Workflows are activities that involve the coordinated execution
of multiple tasks performed by different processing entities.
With the growth of networks, and the existence of multiple
autonomous database systems, workflows provide a convenient
way of carrying out tasks that involve multiple systems.
Example of a workflow delivery of an email message, which goes
through several mails systems to reach destination.
 Each mailer performs a tasks: forwarding of the mail to the next
mailer.
 If a mailer cannot deliver mail, failure must be handled semantically
(delivery failure message).

Workflows usually involve humans: e.g. loan processing, or
purchase order processing.

10
Database System Concepts

24.10

©Silberschatz, Korth and Sudarshan
Examples of Workflows

11
Database System Concepts

24.11

©Silberschatz, Korth and Sudarshan
Loan Processing Workflow

In the past, workflows were handled by creating and
forwarding paper forms
Computerized workflows aim to automate many of the tasks.
But the humans still play role e.g. in approving loans.

12
Database System Concepts

24.12

©Silberschatz, Korth and Sudarshan
Transactional Workflows
Must address following issues to computerize a workflow.
 Specification of workflows - detailing the tasks that must be carried out
and defining the execution requirements.
 Execution of workflows - execute transactions specified in the workflow
while also providing traditional database safeguards related to the
correctness of computations, data integrity, and durability.
 E.g.: Loan application should not get lost even if system fails.

Extend transaction concepts to the context of workflows.
State of a workflow - consists of the collection of states of its
constituent tasks, and the states (i.e. values) of all variables in the
execution plan.

13
Database System Concepts

24.13

©Silberschatz, Korth and Sudarshan
Workflow Specification
Static specification of task coordination:
 Tasks and dependencies among them are defined before the execution
of the workflow starts.
 Can establish preconditions for execution of each task: tasks are
executed only when their preconditions are satisfied.
 Defined preconditions through dependencies:
 Execution states of other tasks.

“task ti cannot start until task tj has ended”
 Output values of other tasks.

“task ti can start if task tj returns a value greater than 25”
 External variables, that are modified by external events.

“task ti must be started within 24 hours of the completion of task tj”

14
Database System Concepts

24.14

©Silberschatz, Korth and Sudarshan
Workflow Specification (Cont.)
Dynamic task coordination
E.g. Electronic mail routing system in which the text to be
schedule for a given mail message depends on the
destination address and on which intermediate routers are
functioning.

15
Database System Concepts

24.15

©Silberschatz, Korth and Sudarshan
Failure-Automicity Requirements
Usual ACID transactional requirements are too
strong/unimplementable for workflow applications.
However, workflows must satisfy some limited transactional
properties that guarantee a process is not left in an
inconsistent state.
Acceptable termination states - every execution of a
workflow will terminate in a state that satisfies the failureatomicity requirements defined by the designer.
 Committed - objectives of a workflow have been achieved.
 Aborted - valid termination state in which a workflow has failed to
achieve its objectives.

A workflow must reach an acceptable termination state even
in the presence of system failures.

16
Database System Concepts

24.16

©Silberschatz, Korth and Sudarshan
Execution of Workflows
Workflow management systems include:
Scheduler - program that process workflows by submitting
various tasks for execution, monitoring various events, and
evaluation conditions related to intertask dependencies
Task agents - control the execution of a task by a processing
entity.
Mechanism to query to state of the workflow system.

17
Database System Concepts

24.17

©Silberschatz, Korth and Sudarshan
Workflow Management System Architectures
Centralized - a single scheduler schedules the tasks for all
concurrently executing workflows.
 used in workflow systems where the data is stored in a central
database.
 easier to keep track of the state of a workflow.

Partially distributed - has one (instance of a ) scheduler for each
workflow.
Fully distributed - has no scheduler, but the task agents
coordinate their execution by communicating with each other to
satisfy task dependencies and other workflow execution
requirements.
 used in simplest workflow execution systems
 based on electronic mail

18
Database System Concepts

24.18

©Silberschatz, Korth and Sudarshan
Workflow Scheduler
Ideally scheduler should execute a workflow only after
ensuring that it will terminate in an acceptable state.
Consider a workflow consisting of two tasks S1 and S2. Let the
failure-atomicity requirement be that either both or neither of
the subtransactions should be committed.
 Suppose systems executing S1 and S2 do not provide prepared-tocommit states and S1 or S2 do not have compensating
transactions.
 It is then possible to reach a state where one subtransaction is
committed and the other aborted. Both cannot then be brought to
the same state.
 Workflow specification is unsafe, and should be rejected.

Determination of safety by the scheduler is not possible in
general, and is usually left to the designer of the workflow.

19
Database System Concepts

24.19

©Silberschatz, Korth and Sudarshan
Recovery of a Workflow
Ensure that is a failure occurs in any of the workflowprocessing components, the workflow eventually reaches
an acceptable termination state.
Failure-recovery routines need to restore the state
information of the scheduler at the time of failure, including
the information about the execution states of each task.
Log status information on stable storage.
Handoff of tasks between agents should occur exactly
once in spite of failure.
Problem: Repeating handoff on recovery may lead to
duplicate execution of task; not repeating handoff may lead
to task not being executed.
 Solution: Persistent messaging systems

20
Database System Concepts

24.20

©Silberschatz, Korth and Sudarshan
Recovery of a Workflow (Cont.)
Persistent messages: messages are stored in permanent
message queue and therefore not lost in case of failure.
 Described in detail in Chapter 19 (Distributed Databases)

Before an agent commits, it writes to the persistent message
queue whatever messages need to be sent out.
The persistent message system must make sure the messages
get delivered eventually if and only if the transaction commits.
The message system needs to resend a message when the site
recovers, if the message is not known to have reached its
destination.
Messages must be logged in stable storage at the receiving end to
detect multiple receipts of a message.

21
Database System Concepts

24.21

©Silberschatz, Korth and Sudarshan
High Performance
Transaction Systems

Copyright: Silberschatz, Korth and Sudarshan

22
High-Performance Transaction Systems
High-performance hardware and parallelism help improve
the rate of transaction processing, but are insufficient to
obtain high performance:
 Disk I/O is a bottleneck — I/O time (10 milliseconds) has no
decreased at a rate comparable to the increase in processor
speeds.
 Parallel transactions may attempt to read or write the same
data item, resulting in data conflicts that reduce effective
parallelism

We can reduce the degree to which a database system is
disk bound by increasing the size of the database buffer.

23
Database System Concepts

24.23

©Silberschatz, Korth and Sudarshan
Main-Memory Database
Commercial 64-bit systems can support main memories of
tens of gigabytes.
Memory resident data allows faster processing of
transactions.
Disk-related limitations:
 Logging is a bottleneck when transaction rate is high.
 Use group-commit to reduce number of output operations (Will
study two slides ahead.)
 If the update rate for modified buffer blocks is high, the disk
data-transfer rate could become a bottleneck.
 If the system crashes, all of main memory is lost.

24
Database System Concepts

24.24

©Silberschatz, Korth and Sudarshan
Main-Memory Database Optimizations
To reduce space overheads, main-memory databases can
use structures with pointers crossing multiple pages. In disk
databases, the I/O cost to traverse multiple pages would be
excessively high.
No need to pin buffer pages in memory before data are
accessed, since buffer pages will never be replaced.
Design query-processing techniques to minimize space
overhead - avoid exceeding main memory limits during
query evaluation.
Improve implementation of operations such as locking and
latching, so they do not become bottlenecks.
Optimize recovery algorithms, since pages rarely need to
be written out to make space for other pages.

25
Database System Concepts

24.25

©Silberschatz, Korth and Sudarshan
Group Commit
Idea: Instead of performing output of log records to stable
storage as soon as a transaction is ready to commit, wait until
 log buffer block is full, or
 a transaction has been waiting sufficiently long after being ready to
commit

Results in fewer output operations per committed transaction,
and correspondingly a higher throughput.
However, commits are delayed until a sufficiently large group of
transactions are ready to commit, or a transaction has been
waiting long enough-leads to slightly increased response time.
Above delay acceptable in high-performance transaction
systems since log buffer blocks will fill up quickly.

26
Database System Concepts

24.26

©Silberschatz, Korth and Sudarshan
Real-Time Transaction Systems
In systems with real-time constraints, correctness of execution
involves both database consistency and the satisfaction of
deadlines.
 Hard deadline – Serious problems may occur if task is not completed
within deadline
 Firm deadline - The task has zero value if it completed after the
deadline.
 Soft deadline - The task has diminishing value if it is completed after
the deadline.

The wide variance of execution times for read and write operations
on disks complicates the transaction management problem for timeconstrained systems
 main-memory databases are thus often used
 Waits for locks, transaction aborts, contention for resources remain as
problems even if data is in main memory

Design of a real-time system involves ensuring that enough
processing power exists to meet deadline without requiring
excessive hardware resources.

27
Database System Concepts

24.27

©Silberschatz, Korth and Sudarshan
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.

28
Database System Concepts

24.28

©Silberschatz, Korth and Sudarshan
Long-Duration Transactions
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.

29
Database System Concepts

24.29

©Silberschatz, Korth and Sudarshan
Concurrency Control
Correctness without serializability:
 Correctness depends on the specific consistency constraints
for the databases.
 Correctness depends on the properties of operations
performed by each transaction.

Use database consistency constraints as to split the
database into subdatabases on which concurrency can be
managed separately.
Treat some operations besides read and write as
fundamental low-level operations and extend concurrency
control to deal with them.

30
Database System Concepts

24.30

©Silberschatz, Korth and Sudarshan
Concurrency Control (Cont.)
A non-conflict-serializable
schedule that preserves
the sum of A + B

31
Database System Concepts

24.31

©Silberschatz, Korth and Sudarshan
Nested and Multilevel Transactions
A nested or multilevel transaction T is represented by a
set
T = {t1, t2, ..., tn} of subtransactions and a partial order P on T.
A subtransaction ti in T may abort without forcing T to abort.
Instead, T may either restart ti, or simply choose not to run ti.
If ti commits, this action does not make ti, permanent (unlike the
situation in Chapter 15). Instead, ti, commits to T, and may still
abort (or require compensation) if T aborts.
An execution of T must not violate the partial order P, i.e., if an
edge ti → ti appears in the precedence graph, then ti → ti must
not be in the transitive closure of P.

32
Database System Concepts

24.32

©Silberschatz, Korth and Sudarshan
Nested and Multilevel Transactions
(Cont.)
Subtransactions can themselves be nested/multilevel
transactions.
 Lowest level of nesting: standard read and write operations.

Nesting can create higher-level operations that may enhance
concurrency.
Types of nested/ multilevel transactions:

 Multilevel transaction: subtransaction of T is permitted to
release locks on completion.
 Saga: multilevel long-duration transaction.
 Nested transaction: locks held by a subtransaction ti of T
are automatically assign to T on completion of ti.

33
Database System Concepts

24.33

©Silberschatz, Korth and Sudarshan
Example of Nesting
Rewrite transaction T1 using subtransactions Ta and Tb
that perform increment or decrement operations:
 T1 consists of
 T1,1, which subtracts 50 from A
 T1,2, which adds 50 to B

Rewrite transaction T2 using subtransactions Tc and Td
that perform increment or decrement operations:
 T2 consists of
 T2,1, which subtracts 10 from B
 T2,2, which adds 10 to A

No ordering is specified on subtransactions; any
execution generates a correct result.

34
Database System Concepts

24.34

©Silberschatz, Korth and Sudarshan
Compensating Transactions
Alternative to undo operation; compensating transactions deal
with the problem of cascading rollbacks.
Instead of undoing all changes made by the failed transaction,
action is taken to “compensate” for the failure.
Consider a long-duration transaction Ti representing a travel
reservation, with subtransactions Ti,1, which makes airline
reservations, Ti,2 which reserves rental cars, and Ti,3 which
reserves a hotel room.
 Hotel cancels the reservation.
 Instead of undoing all of Ti, the failure of Ti,3 is compensated for by
deleting the old hotel reservation and making a new one.
 Requires use of semantics of the failed transaction.

35
Database System Concepts

24.35

©Silberschatz, Korth and Sudarshan
Implementation Issues
For long-duration transactions to survive system crashes, we
must log not only changes to the database, but also changes to
internal system data pertaining to these transactions.
Logging of updates is made more complex by physically large
data items (CAD design, document text); undesirable to store both
old and new values.
Two approaches to reducing the overhead of ensuring the
recoverability of large data items:
 Operation logging. Only the operation performed on the data item and
the data-item name are stored in the log.
 Logging and shadow paging. Use logging from small data items; use
shadow paging for large data items. Only modified pages need to be
stored in duplicate.

36
Database System Concepts

24.36

©Silberschatz, Korth and Sudarshan
Transaction Management in
Multidatabase Systems
Transaction management is complicated in multidatabase
systems because of the assumption of autonomy
 Global 2PL -each local site uses a strict 2PL (locks are released at
the end); locks set as a result of a global transaction are released
only when that transaction reaches the end.
 Guarantees global serializability

 Due to autonomy requirements, sites cannot cooperate and execute
a common concurrency control scheme
 E.g. no way to ensure that all databases follow strict 2PL

Solutions:
 provide very low level of concurrent execution, or
 use weaker levels of consistency

37
Database System Concepts

24.37

©Silberschatz, Korth and Sudarshan
Transaction Management
Local transactions are executed by each local DBMS, outside of
the MDBS system control.
Global transactions are executed under multidatabase control.
Local autonomy - local DBMSs cannot communicate directly to
synchronize global transaction execution and the multidatabase
has no control over local transaction execution.
 local concurrency control scheme needed to ensure that DBMS’s
schedule is serializable
 in case of locking, DBMS must be able to guard against local
deadlocks.
 need additional mechanisms to ensure global serializability

38
Database System Concepts

24.38

©Silberschatz, Korth and Sudarshan
Two-Level Serializability
DBMS ensures local serializability among its local transactions,
including those that are part of a global transaction.
The multidatabase ensures serializability among global
transactions alone- ignoring the orderings induced by local
transactions.
2LSR does not ensure global serializability, however, it can fulfill
requirements for strong correctness.
1. Preserve consistency as specified by a given set of constraints
2. Guarantee that the set of data items read by each transaction is
consistent

Global-read protocol : Global transactions can read, but not
update, local data items; local transactions do not have access
to global data. There are no consistency constraints between
local and global data items.

39
Database System Concepts

24.39

©Silberschatz, Korth and Sudarshan
Two-Level Serializability (Cont.)
Local-read protocol : Local transactions have read access to
global data; disallows all access to local data by global
transactions.
A transaction has a value dependency if the value that it writes to
a data item at one site depends on a value that it read for a data
item on another site.
For strong correctness: No transaction may have a value
dependency.
Global-read-write/local-read protocol; Local transactions
have read access to global data; global transactions may read
and write all data;
No consistency constraints between local and global data items.
No transaction may have value dependency.

40
Database System Concepts

24.40

©Silberschatz, Korth and Sudarshan
Global Serializability
Even if no information is available concerning the structure of the
various concurrency control schemes, a very restrictive protocol
that ensures serializability is available.
Transaction-graph : a graph with vertices being global
transaction names and site names.
An undirected edge (Ti, Sk) exists if Ti is active at site Sk.
Global serializability is assured if transaction-graph contains no
undirected cycles.

41
Database System Concepts

24.41

©Silberschatz, Korth and Sudarshan
Ensuring Global Serializability
Each site Si has a special data item, called ticket
Every transaction Tj that runs at site Sk writes to the ticket at site
Si
Ensures global transactions are serialized at each site,
regardless of local concurrency control method, so long as the
method guarantees local serializability
Global transaction manager decides serial ordering of global
transactions by controlling order in which tickets are accessed
However, above protocol results in low concurrency between
global transactions.

42
Database System Concepts

24.42

©Silberschatz, Korth and Sudarshan
End of Chapter

Copyright: Silberschatz, Korth and Sudarshan

43
Weak Levels Consistency
Use alternative notions of consistency that do not ensure
serializability, to improve performance.
Degree-two consistency avoids cascading aborts without
necessarily ensuring serializability.
 Unlike two-phase locking, S-locks may be released at any time, and
licks may be acquired at any time.
 X-locks be released until the transaction either commits or aborts.

44
Database System Concepts

24.44

©Silberschatz, Korth and Sudarshan
Example Schedule with Degree-Two
Consistency
Nonserializable schedule with degree-two consistency (Figure 20.5)
where T3 reads the value if Q before and after that value is written by
T4.
T3
lock-S (Q)
read (Q)
unlock (Q)

lock-S (Q)
read (Q)
unlock (Q)

T4

lock-X
read
write
unlock

(Q)
(Q)
(Q)
(Q)

45
Database System Concepts

24.45

©Silberschatz, Korth and Sudarshan
Cursor Stability
Form of degree-two consistency designed for programs
written in general-purpose, record-oriented languages (e.g.,
Pascal, C, Cobol, PL/I, Fortran).
Rather than locking the entire relation, cursor stability
ensures that
 The tuple that is currently being processed by the iteration is
locked in shared mode.
 Any modified tuples are locked in exclusive mode until the
transaction commits.

Used on heavily accessed relations as a means of
increasing concurrency and improving system
performance.
Use is limited to specialized situations with simple
consistency constraints.

46
Database System Concepts

24.46

©Silberschatz, Korth and Sudarshan

More Related Content

What's hot

Distributed process and scheduling
Distributed process and scheduling Distributed process and scheduling
Distributed process and scheduling SHATHAN
 
balancing performance,accuracy and precision for secure cloud transactions
balancing performance,accuracy and precision for secure cloud transactionsbalancing performance,accuracy and precision for secure cloud transactions
balancing performance,accuracy and precision for secure cloud transactionsLakshmi Prasad
 
Balancing performance accuracy and precision for secure cloud transactions
Balancing performance accuracy and precision for secure cloud transactionsBalancing performance accuracy and precision for secure cloud transactions
Balancing performance accuracy and precision for secure cloud transactionsPapitha Velumani
 
334839757 task-assignment
334839757 task-assignment334839757 task-assignment
334839757 task-assignmentsachinmore76
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 
Process Migration in Heterogeneous Systems
Process Migration in Heterogeneous SystemsProcess Migration in Heterogeneous Systems
Process Migration in Heterogeneous Systemsijsrd.com
 
Transaction management
Transaction managementTransaction management
Transaction managementArchanaMani2
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed ComputingRicha Singh
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
resource management
  resource management  resource management
resource managementAshish Kumar
 
Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.Debasis Das
 
A New Security Model For Distributed System
A New Security Model For Distributed SystemA New Security Model For Distributed System
A New Security Model For Distributed SystemSanoj Kumar
 

What's hot (20)

Dbms voc 5 unit
Dbms voc 5 unitDbms voc 5 unit
Dbms voc 5 unit
 
Distributed process and scheduling
Distributed process and scheduling Distributed process and scheduling
Distributed process and scheduling
 
HA Summary
HA SummaryHA Summary
HA Summary
 
balancing performance,accuracy and precision for secure cloud transactions
balancing performance,accuracy and precision for secure cloud transactionsbalancing performance,accuracy and precision for secure cloud transactions
balancing performance,accuracy and precision for secure cloud transactions
 
Balancing performance accuracy and precision for secure cloud transactions
Balancing performance accuracy and precision for secure cloud transactionsBalancing performance accuracy and precision for secure cloud transactions
Balancing performance accuracy and precision for secure cloud transactions
 
Ch15
Ch15Ch15
Ch15
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
334839757 task-assignment
334839757 task-assignment334839757 task-assignment
334839757 task-assignment
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
Process Migration in Heterogeneous Systems
Process Migration in Heterogeneous SystemsProcess Migration in Heterogeneous Systems
Process Migration in Heterogeneous Systems
 
Transaction management
Transaction managementTransaction management
Transaction management
 
Process Management-Process Migration
Process Management-Process MigrationProcess Management-Process Migration
Process Management-Process Migration
 
Load Balancing In Distributed Computing
Load Balancing In Distributed ComputingLoad Balancing In Distributed Computing
Load Balancing In Distributed Computing
 
Task migration in os
Task migration in osTask migration in os
Task migration in os
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Distributed Operating System_2
Distributed Operating System_2Distributed Operating System_2
Distributed Operating System_2
 
resource management
  resource management  resource management
resource management
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
 
Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.Cs704 d distributedschedulingetc.
Cs704 d distributedschedulingetc.
 
A New Security Model For Distributed System
A New Security Model For Distributed SystemA New Security Model For Distributed System
A New Security Model For Distributed System
 

Viewers also liked (19)

Ch9 mass storage systems
Ch9   mass storage systemsCh9   mass storage systems
Ch9 mass storage systems
 
E3 chap-15
E3 chap-15E3 chap-15
E3 chap-15
 
Ch7 deadlocks
Ch7   deadlocksCh7   deadlocks
Ch7 deadlocks
 
E3 chap-10
E3 chap-10E3 chap-10
E3 chap-10
 
Sergey Brin
Sergey BrinSergey Brin
Sergey Brin
 
Ch2 operating-system structures
Ch2   operating-system structuresCh2   operating-system structures
Ch2 operating-system structures
 
E3 chap-17
E3 chap-17E3 chap-17
E3 chap-17
 
Peubah acak-diskret-khusus
Peubah acak-diskret-khususPeubah acak-diskret-khusus
Peubah acak-diskret-khusus
 
Hci [4]interaction
Hci [4]interactionHci [4]interaction
Hci [4]interaction
 
Ch11
Ch11Ch11
Ch11
 
E3 chap-03-extra-wimp
E3 chap-03-extra-wimpE3 chap-03-extra-wimp
E3 chap-03-extra-wimp
 
Ch14
Ch14Ch14
Ch14
 
Building an online learning environment
Building an online learning environmentBuilding an online learning environment
Building an online learning environment
 
Impact of ISO 9001 implementation in BSL
Impact of ISO 9001 implementation in BSLImpact of ISO 9001 implementation in BSL
Impact of ISO 9001 implementation in BSL
 
Ch4
Ch4Ch4
Ch4
 
John wiley & sons operating system concepts, seventh edition
John wiley & sons   operating system concepts, seventh editionJohn wiley & sons   operating system concepts, seventh edition
John wiley & sons operating system concepts, seventh edition
 
Cal learn sw171
Cal learn sw171Cal learn sw171
Cal learn sw171
 
GMR Hyderabad International Airport
GMR Hyderabad International AirportGMR Hyderabad International Airport
GMR Hyderabad International Airport
 
e-Business
e-Businesse-Business
e-Business
 

Similar to Ch24

24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMSkoolkampus
 
Database architecture
Database architectureDatabase architecture
Database architecture1Arun_Pandey
 
Sayed database system_architecture
Sayed database system_architectureSayed database system_architecture
Sayed database system_architectureSayed Ahmed
 
Sayed database system_architecture
Sayed database system_architectureSayed database system_architecture
Sayed database system_architectureSayed Ahmed
 
Dcn Networking Between Server And Client Machine
Dcn Networking Between Server And Client MachineDcn Networking Between Server And Client Machine
Dcn Networking Between Server And Client MachineRohan Bhatkar
 
VNSISPL_DBMS_Concepts_ch25
VNSISPL_DBMS_Concepts_ch25VNSISPL_DBMS_Concepts_ch25
VNSISPL_DBMS_Concepts_ch25sriprasoon
 
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...DrCViji
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed ComputingAbhishek Jaisingh
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsRick Hightower
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overviewcornelia davis
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processingJafar Nesargi
 
Chapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingChapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingJafar Nesargi
 

Similar to Ch24 (20)

24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS24. Advanced Transaction Processing in DBMS
24. Advanced Transaction Processing in DBMS
 
Database architecture
Database architectureDatabase architecture
Database architecture
 
Sayed database system_architecture
Sayed database system_architectureSayed database system_architecture
Sayed database system_architecture
 
Sayed database system_architecture
Sayed database system_architectureSayed database system_architecture
Sayed database system_architecture
 
Ch18
Ch18Ch18
Ch18
 
Ch20
Ch20Ch20
Ch20
 
Csc concepts
Csc conceptsCsc concepts
Csc concepts
 
Ch17
Ch17Ch17
Ch17
 
Ch20
Ch20Ch20
Ch20
 
Dcn Networking Between Server And Client Machine
Dcn Networking Between Server And Client MachineDcn Networking Between Server And Client Machine
Dcn Networking Between Server And Client Machine
 
VNSISPL_DBMS_Concepts_ch25
VNSISPL_DBMS_Concepts_ch25VNSISPL_DBMS_Concepts_ch25
VNSISPL_DBMS_Concepts_ch25
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
dokumen.tips_silberschatz-korth-and-sudarshan1-transactions-transaction-conce...
 
Client Server Model and Distributed Computing
Client Server Model and Distributed ComputingClient Server Model and Distributed Computing
Client Server Model and Distributed Computing
 
Transaction Processing monitor
Transaction Processing monitorTransaction Processing monitor
Transaction Processing monitor
 
High-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulationsHigh-Speed Reactive Microservices - trials and tribulations
High-Speed Reactive Microservices - trials and tribulations
 
Client server computing
Client server computingClient server computing
Client server computing
 
Cloud Foundry Technical Overview
Cloud Foundry Technical OverviewCloud Foundry Technical Overview
Cloud Foundry Technical Overview
 
Introduction to transaction processing
Introduction to transaction processingIntroduction to transaction processing
Introduction to transaction processing
 
Chapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processingChapter 9 introduction to transaction processing
Chapter 9 introduction to transaction processing
 

Recently uploaded

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptxPoojaSen20
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
PSYCHIATRIC History collection FORMAT.pptx
PSYCHIATRIC   History collection FORMAT.pptxPSYCHIATRIC   History collection FORMAT.pptx
PSYCHIATRIC History collection FORMAT.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

Ch24

  • 1. Chapter 24: Advanced Transaction Processing Transaction-Processing Monitors Transactional Workflows High-Performance Transaction Systems  Main memory databases  Real-Time Transaction Systems Long-Duration Transactions Transaction management in multidatabase systems 1 Database System Concepts 24.1 ©Silberschatz, Korth and Sudarshan
  • 2. Transaction Processing Monitors TP monitors initially developed as multithreaded servers to support large numbers of terminals from a single process. Provide infrastructure for building and administering complex transaction processing systems with a large number of clients and multiple servers. Provide services such as:  Presentation facilities to simplify creating user interfaces  Persistent queuing of client requests and server responses  Routing of client messages to servers  Coordination of two-phase commit when transactions access multiple servers. Some commercial TP monitors: CICS from IBM, Pathway from Tandem, Top End from NCR, and Encina from Transarc 2 Database System Concepts 24.2 ©Silberschatz, Korth and Sudarshan
  • 3. TP Monitor Architectures 3 Database System Concepts 24.3 ©Silberschatz, Korth and Sudarshan
  • 4. TP Monitor Architectures (Cont.) Process per client model - instead of individual login session per terminal, server process communicates with the terminal, handles authentication, and executes actions.  Memory requirements are high  Multitasking- high CPU overhead for context switching between processes Single process model - all remote terminals connect to a single server process.  Used in client-server environments  Server process is multi-threaded; low cost for thread switching  No protection between applications  Not suited for parallel or distributed databases 4 Database System Concepts 24.4 ©Silberschatz, Korth and Sudarshan
  • 5. TP Monitor Architectures (Cont.) Many-server single-router model - multiple application server processes access a common database; clients communicate with the application through a single communication process that routes requests.  Independent server processes for multiple applications  Multithread server process  Run on parallel or distributed database Many server many-router model - multiple processes communicate with clients.  Client communication processes interact with router processes that route their requests to the appropriate server.  Controller process starts up and supervises other processes. 5 Database System Concepts 24.5 ©Silberschatz, Korth and Sudarshan
  • 6. Detailed Structure of a TP Monitor 6 Database System Concepts 24.6 ©Silberschatz, Korth and Sudarshan
  • 7. Detailed Structure of a TP Monitor Queue manager handles incoming messages Some queue managers provide persistent or durable message queueing contents of queue are safe even if systems fails. Durable queueing of outgoing messages is important  application server writes message to durable queue as part of a transaction  once the transaction commits, the TP monitor guarantees message is eventually delevered, regardless of crashes.  ACID properties are thus provided even for messages sent outside the database Many TP monitors provide locking, logging and recovery services, to enable application servers to implement ACID properties by themselves. 7 Database System Concepts 24.7 ©Silberschatz, Korth and Sudarshan
  • 8. Application Coordination Using TP Monitors A TP monitor treats each subsystem as a resource manager that provides transactional access to some set of resources. The interface between the TP monitor and the resource manager is defined by a set of transaction primitives The resource manager interface is defined by the X/Open Distributed Transaction Processing standard. TP monitor systems provide a transactional remote procedure call (transactional RPC) interface to their service  Transactional RPC provides calls to enclose a series of RPC calls within a transaction.  Updates performed by an RPC are carried out within the scope of the transaction, and can be rolled back if there is any failure. 8 Database System Concepts 24.8 ©Silberschatz, Korth and Sudarshan
  • 10. Transactional Workflows Workflows are activities that involve the coordinated execution of multiple tasks performed by different processing entities. With the growth of networks, and the existence of multiple autonomous database systems, workflows provide a convenient way of carrying out tasks that involve multiple systems. Example of a workflow delivery of an email message, which goes through several mails systems to reach destination.  Each mailer performs a tasks: forwarding of the mail to the next mailer.  If a mailer cannot deliver mail, failure must be handled semantically (delivery failure message). Workflows usually involve humans: e.g. loan processing, or purchase order processing. 10 Database System Concepts 24.10 ©Silberschatz, Korth and Sudarshan
  • 11. Examples of Workflows 11 Database System Concepts 24.11 ©Silberschatz, Korth and Sudarshan
  • 12. Loan Processing Workflow In the past, workflows were handled by creating and forwarding paper forms Computerized workflows aim to automate many of the tasks. But the humans still play role e.g. in approving loans. 12 Database System Concepts 24.12 ©Silberschatz, Korth and Sudarshan
  • 13. Transactional Workflows Must address following issues to computerize a workflow.  Specification of workflows - detailing the tasks that must be carried out and defining the execution requirements.  Execution of workflows - execute transactions specified in the workflow while also providing traditional database safeguards related to the correctness of computations, data integrity, and durability.  E.g.: Loan application should not get lost even if system fails. Extend transaction concepts to the context of workflows. State of a workflow - consists of the collection of states of its constituent tasks, and the states (i.e. values) of all variables in the execution plan. 13 Database System Concepts 24.13 ©Silberschatz, Korth and Sudarshan
  • 14. Workflow Specification Static specification of task coordination:  Tasks and dependencies among them are defined before the execution of the workflow starts.  Can establish preconditions for execution of each task: tasks are executed only when their preconditions are satisfied.  Defined preconditions through dependencies:  Execution states of other tasks. “task ti cannot start until task tj has ended”  Output values of other tasks. “task ti can start if task tj returns a value greater than 25”  External variables, that are modified by external events. “task ti must be started within 24 hours of the completion of task tj” 14 Database System Concepts 24.14 ©Silberschatz, Korth and Sudarshan
  • 15. Workflow Specification (Cont.) Dynamic task coordination E.g. Electronic mail routing system in which the text to be schedule for a given mail message depends on the destination address and on which intermediate routers are functioning. 15 Database System Concepts 24.15 ©Silberschatz, Korth and Sudarshan
  • 16. Failure-Automicity Requirements Usual ACID transactional requirements are too strong/unimplementable for workflow applications. However, workflows must satisfy some limited transactional properties that guarantee a process is not left in an inconsistent state. Acceptable termination states - every execution of a workflow will terminate in a state that satisfies the failureatomicity requirements defined by the designer.  Committed - objectives of a workflow have been achieved.  Aborted - valid termination state in which a workflow has failed to achieve its objectives. A workflow must reach an acceptable termination state even in the presence of system failures. 16 Database System Concepts 24.16 ©Silberschatz, Korth and Sudarshan
  • 17. Execution of Workflows Workflow management systems include: Scheduler - program that process workflows by submitting various tasks for execution, monitoring various events, and evaluation conditions related to intertask dependencies Task agents - control the execution of a task by a processing entity. Mechanism to query to state of the workflow system. 17 Database System Concepts 24.17 ©Silberschatz, Korth and Sudarshan
  • 18. Workflow Management System Architectures Centralized - a single scheduler schedules the tasks for all concurrently executing workflows.  used in workflow systems where the data is stored in a central database.  easier to keep track of the state of a workflow. Partially distributed - has one (instance of a ) scheduler for each workflow. Fully distributed - has no scheduler, but the task agents coordinate their execution by communicating with each other to satisfy task dependencies and other workflow execution requirements.  used in simplest workflow execution systems  based on electronic mail 18 Database System Concepts 24.18 ©Silberschatz, Korth and Sudarshan
  • 19. Workflow Scheduler Ideally scheduler should execute a workflow only after ensuring that it will terminate in an acceptable state. Consider a workflow consisting of two tasks S1 and S2. Let the failure-atomicity requirement be that either both or neither of the subtransactions should be committed.  Suppose systems executing S1 and S2 do not provide prepared-tocommit states and S1 or S2 do not have compensating transactions.  It is then possible to reach a state where one subtransaction is committed and the other aborted. Both cannot then be brought to the same state.  Workflow specification is unsafe, and should be rejected. Determination of safety by the scheduler is not possible in general, and is usually left to the designer of the workflow. 19 Database System Concepts 24.19 ©Silberschatz, Korth and Sudarshan
  • 20. Recovery of a Workflow Ensure that is a failure occurs in any of the workflowprocessing components, the workflow eventually reaches an acceptable termination state. Failure-recovery routines need to restore the state information of the scheduler at the time of failure, including the information about the execution states of each task. Log status information on stable storage. Handoff of tasks between agents should occur exactly once in spite of failure. Problem: Repeating handoff on recovery may lead to duplicate execution of task; not repeating handoff may lead to task not being executed.  Solution: Persistent messaging systems 20 Database System Concepts 24.20 ©Silberschatz, Korth and Sudarshan
  • 21. Recovery of a Workflow (Cont.) Persistent messages: messages are stored in permanent message queue and therefore not lost in case of failure.  Described in detail in Chapter 19 (Distributed Databases) Before an agent commits, it writes to the persistent message queue whatever messages need to be sent out. The persistent message system must make sure the messages get delivered eventually if and only if the transaction commits. The message system needs to resend a message when the site recovers, if the message is not known to have reached its destination. Messages must be logged in stable storage at the receiving end to detect multiple receipts of a message. 21 Database System Concepts 24.21 ©Silberschatz, Korth and Sudarshan
  • 22. High Performance Transaction Systems Copyright: Silberschatz, Korth and Sudarshan 22
  • 23. High-Performance Transaction Systems High-performance hardware and parallelism help improve the rate of transaction processing, but are insufficient to obtain high performance:  Disk I/O is a bottleneck — I/O time (10 milliseconds) has no decreased at a rate comparable to the increase in processor speeds.  Parallel transactions may attempt to read or write the same data item, resulting in data conflicts that reduce effective parallelism We can reduce the degree to which a database system is disk bound by increasing the size of the database buffer. 23 Database System Concepts 24.23 ©Silberschatz, Korth and Sudarshan
  • 24. Main-Memory Database Commercial 64-bit systems can support main memories of tens of gigabytes. Memory resident data allows faster processing of transactions. Disk-related limitations:  Logging is a bottleneck when transaction rate is high.  Use group-commit to reduce number of output operations (Will study two slides ahead.)  If the update rate for modified buffer blocks is high, the disk data-transfer rate could become a bottleneck.  If the system crashes, all of main memory is lost. 24 Database System Concepts 24.24 ©Silberschatz, Korth and Sudarshan
  • 25. Main-Memory Database Optimizations To reduce space overheads, main-memory databases can use structures with pointers crossing multiple pages. In disk databases, the I/O cost to traverse multiple pages would be excessively high. No need to pin buffer pages in memory before data are accessed, since buffer pages will never be replaced. Design query-processing techniques to minimize space overhead - avoid exceeding main memory limits during query evaluation. Improve implementation of operations such as locking and latching, so they do not become bottlenecks. Optimize recovery algorithms, since pages rarely need to be written out to make space for other pages. 25 Database System Concepts 24.25 ©Silberschatz, Korth and Sudarshan
  • 26. Group Commit Idea: Instead of performing output of log records to stable storage as soon as a transaction is ready to commit, wait until  log buffer block is full, or  a transaction has been waiting sufficiently long after being ready to commit Results in fewer output operations per committed transaction, and correspondingly a higher throughput. However, commits are delayed until a sufficiently large group of transactions are ready to commit, or a transaction has been waiting long enough-leads to slightly increased response time. Above delay acceptable in high-performance transaction systems since log buffer blocks will fill up quickly. 26 Database System Concepts 24.26 ©Silberschatz, Korth and Sudarshan
  • 27. Real-Time Transaction Systems In systems with real-time constraints, correctness of execution involves both database consistency and the satisfaction of deadlines.  Hard deadline – Serious problems may occur if task is not completed within deadline  Firm deadline - The task has zero value if it completed after the deadline.  Soft deadline - The task has diminishing value if it is completed after the deadline. The wide variance of execution times for read and write operations on disks complicates the transaction management problem for timeconstrained systems  main-memory databases are thus often used  Waits for locks, transaction aborts, contention for resources remain as problems even if data is in main memory Design of a real-time system involves ensuring that enough processing power exists to meet deadline without requiring excessive hardware resources. 27 Database System Concepts 24.27 ©Silberschatz, Korth and Sudarshan
  • 28. 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. 28 Database System Concepts 24.28 ©Silberschatz, Korth and Sudarshan
  • 29. Long-Duration Transactions 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. 29 Database System Concepts 24.29 ©Silberschatz, Korth and Sudarshan
  • 30. Concurrency Control Correctness without serializability:  Correctness depends on the specific consistency constraints for the databases.  Correctness depends on the properties of operations performed by each transaction. Use database consistency constraints as to split the database into subdatabases on which concurrency can be managed separately. Treat some operations besides read and write as fundamental low-level operations and extend concurrency control to deal with them. 30 Database System Concepts 24.30 ©Silberschatz, Korth and Sudarshan
  • 31. Concurrency Control (Cont.) A non-conflict-serializable schedule that preserves the sum of A + B 31 Database System Concepts 24.31 ©Silberschatz, Korth and Sudarshan
  • 32. Nested and Multilevel Transactions A nested or multilevel transaction T is represented by a set T = {t1, t2, ..., tn} of subtransactions and a partial order P on T. A subtransaction ti in T may abort without forcing T to abort. Instead, T may either restart ti, or simply choose not to run ti. If ti commits, this action does not make ti, permanent (unlike the situation in Chapter 15). Instead, ti, commits to T, and may still abort (or require compensation) if T aborts. An execution of T must not violate the partial order P, i.e., if an edge ti → ti appears in the precedence graph, then ti → ti must not be in the transitive closure of P. 32 Database System Concepts 24.32 ©Silberschatz, Korth and Sudarshan
  • 33. Nested and Multilevel Transactions (Cont.) Subtransactions can themselves be nested/multilevel transactions.  Lowest level of nesting: standard read and write operations. Nesting can create higher-level operations that may enhance concurrency. Types of nested/ multilevel transactions:  Multilevel transaction: subtransaction of T is permitted to release locks on completion.  Saga: multilevel long-duration transaction.  Nested transaction: locks held by a subtransaction ti of T are automatically assign to T on completion of ti. 33 Database System Concepts 24.33 ©Silberschatz, Korth and Sudarshan
  • 34. Example of Nesting Rewrite transaction T1 using subtransactions Ta and Tb that perform increment or decrement operations:  T1 consists of  T1,1, which subtracts 50 from A  T1,2, which adds 50 to B Rewrite transaction T2 using subtransactions Tc and Td that perform increment or decrement operations:  T2 consists of  T2,1, which subtracts 10 from B  T2,2, which adds 10 to A No ordering is specified on subtransactions; any execution generates a correct result. 34 Database System Concepts 24.34 ©Silberschatz, Korth and Sudarshan
  • 35. Compensating Transactions Alternative to undo operation; compensating transactions deal with the problem of cascading rollbacks. Instead of undoing all changes made by the failed transaction, action is taken to “compensate” for the failure. Consider a long-duration transaction Ti representing a travel reservation, with subtransactions Ti,1, which makes airline reservations, Ti,2 which reserves rental cars, and Ti,3 which reserves a hotel room.  Hotel cancels the reservation.  Instead of undoing all of Ti, the failure of Ti,3 is compensated for by deleting the old hotel reservation and making a new one.  Requires use of semantics of the failed transaction. 35 Database System Concepts 24.35 ©Silberschatz, Korth and Sudarshan
  • 36. Implementation Issues For long-duration transactions to survive system crashes, we must log not only changes to the database, but also changes to internal system data pertaining to these transactions. Logging of updates is made more complex by physically large data items (CAD design, document text); undesirable to store both old and new values. Two approaches to reducing the overhead of ensuring the recoverability of large data items:  Operation logging. Only the operation performed on the data item and the data-item name are stored in the log.  Logging and shadow paging. Use logging from small data items; use shadow paging for large data items. Only modified pages need to be stored in duplicate. 36 Database System Concepts 24.36 ©Silberschatz, Korth and Sudarshan
  • 37. Transaction Management in Multidatabase Systems Transaction management is complicated in multidatabase systems because of the assumption of autonomy  Global 2PL -each local site uses a strict 2PL (locks are released at the end); locks set as a result of a global transaction are released only when that transaction reaches the end.  Guarantees global serializability  Due to autonomy requirements, sites cannot cooperate and execute a common concurrency control scheme  E.g. no way to ensure that all databases follow strict 2PL Solutions:  provide very low level of concurrent execution, or  use weaker levels of consistency 37 Database System Concepts 24.37 ©Silberschatz, Korth and Sudarshan
  • 38. Transaction Management Local transactions are executed by each local DBMS, outside of the MDBS system control. Global transactions are executed under multidatabase control. Local autonomy - local DBMSs cannot communicate directly to synchronize global transaction execution and the multidatabase has no control over local transaction execution.  local concurrency control scheme needed to ensure that DBMS’s schedule is serializable  in case of locking, DBMS must be able to guard against local deadlocks.  need additional mechanisms to ensure global serializability 38 Database System Concepts 24.38 ©Silberschatz, Korth and Sudarshan
  • 39. Two-Level Serializability DBMS ensures local serializability among its local transactions, including those that are part of a global transaction. The multidatabase ensures serializability among global transactions alone- ignoring the orderings induced by local transactions. 2LSR does not ensure global serializability, however, it can fulfill requirements for strong correctness. 1. Preserve consistency as specified by a given set of constraints 2. Guarantee that the set of data items read by each transaction is consistent Global-read protocol : Global transactions can read, but not update, local data items; local transactions do not have access to global data. There are no consistency constraints between local and global data items. 39 Database System Concepts 24.39 ©Silberschatz, Korth and Sudarshan
  • 40. Two-Level Serializability (Cont.) Local-read protocol : Local transactions have read access to global data; disallows all access to local data by global transactions. A transaction has a value dependency if the value that it writes to a data item at one site depends on a value that it read for a data item on another site. For strong correctness: No transaction may have a value dependency. Global-read-write/local-read protocol; Local transactions have read access to global data; global transactions may read and write all data; No consistency constraints between local and global data items. No transaction may have value dependency. 40 Database System Concepts 24.40 ©Silberschatz, Korth and Sudarshan
  • 41. Global Serializability Even if no information is available concerning the structure of the various concurrency control schemes, a very restrictive protocol that ensures serializability is available. Transaction-graph : a graph with vertices being global transaction names and site names. An undirected edge (Ti, Sk) exists if Ti is active at site Sk. Global serializability is assured if transaction-graph contains no undirected cycles. 41 Database System Concepts 24.41 ©Silberschatz, Korth and Sudarshan
  • 42. Ensuring Global Serializability Each site Si has a special data item, called ticket Every transaction Tj that runs at site Sk writes to the ticket at site Si Ensures global transactions are serialized at each site, regardless of local concurrency control method, so long as the method guarantees local serializability Global transaction manager decides serial ordering of global transactions by controlling order in which tickets are accessed However, above protocol results in low concurrency between global transactions. 42 Database System Concepts 24.42 ©Silberschatz, Korth and Sudarshan
  • 43. End of Chapter Copyright: Silberschatz, Korth and Sudarshan 43
  • 44. Weak Levels Consistency Use alternative notions of consistency that do not ensure serializability, to improve performance. Degree-two consistency avoids cascading aborts without necessarily ensuring serializability.  Unlike two-phase locking, S-locks may be released at any time, and licks may be acquired at any time.  X-locks be released until the transaction either commits or aborts. 44 Database System Concepts 24.44 ©Silberschatz, Korth and Sudarshan
  • 45. Example Schedule with Degree-Two Consistency Nonserializable schedule with degree-two consistency (Figure 20.5) where T3 reads the value if Q before and after that value is written by T4. T3 lock-S (Q) read (Q) unlock (Q) lock-S (Q) read (Q) unlock (Q) T4 lock-X read write unlock (Q) (Q) (Q) (Q) 45 Database System Concepts 24.45 ©Silberschatz, Korth and Sudarshan
  • 46. Cursor Stability Form of degree-two consistency designed for programs written in general-purpose, record-oriented languages (e.g., Pascal, C, Cobol, PL/I, Fortran). Rather than locking the entire relation, cursor stability ensures that  The tuple that is currently being processed by the iteration is locked in shared mode.  Any modified tuples are locked in exclusive mode until the transaction commits. Used on heavily accessed relations as a means of increasing concurrency and improving system performance. Use is limited to specialized situations with simple consistency constraints. 46 Database System Concepts 24.46 ©Silberschatz, Korth and Sudarshan