SlideShare a Scribd company logo
Unit – 8
Distributed Transaction Management
&
Concurrency Control
Outlines..
• Transaction concept
• ACID property
• Objectives of Distributed Concurrency Control
• Concurrency Control anomalies
• Methods of concurrency control
• Serializability and recoverability
• Multiple granularity
• Multi version schemes
1/11/2017 2Prof. Dhaval R. Chandarana
Transaction concept
• A transaction is considered to be made up of a sequence of
read and write operation on the database, together with
computation.
1/11/2017 3Prof. Dhaval R. Chandarana
Example of Transactions
• Updating a record
• Locate the record on disk
• Bring record into buffer
• Update data in the buffer
• Writing data back to disk
1/11/2017 4Prof. Dhaval R. Chandarana
Syntax of Transaction
• Consider the following SQL query for increasing by 10% the budget
of the CAD/CAM project.
 UPDATE PROJ
SET BUDGET = BUDGET*1.1
WHERE PNAME= "CAD/CAM“
 Begin transaction BUDGET UPDATE
begin
EXEC SQL UPDATE PROJ
SET BUDGET = BUDGET*1.1
WHERE PNAME= “CAD/CAM”
end.
1/11/2017 5Prof. Dhaval R. Chandarana
Directed acyclic graph (DAC)
1/11/2017 6Prof. Dhaval R. Chandarana
Properties of Transactions
• The consistency and reliability aspects of transactions are due
to four properties
1. Atomicity
2. Consistency
3. Isolation
4. Durability
• Together, these are commonly referred to as the ACID
properties of transactions.
1/11/2017 7Prof. Dhaval R. Chandarana
Atomicity
• Atomicity refers to the fact that a transaction
is treated as a unit of operation. Therefore,
either all the transaction’s actions are
completed, or none of them are. This is also
known as the “all-or-nothing property.”
1/11/2017 8Prof. Dhaval R. Chandarana
Consistency
• The consistency of a transaction is simply its
correctness.
• In other words, a transaction is a correct
program that maps one consistent database
state to another.
1/11/2017 9Prof. Dhaval R. Chandarana
Isolation
• Isolation is the property of transactions that
requires each transaction to see a consistent
database at all times.
• In other words, an executing transaction
cannot reveal its results to other concurrent
transactions before its commitment.
1/11/2017 10Prof. Dhaval R. Chandarana
Durability
• Durability refers to that property of
transactions which ensures that once a
transaction commits, its results are
permanent and cannot be erased from the
database.
1/11/2017 11Prof. Dhaval R. Chandarana
Objectives of transaction management
• CPU and main memory utilization
• Control message and their response time
• Availability
1/11/2017 12Prof. Dhaval R. Chandarana
Types of transactions
• Transactions have been classified according to a number of
criteria. One criterion is the duration of transactions.
Accordingly, transactions may be classified as online or batch.
• These two classes are also called short-life and long-life
transactions, respectively.
1/11/2017 13Prof. Dhaval R. Chandarana
Online Transaction
• Online transactions are characterized by very short
execution/response times (typically, on the order of a
couple of seconds) and by access to a relatively small
portion of the database.
• This class of transactions probably covers a large
majority of current transaction applications.
Examples include banking transactions and airline
reservation transactions.
1/11/2017 14Prof. Dhaval R. Chandarana
Batch Transactions
• Batch transactions, on the other hand, take longer to
execute (response time being measured in minutes,
hours, or even days) and access a larger portion of the
database.
• Typical applications that might require batch
transactions are design databases, statistical
applications, report generation, complex queries, and
image processing.
1/11/2017 15Prof. Dhaval R. Chandarana
Various Transaction Models
1/11/2017 16Prof. Dhaval R. Chandarana
Conti..
• Another classification that has been proposed is with respect to the
organization of the read and write actions.
1. Read and write actions without any specific ordering. We call this
type of transactions general.
2. If the transactions are restricted so that all the read actions are
performed before any write action, the transaction is called a two-
step transaction.
3. if the transaction is restricted so that a data item has to be read
before it can be updated (written), the corresponding class is
called restricted (or read-before-write)
4. If a transaction is both two-step and restricted, it is called a
restricted two-step transaction.
5. action model of transactions, which consists of the restricted class
with the further restriction that each <read>,<write> pair be
executed atomically.
1/11/2017 17Prof. Dhaval R. Chandarana
Flat Transactions
• Flat transactions have a single start point (Begin
transaction) and a single termination point (End
transaction).
1/11/2017 18Prof. Dhaval R. Chandarana
Nested Transactions
• An alternative transaction model is to permit a transaction
to include other transactions with their own begin and
commit points. Such transactions are called nested
transactions.
Begin transaction Reservation
begin
Begin transaction Airline
: : :
end. {Airline}
Begin transaction Hotel
: : :
end. {Hotel}
end.
1/11/2017 19Prof. Dhaval R. Chandarana
Workflows
• A working definition is that a workflow is “a collection of
tasks organized to accomplish some business process.”
1. Human-oriented workflows, which involve humans in
performing the tasks. The system support is provided to
facilitate collaboration and coordination among humans, but
it is the humans themselves who are ultimately responsible
for the consistency of the actions.
2. System-oriented workflows are those that consist of
computation-intensive and specialized tasks that can be
executed by a computer. The system support in this case is
substantial and involves concurrency control and recovery,
automatic task execution, notification, etc.
1/11/2017 20Prof. Dhaval R. Chandarana
Workflows
3. Transactional workflows range in between human-oriented
and system oriented workflows and borrow characteristics
from both. They involve “coordinated execution of multiple
tasks that (a) may involve humans, (b) require access to HAD
[heterogeneous, autonomous, and/or distributed] systems,
and (c) support selective use of transactional properties [i.e.,
ACID properties] for individual tasks or entire workflows.”
1/11/2017 21Prof. Dhaval R. Chandarana
Example Workflow
1/11/2017 22Prof. Dhaval R. Chandarana
Objectives of Distributed Concurrency Control
• In distributed database system, database is typically used by
many users. These system usually allow multiple transaction to
run concurrently at the same time.
• It must support parallel execution of transaction.
• Communication delay is less.
• It must be recovery from site and communication failure.
1/11/2017 23Prof. Dhaval R. Chandarana
Concurrency Control anomalies
• Lack of Concurrency Control can create data integrity and
consistency problem:
1. Lost updates
2. Uncommitted data
3. Inconsistent retrievals
1/11/2017 24Prof. Dhaval R. Chandarana
Methods of concurrency control
1/11/2017 25Prof. Dhaval R. Chandarana
Locking-Based Concurrency Control
• The main idea of locking-based concurrency control is to
ensure that a data item that is shared by conflicting
operations is accessed by one operation at a time.
• This lock is set by a transaction before it is accessed and
is reset at the end of its use.
• There are two types of locks read lock (rl) and write lock
(wl)
1/11/2017 26Prof. Dhaval R. Chandarana
Locking-Based Concurrency Control Algorithms
1/11/2017 27Prof. Dhaval R. Chandarana
2PL Lock Graph
1/11/2017 28Prof. Dhaval R. Chandarana
Timestamp-Based Concurrency Control Algorithms
• To establish this ordering, the transaction manager assigns each
transaction Ti a unique timestamp, ts(Ti), at its initiation.
• A timestamp is a simple identifier that serves to identify each
transaction uniquely and is used for ordering.
• Uniqueness is only one of the properties of timestamp generation.
• The second property is monotonicity.
• There are a number of ways that timestamps can be assigned. One
method is to use a global (system-wide) monotonically increasing
counter.
• However, the maintenance of global counters is a problem in
distributed systems. Therefore, it is preferable that each site
autonomously assigns timestamps based on its local counter.
{local counter value, site identifier}
1/11/2017 29Prof. Dhaval R. Chandarana
Basic timestamp ordering Rule
• A transaction’s request to write an object is
valid only if that object was last read and
written by earlier transaction.
• A transaction’s request to read an object is
valid only if that object was last written by
earlier transaction.
1/11/2017 30Prof. Dhaval R. Chandarana
Optimistic Concurrency Control Algorithms
• the conflicts between transactions are quite frequent and do not
permit a transaction to access a data item if there is a
conflicting transaction that accesses that data item.
• Thus the execution of any operation of a transaction follows
the sequence of phases: validation (V), read (R),computation
(C), write (W)
1/11/2017 31Prof. Dhaval R. Chandarana
Optimistic Concurrency Control Algorithms
• Optimistic algorithms, on the other hand, delay the validation
phase until just before the write phase.
• The read, compute, and write operations of each transaction
are processed freely without updating the actual database.
• Each transaction initially makes its updates on local copies of
data items. The validation phase consists of checking if these
updates would maintain the consistency of the database. If
the answer is affirmative, the changes are made global
otherwise, the transaction is aborted and has to restart.
1/11/2017 32Prof. Dhaval R. Chandarana
Serializability
• Transaction are considered serialisable if the
effect of running them in an interleaved
fashion is equivalent to running them serially
in some order.
1/11/2017 33Prof. Dhaval R. Chandarana
1/11/2017 Prof. Dhaval R. Chandarana 34
Diagram
All schedules
View Serializable
Conflict
Serializable
Read (A, t)
t = t - 100
Write (A, t)
Read (B, t)
t = t + 100
Write (B, t)
Read (A, s)
s = s - 100
Write (A, s)
Read (C, s)
s = s + 100
Write (C, s)
A B C
300 600600
500 500500
400 500600
300 + 600 + 600 = 1500
Serial Schedule
T1
T2
1/11/2017 35Prof. Dhaval R. Chandarana
Read (A, t)
t = t - 100
Write (A, t)
Read (B, t)
t = t + 100
Write (B, t)
Read (A, s)
s = s - 100
Write (A, s)
Read (C, s)
s = s + 100
Write (C, s)
A B C
300 600600
500 500500
400 600500
300 + 600 + 600 = 1500
Serial Schedule
T2
T1
1/11/2017 36Prof. Dhaval R. Chandarana
37
Serial Schedule
SnS0 S1 S2
T1 T2 Tn
Consistent States
1/11/2017 Prof. Dhaval R. Chandarana
Conflict Serializability
T2: Read (A) T2: Write (A)
T1: Read (A) OK Read/Write Conflict
T1: Write (A) Write/Read Conflict Write/Write Conflict
1. Read/Write Conflict: conflict because value read depend
on whether write has occurred.
2. Write/Write Conflict: conflict because value left in db
depend on which write occurred last.
3. Read/Read: no conflict.
1/11/2017 38Prof. Dhaval R. Chandarana
Recoverability
• If transaction fails, users undo the transaction effect
because of atomicity property. The durability
property states that once a transaction commits, its
change cannot be undone.
• In recoverable schedule, no transaction
need to be roll back.
Recoverable
Serializable
Conflict
Serializable
1/11/2017 39Prof. Dhaval R. Chandarana
Multiple granularity
• Granularity is the size of data item allowed to lock.
• Multiple Granularity is the hierarchically breaking
up the database into portions which are lockable and
maintaining the track of what to be lock and how
much to be lock so that it can be decided very
quickly either to lock a data item or to unlock a data
item.
1/11/2017 40Prof. Dhaval R. Chandarana
Example of Multiple Granularity
• Suppose a database is divided into files; files are
divided into pages; pages are divided into records.
1/11/2017 41Prof. Dhaval R. Chandarana
Example of Multiple Granularity
• if there is a need to lock a record, then a
transaction can easily lock it. But if there is a need to
lock a file, the transaction have to lock firstly all the
records one after another, then pages in that file and
finally the file. So, there is a need to provide a
mechanism for locking the files also which is
provided by multiple granularity.
1/11/2017 42Prof. Dhaval R. Chandarana
For a low-level request
1/11/2017 43Prof. Dhaval R. Chandarana
For a high-level request
1/11/2017 44Prof. Dhaval R. Chandarana
Multi version schemes
• Multiversion schemes keep old version of data
item to increase concurrency. Each successful
write result in the creation of a new version of
the data item written.
• When a read (Q) operation is issued, select an
appropriate version of Q base on the
timestamp of the transaction and return the
value of the selected version.
1/11/2017 45Prof. Dhaval R. Chandarana
Multi version timestamp ordering
• Each data item Q has sequence of versions <
Q1,Q2,….,Qm>. Each version Qk contain three
data fields:
a. Content: the value of version Qk.
b. W-timestamp (Qk): timestamp of the
transaction that created (wrote) version Qk.
c. R-timestamp (Qk): largest timestamp of the
transaction that successfully read version Qk.
1/11/2017 46Prof. Dhaval R. Chandarana
Ad

More Related Content

What's hot (20)

Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
Meghaj Mallick
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
Nilu Desai
 
Distributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data ControlDistributed DBMS - Unit 5 - Semantic Data Control
Distributed DBMS - Unit 5 - Semantic Data Control
Gyanmanjari Institute Of Technology
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
Binte fatima
 
Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternatives
Pooja Dixit
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
AAKANKSHA JAIN
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
Ravinder Kamboj
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
Ali Usman
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
Ali Usman
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
Pooja Dixit
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
Ashish KC
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
koolkampus
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
Megha Patel
 
Deadlock management
Deadlock managementDeadlock management
Deadlock management
Ahmed kasim
 
Validation based protocol
Validation based protocolValidation based protocol
Validation based protocol
BBDITM LUCKNOW
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
Sunita Sahu
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency control
Javed Khan
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
ChethanMp7
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Soumyajit Dutta
 
Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
Meghaj Mallick
 
management of distributed transactions
management of distributed transactionsmanagement of distributed transactions
management of distributed transactions
Nilu Desai
 
Distributed concurrency control
Distributed concurrency controlDistributed concurrency control
Distributed concurrency control
Binte fatima
 
Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternatives
Pooja Dixit
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
AAKANKSHA JAIN
 
Query processing and optimization (updated)
Query processing and optimization (updated)Query processing and optimization (updated)
Query processing and optimization (updated)
Ravinder Kamboj
 
Database , 8 Query Optimization
Database , 8 Query OptimizationDatabase , 8 Query Optimization
Database , 8 Query Optimization
Ali Usman
 
Memory Management in OS
Memory Management in OSMemory Management in OS
Memory Management in OS
Kumar Pritam
 
Database , 12 Reliability
Database , 12 ReliabilityDatabase , 12 Reliability
Database , 12 Reliability
Ali Usman
 
Distributed dbms architectures
Distributed dbms architecturesDistributed dbms architectures
Distributed dbms architectures
Pooja Dixit
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
Ashish KC
 
15. Transactions in DBMS
15. Transactions in DBMS15. Transactions in DBMS
15. Transactions in DBMS
koolkampus
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
Megha Patel
 
Deadlock management
Deadlock managementDeadlock management
Deadlock management
Ahmed kasim
 
Validation based protocol
Validation based protocolValidation based protocol
Validation based protocol
BBDITM LUCKNOW
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
Sunita Sahu
 
Concurrency control
Concurrency  controlConcurrency  control
Concurrency control
Javed Khan
 
Lock based protocols
Lock based protocolsLock based protocols
Lock based protocols
ChethanMp7
 

Viewers also liked (12)

Distributed Transaction
Distributed TransactionDistributed Transaction
Distributed Transaction
Pratik Tambekar
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Virender Kumar
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
koolkampus
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency Control
Damian T. Gordon
 
12 ipt 0501 transaction processing systems 01
12 ipt 0501   transaction processing systems 0112 ipt 0501   transaction processing systems 01
12 ipt 0501 transaction processing systems 01
ctedds
 
Distributed DBMS - Unit 9 - Distributed Deadlock & Recovery
Distributed DBMS - Unit 9 - Distributed Deadlock & RecoveryDistributed DBMS - Unit 9 - Distributed Deadlock & Recovery
Distributed DBMS - Unit 9 - Distributed Deadlock & Recovery
Gyanmanjari Institute Of Technology
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency control
Anand Grewal
 
Transaction Processing System
Transaction Processing SystemTransaction Processing System
Transaction Processing System
Mohammed Kashifulla
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
Ravimuthurajan
 
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
Beat Signer
 
Transaction processing system
Transaction processing systemTransaction processing system
Transaction processing system
uday sharma
 
Transaction processing systems
Transaction processing systems Transaction processing systems
Transaction processing systems
greg robertson
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
koolkampus
 
Databases: Concurrency Control
Databases: Concurrency ControlDatabases: Concurrency Control
Databases: Concurrency Control
Damian T. Gordon
 
12 ipt 0501 transaction processing systems 01
12 ipt 0501   transaction processing systems 0112 ipt 0501   transaction processing systems 01
12 ipt 0501 transaction processing systems 01
ctedds
 
Transaction concurrency control
Transaction concurrency controlTransaction concurrency control
Transaction concurrency control
Anand Grewal
 
Transaction & Concurrency Control
Transaction & Concurrency ControlTransaction & Concurrency Control
Transaction & Concurrency Control
Ravimuthurajan
 
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
Transaction Management - Lecture 11 - Introduction to Databases (1007156ANR)
Beat Signer
 
Transaction processing system
Transaction processing systemTransaction processing system
Transaction processing system
uday sharma
 
Transaction processing systems
Transaction processing systems Transaction processing systems
Transaction processing systems
greg robertson
 
Ad

Similar to Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency Control (20)

Guide to Application Performance: Planning to Continued Optimization
Guide to Application Performance: Planning to Continued OptimizationGuide to Application Performance: Planning to Continued Optimization
Guide to Application Performance: Planning to Continued Optimization
MuleSoft
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive Microservices
Rick Hightower
 
Move fast and make things with microservices
Move fast and make things with microservicesMove fast and make things with microservices
Move fast and make things with microservices
Mithun Arunan
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
Rick Hightower
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on Transaction
Rahul Prajapati
 
Transaction conccurency
Transaction conccurencyTransaction conccurency
Transaction conccurency
Esraa Farrag
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
ScyllaDB
 
Server system architecture
Server system architectureServer system architecture
Server system architecture
Faiza Hafeez
 
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick ParkerDevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
R3
 
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
DataWorks Summit
 
deadlock prevention
deadlock preventiondeadlock prevention
deadlock prevention
Nilu Desai
 
Software Architecture for Cloud Infrastructure
Software Architecture for Cloud InfrastructureSoftware Architecture for Cloud Infrastructure
Software Architecture for Cloud Infrastructure
Tapio Rautonen
 
5 application serversforproject
5 application serversforproject5 application serversforproject
5 application serversforproject
ashish61_scs
 
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
BI Brainz
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
Subhasish Pati
 
Data Streaming For Big Data
Data Streaming For Big DataData Streaming For Big Data
Data Streaming For Big Data
Seval Çapraz
 
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docxDBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
randyburney60861
 
adap-stability-202310.pptx
adap-stability-202310.pptxadap-stability-202310.pptx
adap-stability-202310.pptx
Michael Ming Lei
 
WF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systemsWF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systems
Oleh Zheleznyak
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application Design
GlobalLogic Ukraine
 
Guide to Application Performance: Planning to Continued Optimization
Guide to Application Performance: Planning to Continued OptimizationGuide to Application Performance: Planning to Continued Optimization
Guide to Application Performance: Planning to Continued Optimization
MuleSoft
 
High-Speed Reactive Microservices
High-Speed Reactive MicroservicesHigh-Speed Reactive Microservices
High-Speed Reactive Microservices
Rick Hightower
 
Move fast and make things with microservices
Move fast and make things with microservicesMove fast and make things with microservices
Move fast and make things with microservices
Mithun Arunan
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
Rick Hightower
 
Presentation on Transaction
Presentation on TransactionPresentation on Transaction
Presentation on Transaction
Rahul Prajapati
 
Transaction conccurency
Transaction conccurencyTransaction conccurency
Transaction conccurency
Esraa Farrag
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
ScyllaDB
 
Server system architecture
Server system architectureServer system architecture
Server system architecture
Faiza Hafeez
 
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick ParkerDevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
DevDay: Corda Enterprise: Journey to 1000 TPS per node, Rick Parker
R3
 
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...Manage the Digital Transformation with Machine Learning in a Reactive Microse...
Manage the Digital Transformation with Machine Learning in a Reactive Microse...
DataWorks Summit
 
deadlock prevention
deadlock preventiondeadlock prevention
deadlock prevention
Nilu Desai
 
Software Architecture for Cloud Infrastructure
Software Architecture for Cloud InfrastructureSoftware Architecture for Cloud Infrastructure
Software Architecture for Cloud Infrastructure
Tapio Rautonen
 
5 application serversforproject
5 application serversforproject5 application serversforproject
5 application serversforproject
ashish61_scs
 
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
Analysing and Troubleshooting Performance Issues in SAP BusinessObjects BI Re...
BI Brainz
 
Data Streaming For Big Data
Data Streaming For Big DataData Streaming For Big Data
Data Streaming For Big Data
Seval Çapraz
 
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docxDBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
DBF-Lecture11-Chapter12.pptDatabase Principles Fundam.docx
randyburney60861
 
adap-stability-202310.pptx
adap-stability-202310.pptxadap-stability-202310.pptx
adap-stability-202310.pptx
Michael Ming Lei
 
WF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systemsWF_in_retail_banking_enterprise_systems
WF_in_retail_banking_enterprise_systems
Oleh Zheleznyak
 
Patterns of Distributed Application Design
Patterns of Distributed Application DesignPatterns of Distributed Application Design
Patterns of Distributed Application Design
GlobalLogic Ukraine
 
Ad

More from Gyanmanjari Institute Of Technology (20)

Unit - 5 - Advance Web Designing (AJAX & jQuery)
Unit - 5 - Advance Web Designing (AJAX & jQuery)Unit - 5 - Advance Web Designing (AJAX & jQuery)
Unit - 5 - Advance Web Designing (AJAX & jQuery)
Gyanmanjari Institute Of Technology
 
Unit - 4 - Bootstrap (HTML, CSS, and JavaScript Framework)
Unit - 4 - Bootstrap (HTML, CSS, and JavaScript Framework)Unit - 4 - Bootstrap (HTML, CSS, and JavaScript Framework)
Unit - 4 - Bootstrap (HTML, CSS, and JavaScript Framework)
Gyanmanjari Institute Of Technology
 
Unit -3 - JavaScript (Client Side Scripting Language)
Unit -3 - JavaScript (Client Side Scripting Language)Unit -3 - JavaScript (Client Side Scripting Language)
Unit -3 - JavaScript (Client Side Scripting Language)
Gyanmanjari Institute Of Technology
 
Unit - 2 - Hypertext Markup Language & Cascading Style Sheets
Unit - 2 - Hypertext Markup Language & Cascading Style SheetsUnit - 2 - Hypertext Markup Language & Cascading Style Sheets
Unit - 2 - Hypertext Markup Language & Cascading Style Sheets
Gyanmanjari Institute Of Technology
 
Unit - 1 - Introduction to Web Design
Unit - 1 - Introduction to Web DesignUnit - 1 - Introduction to Web Design
Unit - 1 - Introduction to Web Design
Gyanmanjari Institute Of Technology
 
WD - Unit - 7 - Advanced Concepts
WD - Unit - 7 - Advanced ConceptsWD - Unit - 7 - Advanced Concepts
WD - Unit - 7 - Advanced Concepts
Gyanmanjari Institute Of Technology
 
WD - Unit - 4 - PHP Basics
WD - Unit - 4 - PHP BasicsWD - Unit - 4 - PHP Basics
WD - Unit - 4 - PHP Basics
Gyanmanjari Institute Of Technology
 
WD - Unit - 3 - Java Script
WD - Unit - 3 - Java ScriptWD - Unit - 3 - Java Script
WD - Unit - 3 - Java Script
Gyanmanjari Institute Of Technology
 
WD - Unit - 6 - Database Connectivity using PHP
WD - Unit - 6 - Database Connectivity using PHPWD - Unit - 6 - Database Connectivity using PHP
WD - Unit - 6 - Database Connectivity using PHP
Gyanmanjari Institute Of Technology
 
WD - Unit - 5 - Session and State Management using PHP
WD - Unit - 5 - Session and State Management using PHPWD - Unit - 5 - Session and State Management using PHP
WD - Unit - 5 - Session and State Management using PHP
Gyanmanjari Institute Of Technology
 
WD - Unit - 2 - HTML & CSS
WD - Unit - 2 - HTML & CSSWD - Unit - 2 - HTML & CSS
WD - Unit - 2 - HTML & CSS
Gyanmanjari Institute Of Technology
 
WD - Unit - 1 - Introduction
WD - Unit - 1 - IntroductionWD - Unit - 1 - Introduction
WD - Unit - 1 - Introduction
Gyanmanjari Institute Of Technology
 
OSV - Unit - 8 - Unix/Linux Operating System
OSV - Unit - 8 - Unix/Linux Operating SystemOSV - Unit - 8 - Unix/Linux Operating System
OSV - Unit - 8 - Unix/Linux Operating System
Gyanmanjari Institute Of Technology
 
OSV - Unit - 10 - Approaches to Virtualization
OSV - Unit - 10 - Approaches to VirtualizationOSV - Unit - 10 - Approaches to Virtualization
OSV - Unit - 10 - Approaches to Virtualization
Gyanmanjari Institute Of Technology
 
OSV - Unit - 9 - Virtualization Concepts
OSV - Unit - 9 - Virtualization ConceptsOSV - Unit - 9 - Virtualization Concepts
OSV - Unit - 9 - Virtualization Concepts
Gyanmanjari Institute Of Technology
 
OSV - Unit - 7 - I/O Management & Disk scheduling
OSV - Unit - 7 - I/O Management & Disk schedulingOSV - Unit - 7 - I/O Management & Disk scheduling
OSV - Unit - 7 - I/O Management & Disk scheduling
Gyanmanjari Institute Of Technology
 
OSV - Unit - 6 - Memory Management
OSV - Unit - 6 - Memory ManagementOSV - Unit - 6 - Memory Management
OSV - Unit - 6 - Memory Management
Gyanmanjari Institute Of Technology
 
CNS - Unit - 10 - Web Security Threats and Approaches
CNS - Unit - 10 - Web Security Threats and ApproachesCNS - Unit - 10 - Web Security Threats and Approaches
CNS - Unit - 10 - Web Security Threats and Approaches
Gyanmanjari Institute Of Technology
 
OSV - Unit - 5 - Deadlock
OSV - Unit - 5 - DeadlockOSV - Unit - 5 - Deadlock
OSV - Unit - 5 - Deadlock
Gyanmanjari Institute Of Technology
 
OSV - Unit - 4 - Inter Process Communication
OSV - Unit - 4 - Inter Process CommunicationOSV - Unit - 4 - Inter Process Communication
OSV - Unit - 4 - Inter Process Communication
Gyanmanjari Institute Of Technology
 

Recently uploaded (20)

Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
How to Make Material Space Qu___ (1).pptx
How to Make Material Space Qu___ (1).pptxHow to Make Material Space Qu___ (1).pptx
How to Make Material Space Qu___ (1).pptx
engaash9
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
comparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.pptcomparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.ppt
yadavmrr7
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
Engineering Chemistry First Year Fullerenes
Engineering Chemistry First Year FullerenesEngineering Chemistry First Year Fullerenes
Engineering Chemistry First Year Fullerenes
5g2jpd9sp4
 
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
MiguelMarques372250
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
Mathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdfMathematical foundation machine learning.pdf
Mathematical foundation machine learning.pdf
TalhaShahid49
 
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdfMAQUINARIA MINAS CEMA 6th Edition (1).pdf
MAQUINARIA MINAS CEMA 6th Edition (1).pdf
ssuser562df4
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 
Level 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical SafetyLevel 1-Safety.pptx Presentation of Electrical Safety
Level 1-Safety.pptx Presentation of Electrical Safety
JoseAlbertoCariasDel
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design ThinkingDT REPORT by Tech titan GROUP to introduce the subject design Thinking
DT REPORT by Tech titan GROUP to introduce the subject design Thinking
DhruvChotaliya2
 
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
211421893-M-Tech-CIVIL-Structural-Engineering-pdf.pdf
inmishra17121973
 
How to Make Material Space Qu___ (1).pptx
How to Make Material Space Qu___ (1).pptxHow to Make Material Space Qu___ (1).pptx
How to Make Material Space Qu___ (1).pptx
engaash9
 
Unit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatioUnit III.pptx IT3401 web essentials presentatio
Unit III.pptx IT3401 web essentials presentatio
lakshitakumar291
 
comparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.pptcomparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.ppt
yadavmrr7
 
Basic Principles for Electronics Students
Basic Principles for Electronics StudentsBasic Principles for Electronics Students
Basic Principles for Electronics Students
cbdbizdev04
 
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
RESORT MANAGEMENT AND RESERVATION SYSTEM PROJECT REPORT.
Kamal Acharya
 
Engineering Chemistry First Year Fullerenes
Engineering Chemistry First Year FullerenesEngineering Chemistry First Year Fullerenes
Engineering Chemistry First Year Fullerenes
5g2jpd9sp4
 
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...Taking AI Welfare Seriously, In this report, we argue that there is a realist...
Taking AI Welfare Seriously, In this report, we argue that there is a realist...
MiguelMarques372250
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 

Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency Control

  • 1. Unit – 8 Distributed Transaction Management & Concurrency Control
  • 2. Outlines.. • Transaction concept • ACID property • Objectives of Distributed Concurrency Control • Concurrency Control anomalies • Methods of concurrency control • Serializability and recoverability • Multiple granularity • Multi version schemes 1/11/2017 2Prof. Dhaval R. Chandarana
  • 3. Transaction concept • A transaction is considered to be made up of a sequence of read and write operation on the database, together with computation. 1/11/2017 3Prof. Dhaval R. Chandarana
  • 4. Example of Transactions • Updating a record • Locate the record on disk • Bring record into buffer • Update data in the buffer • Writing data back to disk 1/11/2017 4Prof. Dhaval R. Chandarana
  • 5. Syntax of Transaction • Consider the following SQL query for increasing by 10% the budget of the CAD/CAM project.  UPDATE PROJ SET BUDGET = BUDGET*1.1 WHERE PNAME= "CAD/CAM“  Begin transaction BUDGET UPDATE begin EXEC SQL UPDATE PROJ SET BUDGET = BUDGET*1.1 WHERE PNAME= “CAD/CAM” end. 1/11/2017 5Prof. Dhaval R. Chandarana
  • 6. Directed acyclic graph (DAC) 1/11/2017 6Prof. Dhaval R. Chandarana
  • 7. Properties of Transactions • The consistency and reliability aspects of transactions are due to four properties 1. Atomicity 2. Consistency 3. Isolation 4. Durability • Together, these are commonly referred to as the ACID properties of transactions. 1/11/2017 7Prof. Dhaval R. Chandarana
  • 8. Atomicity • Atomicity refers to the fact that a transaction is treated as a unit of operation. Therefore, either all the transaction’s actions are completed, or none of them are. This is also known as the “all-or-nothing property.” 1/11/2017 8Prof. Dhaval R. Chandarana
  • 9. Consistency • The consistency of a transaction is simply its correctness. • In other words, a transaction is a correct program that maps one consistent database state to another. 1/11/2017 9Prof. Dhaval R. Chandarana
  • 10. Isolation • Isolation is the property of transactions that requires each transaction to see a consistent database at all times. • In other words, an executing transaction cannot reveal its results to other concurrent transactions before its commitment. 1/11/2017 10Prof. Dhaval R. Chandarana
  • 11. Durability • Durability refers to that property of transactions which ensures that once a transaction commits, its results are permanent and cannot be erased from the database. 1/11/2017 11Prof. Dhaval R. Chandarana
  • 12. Objectives of transaction management • CPU and main memory utilization • Control message and their response time • Availability 1/11/2017 12Prof. Dhaval R. Chandarana
  • 13. Types of transactions • Transactions have been classified according to a number of criteria. One criterion is the duration of transactions. Accordingly, transactions may be classified as online or batch. • These two classes are also called short-life and long-life transactions, respectively. 1/11/2017 13Prof. Dhaval R. Chandarana
  • 14. Online Transaction • Online transactions are characterized by very short execution/response times (typically, on the order of a couple of seconds) and by access to a relatively small portion of the database. • This class of transactions probably covers a large majority of current transaction applications. Examples include banking transactions and airline reservation transactions. 1/11/2017 14Prof. Dhaval R. Chandarana
  • 15. Batch Transactions • Batch transactions, on the other hand, take longer to execute (response time being measured in minutes, hours, or even days) and access a larger portion of the database. • Typical applications that might require batch transactions are design databases, statistical applications, report generation, complex queries, and image processing. 1/11/2017 15Prof. Dhaval R. Chandarana
  • 16. Various Transaction Models 1/11/2017 16Prof. Dhaval R. Chandarana
  • 17. Conti.. • Another classification that has been proposed is with respect to the organization of the read and write actions. 1. Read and write actions without any specific ordering. We call this type of transactions general. 2. If the transactions are restricted so that all the read actions are performed before any write action, the transaction is called a two- step transaction. 3. if the transaction is restricted so that a data item has to be read before it can be updated (written), the corresponding class is called restricted (or read-before-write) 4. If a transaction is both two-step and restricted, it is called a restricted two-step transaction. 5. action model of transactions, which consists of the restricted class with the further restriction that each <read>,<write> pair be executed atomically. 1/11/2017 17Prof. Dhaval R. Chandarana
  • 18. Flat Transactions • Flat transactions have a single start point (Begin transaction) and a single termination point (End transaction). 1/11/2017 18Prof. Dhaval R. Chandarana
  • 19. Nested Transactions • An alternative transaction model is to permit a transaction to include other transactions with their own begin and commit points. Such transactions are called nested transactions. Begin transaction Reservation begin Begin transaction Airline : : : end. {Airline} Begin transaction Hotel : : : end. {Hotel} end. 1/11/2017 19Prof. Dhaval R. Chandarana
  • 20. Workflows • A working definition is that a workflow is “a collection of tasks organized to accomplish some business process.” 1. Human-oriented workflows, which involve humans in performing the tasks. The system support is provided to facilitate collaboration and coordination among humans, but it is the humans themselves who are ultimately responsible for the consistency of the actions. 2. System-oriented workflows are those that consist of computation-intensive and specialized tasks that can be executed by a computer. The system support in this case is substantial and involves concurrency control and recovery, automatic task execution, notification, etc. 1/11/2017 20Prof. Dhaval R. Chandarana
  • 21. Workflows 3. Transactional workflows range in between human-oriented and system oriented workflows and borrow characteristics from both. They involve “coordinated execution of multiple tasks that (a) may involve humans, (b) require access to HAD [heterogeneous, autonomous, and/or distributed] systems, and (c) support selective use of transactional properties [i.e., ACID properties] for individual tasks or entire workflows.” 1/11/2017 21Prof. Dhaval R. Chandarana
  • 22. Example Workflow 1/11/2017 22Prof. Dhaval R. Chandarana
  • 23. Objectives of Distributed Concurrency Control • In distributed database system, database is typically used by many users. These system usually allow multiple transaction to run concurrently at the same time. • It must support parallel execution of transaction. • Communication delay is less. • It must be recovery from site and communication failure. 1/11/2017 23Prof. Dhaval R. Chandarana
  • 24. Concurrency Control anomalies • Lack of Concurrency Control can create data integrity and consistency problem: 1. Lost updates 2. Uncommitted data 3. Inconsistent retrievals 1/11/2017 24Prof. Dhaval R. Chandarana
  • 25. Methods of concurrency control 1/11/2017 25Prof. Dhaval R. Chandarana
  • 26. Locking-Based Concurrency Control • The main idea of locking-based concurrency control is to ensure that a data item that is shared by conflicting operations is accessed by one operation at a time. • This lock is set by a transaction before it is accessed and is reset at the end of its use. • There are two types of locks read lock (rl) and write lock (wl) 1/11/2017 26Prof. Dhaval R. Chandarana
  • 27. Locking-Based Concurrency Control Algorithms 1/11/2017 27Prof. Dhaval R. Chandarana
  • 28. 2PL Lock Graph 1/11/2017 28Prof. Dhaval R. Chandarana
  • 29. Timestamp-Based Concurrency Control Algorithms • To establish this ordering, the transaction manager assigns each transaction Ti a unique timestamp, ts(Ti), at its initiation. • A timestamp is a simple identifier that serves to identify each transaction uniquely and is used for ordering. • Uniqueness is only one of the properties of timestamp generation. • The second property is monotonicity. • There are a number of ways that timestamps can be assigned. One method is to use a global (system-wide) monotonically increasing counter. • However, the maintenance of global counters is a problem in distributed systems. Therefore, it is preferable that each site autonomously assigns timestamps based on its local counter. {local counter value, site identifier} 1/11/2017 29Prof. Dhaval R. Chandarana
  • 30. Basic timestamp ordering Rule • A transaction’s request to write an object is valid only if that object was last read and written by earlier transaction. • A transaction’s request to read an object is valid only if that object was last written by earlier transaction. 1/11/2017 30Prof. Dhaval R. Chandarana
  • 31. Optimistic Concurrency Control Algorithms • the conflicts between transactions are quite frequent and do not permit a transaction to access a data item if there is a conflicting transaction that accesses that data item. • Thus the execution of any operation of a transaction follows the sequence of phases: validation (V), read (R),computation (C), write (W) 1/11/2017 31Prof. Dhaval R. Chandarana
  • 32. Optimistic Concurrency Control Algorithms • Optimistic algorithms, on the other hand, delay the validation phase until just before the write phase. • The read, compute, and write operations of each transaction are processed freely without updating the actual database. • Each transaction initially makes its updates on local copies of data items. The validation phase consists of checking if these updates would maintain the consistency of the database. If the answer is affirmative, the changes are made global otherwise, the transaction is aborted and has to restart. 1/11/2017 32Prof. Dhaval R. Chandarana
  • 33. Serializability • Transaction are considered serialisable if the effect of running them in an interleaved fashion is equivalent to running them serially in some order. 1/11/2017 33Prof. Dhaval R. Chandarana
  • 34. 1/11/2017 Prof. Dhaval R. Chandarana 34 Diagram All schedules View Serializable Conflict Serializable
  • 35. Read (A, t) t = t - 100 Write (A, t) Read (B, t) t = t + 100 Write (B, t) Read (A, s) s = s - 100 Write (A, s) Read (C, s) s = s + 100 Write (C, s) A B C 300 600600 500 500500 400 500600 300 + 600 + 600 = 1500 Serial Schedule T1 T2 1/11/2017 35Prof. Dhaval R. Chandarana
  • 36. Read (A, t) t = t - 100 Write (A, t) Read (B, t) t = t + 100 Write (B, t) Read (A, s) s = s - 100 Write (A, s) Read (C, s) s = s + 100 Write (C, s) A B C 300 600600 500 500500 400 600500 300 + 600 + 600 = 1500 Serial Schedule T2 T1 1/11/2017 36Prof. Dhaval R. Chandarana
  • 37. 37 Serial Schedule SnS0 S1 S2 T1 T2 Tn Consistent States 1/11/2017 Prof. Dhaval R. Chandarana
  • 38. Conflict Serializability T2: Read (A) T2: Write (A) T1: Read (A) OK Read/Write Conflict T1: Write (A) Write/Read Conflict Write/Write Conflict 1. Read/Write Conflict: conflict because value read depend on whether write has occurred. 2. Write/Write Conflict: conflict because value left in db depend on which write occurred last. 3. Read/Read: no conflict. 1/11/2017 38Prof. Dhaval R. Chandarana
  • 39. Recoverability • If transaction fails, users undo the transaction effect because of atomicity property. The durability property states that once a transaction commits, its change cannot be undone. • In recoverable schedule, no transaction need to be roll back. Recoverable Serializable Conflict Serializable 1/11/2017 39Prof. Dhaval R. Chandarana
  • 40. Multiple granularity • Granularity is the size of data item allowed to lock. • Multiple Granularity is the hierarchically breaking up the database into portions which are lockable and maintaining the track of what to be lock and how much to be lock so that it can be decided very quickly either to lock a data item or to unlock a data item. 1/11/2017 40Prof. Dhaval R. Chandarana
  • 41. Example of Multiple Granularity • Suppose a database is divided into files; files are divided into pages; pages are divided into records. 1/11/2017 41Prof. Dhaval R. Chandarana
  • 42. Example of Multiple Granularity • if there is a need to lock a record, then a transaction can easily lock it. But if there is a need to lock a file, the transaction have to lock firstly all the records one after another, then pages in that file and finally the file. So, there is a need to provide a mechanism for locking the files also which is provided by multiple granularity. 1/11/2017 42Prof. Dhaval R. Chandarana
  • 43. For a low-level request 1/11/2017 43Prof. Dhaval R. Chandarana
  • 44. For a high-level request 1/11/2017 44Prof. Dhaval R. Chandarana
  • 45. Multi version schemes • Multiversion schemes keep old version of data item to increase concurrency. Each successful write result in the creation of a new version of the data item written. • When a read (Q) operation is issued, select an appropriate version of Q base on the timestamp of the transaction and return the value of the selected version. 1/11/2017 45Prof. Dhaval R. Chandarana
  • 46. Multi version timestamp ordering • Each data item Q has sequence of versions < Q1,Q2,….,Qm>. Each version Qk contain three data fields: a. Content: the value of version Qk. b. W-timestamp (Qk): timestamp of the transaction that created (wrote) version Qk. c. R-timestamp (Qk): largest timestamp of the transaction that successfully read version Qk. 1/11/2017 46Prof. Dhaval R. Chandarana