SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
Management of
distributed transactions
Nileshwari Desai
A 216
Outline
• Introduction
• Framework
• Supporting atomicity
• Concurrency control
• Summarization
Introduction
 The management of distributed transactions
require dealing with several problems which
are strictly interconnected, like-
a. Reliability
b. Concurrency control
c. Efficient utilization of the resources of the
whole system.
Framework for transaction
management
1. Properties of transactions
2. Goals of transaction management
3. Distributed transactions
1. Properties of transactions
• Atomicity
• Durability
• Serializability
• Isolation
2. Goals of transaction management
• CPU and main memory utilization
• Control messages
• Response time
• Availability
Lets summarize!
• The goal of transaction management in a
distributed database is to control the execution
of transactions so that:
1. Transactions have atomicity, durability,
serializability and isolation properties.
2. Their cost in terms of main memory, CPU and
number of transmitted control messages and
their response time are minimized.
3. The availability of the system is maximized.
3. Distributed transactions
• Agent: An agent is a local process which
performs some actions on behalf of an
application.
An updating transaction
Updating a master tape is fault tolerant: If a run fails for any reason, all the tape
could be rewound and the job restarted with no harm done.
Basic Transaction Primitives
Primitive Description
BEGIN_TRANSACTION Make the start of a transaction
END_TRANSACTION
Terminate the transaction and try to
commit
ABORT_TRANSACTION
Kill the transaction and restore the old
values
READ Read data from a file, a table
WRITE Write data to a file, a table
Transaction execution
Nested versus distributed transaction
Flat and nested transactions
T
S
1
T22
T21
T12
T11
T2
T1
T
S
3
S
2
S
2
S
6
S
5
S
4
S
1
S
3
(a) Distributed flat (b) Distributed nested
S
7
S
0
A circle (Si) denotes a
server, and a
square (Tj)
represents a
sub-
transaction.
 Flat transaction send out requests to different servers and each request is
completed before client goes to the next one.
 Nested transaction allows sub-transactions at the same level to execute
concurrently.
Supporting atomicity of distributed
transactions
• Recovery in centralized databases
• Communication failures in distributed
databases.
• Recovery of distributed transactions.
• The 2-Phase-commitment protocol
1-phase atomic commit protocol
• A transaction comes to an end when the client requests
that a transaction be committed or aborted.
• Simple way is: coordinator to communicate the commit
or abort request to all of the participants in the
transaction and to keep on repeating the request until all
of them have acknowledged that they had carried it out.
• Inadequate because when the client requests a commit, it
does not allow a server to make a unilateral decision to
abort a transaction. E.g. deadlock avoidance may force a
transaction to abort at a server when locking is used. So
any server may fail or abort and client is not aware.
2-phase commit protocol
• Allow any participant to abort its part of a
transaction. Due to atomicity, the whole transaction
must also be aborted.
• In the first phase, each participant votes for the
transaction to be committed or aborted. Once voted
to commit, not allowed to abort it. So before votes to
commit, it must ensure that it will eventually be able
to carry out its part, even if it fails and is replaced.
• A participant is said to be in a prepared state if it
will eventually be able to commit it. So each
participant needs to save the altered objects in the
permanent storage device together with its status-
prepared.
2-phase commit protocol
• In the second phase, every participant in the
transaction carries out the joint decision. If any one
participant votes to abort, the decision must be to
abort. If all the participants vote to commit, then the
decision is to commit the transaction.
• The problem is to ensure that all of the participants
vote and that they all reach the same decision. It is
an example of consensus. It is simple if no error
occurs. However, it should work when servers fail,
message lost or servers are temporarily unable to
communicate with one another.
2-phase commit protocol
• If the client requests abort, or if the transaction is
aborted by one of the participants, the coordinator
informs the participants immediately.
• It is when the client asks the coordinator to commit
the transaction that two-phase commit protocol
comes into use.
• In the first phase, the coordinator asks all the
participants if they are prepared to commit; and in
the second, it tells them to commit or abort the
transaction.
Operations for 2-phase commit
protocol
• canCommit?(trans)-> Yes / No
▫ Call from coordinator to participant to ask whether it can commit a transaction.
Participant replies with its vote.
• doCommit(trans)
▫ Call from coordinator to participant to tell participant to commit its part of a
transaction.
• doAbort(trans)
▫ Call from coordinator to participant to tell participant to abort its part of a
transaction.
• haveCommitted(trans, participant)
▫ Call from participant to coordinator to confirm that it has committed the
transaction.
• getDecision(trans) -> Yes / No
▫ Call from participant to coordinator to ask for the decision on a transaction after it
has voted Yes but has still had no reply after some delay. Used to recover from
server crash or delayed messages.
Communication in 2-phase commit
protocol
canCommit?
Yes
doCommit
haveCommitted
Coordinator
1
3
(waiting for votes)
committed
done
prepared to commit
step
Participant
2
4
(uncertain)
prepared to commit
committed
statusstepstatus
Concurrency control for distributed
transactions
• Concurrency control based on locking in
centralized databases.
• Concurrency control based on locking in
distributed databases.
Concurrency control in distributed
transactions
• Concurrency control for distributed
transactions: each server applies local
concurrency control to its own objects, which
ensure transactions serializability locally.
• However, the members of a collection of servers
of distributed transactions are jointly
responsible for ensuring that they are performed
in a serially equivalent manner. Thus global
serializability is required.
locks
• Lock manager at each server decide whether to
grant a lock or make the requesting transaction wait.
• However, it cannot release any locks until it knows
that the transaction has been committed or aborted
at all the servers involved in the transaction.
• A lock managers in different servers set their locks
independently of one another. It is possible that
different servers may impose different orderings on
transactions.
Timestamp ordering concurrency
control
• In a single server transaction, the coordinator issues
a unique timestamp to each transaction when it
starts. Serial equivalence is enforced by committing
the versions of objects in the order of the
timestamps of transactions that accessed them.
• In distributed transactions, we require that each
coordinator issue globally unique time stamps. The
coordinators must agree as to the ordering of their
timestamps. <local timestamp, server-id>, the
agreed ordering of pairs of timestamps is based on a
comparison in which the server-id is less significant.
• The timestamp is passed to each server whose
objects perform an operation in the transaction.
Timestamp ordering concurrency
control
• To achieve the same ordering at all the servers, The
servers of distributed transactions are jointly
responsible for ensuring that they are performed in
a serially equivalent manner. E.g. If T commits after
U at server X, T must commits after U at server Y.
• Conflicts are resolved as each operation is
performed. If the resolution of a conflict requires a
transaction to be aborted, the coordinator will be
informed and it will abort the transaction at all the
participants.
locking
T U
Write(A) at X locks A
Write(B) at Y locks B
Read(B) at Y waits for U
Read(A) at X waits for T
****************************************************
**************
T before U in one server X and U before T in server Y.
These different ordering can lead to cyclic
dependencies between transactions and a distributed
deadlock situation arises.
Distributed deadlock
• Deadlocks can arise within a single server when
locking is used for concurrency control. Servers
must either prevent or detect and resolve
deadlocks.
• Using timeout to resolve deadlock is a clumsy
approach. Why? Another way is to detect
deadlock by detecting cycles in a wait for graph.
Distributed transaction managers must ensure that all transactions have the
atomicity, durability, seriability and isolation properties. In most systems, this is
obtained by implementing on top of existing local transaction managers the 2-phase-
commitment protocol for reliability,2-phase-locking for concurrency control, and
timeouts for deadlock detection.
The 2-phase-commitment protocol ensures that the subtransactions of the same
transaction will either all commit or all abort, in spite of the possible failures. 2-phase-
commitment is resilient to any failure in which no log information is lost. The 2-
phase-locking mechanism requires that all subtransactions acquire locks in the
growing phase and release locks in the shrinking phase. Timeout mechanisms for
deadlock detection simply abort those transactions which are in wait, possibly for a
deadlock.
Several computation and communication structures are possible for distributed
transaction managers. The computation can use processes permanently assigned to
transactions, or servers dynamically bound to them. Processes can have a centralized
structure, in which one agent activates all other agents, or a hierarchical structure, in
which each agent can in turn activate other agents. The communication can use
sessions or datagrams. The communication structure of the commitment protocol can
be centralized, hierarchical, linear, or distributed.
Any questions???

Más contenido relacionado

La actualidad más candente

Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternativesPooja Dixit
 
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
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systemskaran2190
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization Hafiz faiz
 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system modelHarshad Umredkar
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architectureYisal Khan
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseMd. Shamsur Rahim
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESAAKANKSHA JAIN
 
Distributed Database System
Distributed Database SystemDistributed Database System
Distributed Database SystemSulemang
 
Deadlock management
Deadlock managementDeadlock management
Deadlock managementAhmed kasim
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems SHATHAN
 

La actualidad más candente (20)

Distributed design alternatives
Distributed design alternativesDistributed design alternatives
Distributed design alternatives
 
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
 
Ddbms1
Ddbms1Ddbms1
Ddbms1
 
Distributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithmsDistributed Mutual exclusion algorithms
Distributed Mutual exclusion algorithms
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systems
 
Lecture 3 threads
Lecture 3   threadsLecture 3   threads
Lecture 3 threads
 
Query Decomposition and data localization
Query Decomposition and data localization Query Decomposition and data localization
Query Decomposition and data localization
 
CS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMSCS6601 DISTRIBUTED SYSTEMS
CS6601 DISTRIBUTED SYSTEMS
 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
 
Distributed system architecture
Distributed system architectureDistributed system architecture
Distributed system architecture
 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed Database
 
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUESDISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
DISTRIBUTED DATABASE WITH RECOVERY TECHNIQUES
 
The CAP Theorem
The CAP Theorem The CAP Theorem
The CAP Theorem
 
Distributed Database System
Distributed Database SystemDistributed Database System
Distributed Database System
 
Fault tolerance
Fault toleranceFault tolerance
Fault tolerance
 
Deadlock management
Deadlock managementDeadlock management
Deadlock management
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
 

Similar a management of distributed transactions

Management of Distributed Transactions
Management of Distributed TransactionsManagement of Distributed Transactions
Management of Distributed TransactionsAnkita Dubey
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsSachin Chauhan
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency controlAbDul ThaYyal
 
deadlock prevention
deadlock preventiondeadlock prevention
deadlock preventionNilu Desai
 
Unit v-Distributed Transaction and Replication
Unit v-Distributed Transaction and ReplicationUnit v-Distributed Transaction and Replication
Unit v-Distributed Transaction and ReplicationDhivyaa C.R
 
UNIT IV DIS.pptx
UNIT IV DIS.pptxUNIT IV DIS.pptx
UNIT IV DIS.pptxSamPrem3
 
Fault Tolerant and Distributed System
Fault Tolerant and Distributed SystemFault Tolerant and Distributed System
Fault Tolerant and Distributed Systemsreenivas1591
 
Distributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency controlDistributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency controlbalamurugan.k Kalibalamurugan
 
Synchronization
SynchronizationSynchronization
SynchronizationSara shall
 
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxUnit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxKoteswari Kasireddy
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxMArshad35
 
Transaction Processing its properties & States
Transaction Processing its properties & StatesTransaction Processing its properties & States
Transaction Processing its properties & StatesMeghaj Mallick
 
Unit iv -Transactions
Unit iv -TransactionsUnit iv -Transactions
Unit iv -TransactionsDhivyaa C.R
 
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...DHANUSHKUMARKS
 
Ripple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperRipple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperTrung Vu
 
Remote Procedure Call (RPC) Server creation semantics &amp; call semantics
Remote Procedure Call (RPC) Server creation semantics &amp; call semanticsRemote Procedure Call (RPC) Server creation semantics &amp; call semantics
Remote Procedure Call (RPC) Server creation semantics &amp; call semanticssvm
 

Similar a management of distributed transactions (20)

Management of Distributed Transactions
Management of Distributed TransactionsManagement of Distributed Transactions
Management of Distributed Transactions
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
 
4. concurrency control
4. concurrency control4. concurrency control
4. concurrency control
 
deadlock prevention
deadlock preventiondeadlock prevention
deadlock prevention
 
Chapter 13
Chapter 13Chapter 13
Chapter 13
 
Unit v-Distributed Transaction and Replication
Unit v-Distributed Transaction and ReplicationUnit v-Distributed Transaction and Replication
Unit v-Distributed Transaction and Replication
 
UNIT IV DIS.pptx
UNIT IV DIS.pptxUNIT IV DIS.pptx
UNIT IV DIS.pptx
 
Fault Tolerant and Distributed System
Fault Tolerant and Distributed SystemFault Tolerant and Distributed System
Fault Tolerant and Distributed System
 
Distributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency controlDistributed datababase Transaction and concurrency control
Distributed datababase Transaction and concurrency control
 
Transaction management transparencies
Transaction management transparenciesTransaction management transparencies
Transaction management transparencies
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptxUnit 4 chapter - 8 Transaction processing Concepts (1).pptx
Unit 4 chapter - 8 Transaction processing Concepts (1).pptx
 
Concurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptxConcurrency Control in Distributed Systems.pptx
Concurrency Control in Distributed Systems.pptx
 
Transaction Processing its properties & States
Transaction Processing its properties & StatesTransaction Processing its properties & States
Transaction Processing its properties & States
 
Unit iv -Transactions
Unit iv -TransactionsUnit iv -Transactions
Unit iv -Transactions
 
UNIT II.pptx
UNIT II.pptxUNIT II.pptx
UNIT II.pptx
 
Concurrency Control
Concurrency ControlConcurrency Control
Concurrency Control
 
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
enc=encoded=TlJst0_SHq0cPRhLS74QDXTP4FpU303sSqpyVVkfhckA93UCiZrRF0QVNAFGmuGu9...
 
Ripple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperRipple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout Whitepaper
 
Remote Procedure Call (RPC) Server creation semantics &amp; call semantics
Remote Procedure Call (RPC) Server creation semantics &amp; call semanticsRemote Procedure Call (RPC) Server creation semantics &amp; call semantics
Remote Procedure Call (RPC) Server creation semantics &amp; call semantics
 

Más de Nilu Desai

data mining for terror attacks
data mining for terror attacksdata mining for terror attacks
data mining for terror attacksNilu Desai
 
Adversarial search
Adversarial searchAdversarial search
Adversarial searchNilu Desai
 
collaborative study on the cloud
collaborative study on the cloudcollaborative study on the cloud
collaborative study on the cloudNilu Desai
 
digital signature for SMS security
digital signature for SMS securitydigital signature for SMS security
digital signature for SMS securityNilu Desai
 
Cookie replay attack unit wise presentation
Cookie replay attack  unit wise presentationCookie replay attack  unit wise presentation
Cookie replay attack unit wise presentationNilu Desai
 
Iris recognition system
Iris recognition systemIris recognition system
Iris recognition systemNilu Desai
 

Más de Nilu Desai (6)

data mining for terror attacks
data mining for terror attacksdata mining for terror attacks
data mining for terror attacks
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
collaborative study on the cloud
collaborative study on the cloudcollaborative study on the cloud
collaborative study on the cloud
 
digital signature for SMS security
digital signature for SMS securitydigital signature for SMS security
digital signature for SMS security
 
Cookie replay attack unit wise presentation
Cookie replay attack  unit wise presentationCookie replay attack  unit wise presentation
Cookie replay attack unit wise presentation
 
Iris recognition system
Iris recognition systemIris recognition system
Iris recognition system
 

Último

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 

Último (20)

Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 

management of distributed transactions

  • 2. Outline • Introduction • Framework • Supporting atomicity • Concurrency control • Summarization
  • 3. Introduction  The management of distributed transactions require dealing with several problems which are strictly interconnected, like- a. Reliability b. Concurrency control c. Efficient utilization of the resources of the whole system.
  • 4. Framework for transaction management 1. Properties of transactions 2. Goals of transaction management 3. Distributed transactions
  • 5. 1. Properties of transactions • Atomicity • Durability • Serializability • Isolation
  • 6. 2. Goals of transaction management • CPU and main memory utilization • Control messages • Response time • Availability
  • 7. Lets summarize! • The goal of transaction management in a distributed database is to control the execution of transactions so that: 1. Transactions have atomicity, durability, serializability and isolation properties. 2. Their cost in terms of main memory, CPU and number of transmitted control messages and their response time are minimized. 3. The availability of the system is maximized.
  • 8. 3. Distributed transactions • Agent: An agent is a local process which performs some actions on behalf of an application.
  • 9. An updating transaction Updating a master tape is fault tolerant: If a run fails for any reason, all the tape could be rewound and the job restarted with no harm done.
  • 10. Basic Transaction Primitives Primitive Description BEGIN_TRANSACTION Make the start of a transaction END_TRANSACTION Terminate the transaction and try to commit ABORT_TRANSACTION Kill the transaction and restore the old values READ Read data from a file, a table WRITE Write data to a file, a table
  • 13. Flat and nested transactions T S 1 T22 T21 T12 T11 T2 T1 T S 3 S 2 S 2 S 6 S 5 S 4 S 1 S 3 (a) Distributed flat (b) Distributed nested S 7 S 0 A circle (Si) denotes a server, and a square (Tj) represents a sub- transaction.
  • 14.  Flat transaction send out requests to different servers and each request is completed before client goes to the next one.  Nested transaction allows sub-transactions at the same level to execute concurrently.
  • 15. Supporting atomicity of distributed transactions • Recovery in centralized databases • Communication failures in distributed databases. • Recovery of distributed transactions. • The 2-Phase-commitment protocol
  • 16. 1-phase atomic commit protocol • A transaction comes to an end when the client requests that a transaction be committed or aborted. • Simple way is: coordinator to communicate the commit or abort request to all of the participants in the transaction and to keep on repeating the request until all of them have acknowledged that they had carried it out. • Inadequate because when the client requests a commit, it does not allow a server to make a unilateral decision to abort a transaction. E.g. deadlock avoidance may force a transaction to abort at a server when locking is used. So any server may fail or abort and client is not aware.
  • 17. 2-phase commit protocol • Allow any participant to abort its part of a transaction. Due to atomicity, the whole transaction must also be aborted. • In the first phase, each participant votes for the transaction to be committed or aborted. Once voted to commit, not allowed to abort it. So before votes to commit, it must ensure that it will eventually be able to carry out its part, even if it fails and is replaced. • A participant is said to be in a prepared state if it will eventually be able to commit it. So each participant needs to save the altered objects in the permanent storage device together with its status- prepared.
  • 18. 2-phase commit protocol • In the second phase, every participant in the transaction carries out the joint decision. If any one participant votes to abort, the decision must be to abort. If all the participants vote to commit, then the decision is to commit the transaction. • The problem is to ensure that all of the participants vote and that they all reach the same decision. It is an example of consensus. It is simple if no error occurs. However, it should work when servers fail, message lost or servers are temporarily unable to communicate with one another.
  • 19. 2-phase commit protocol • If the client requests abort, or if the transaction is aborted by one of the participants, the coordinator informs the participants immediately. • It is when the client asks the coordinator to commit the transaction that two-phase commit protocol comes into use. • In the first phase, the coordinator asks all the participants if they are prepared to commit; and in the second, it tells them to commit or abort the transaction.
  • 20. Operations for 2-phase commit protocol • canCommit?(trans)-> Yes / No ▫ Call from coordinator to participant to ask whether it can commit a transaction. Participant replies with its vote. • doCommit(trans) ▫ Call from coordinator to participant to tell participant to commit its part of a transaction. • doAbort(trans) ▫ Call from coordinator to participant to tell participant to abort its part of a transaction. • haveCommitted(trans, participant) ▫ Call from participant to coordinator to confirm that it has committed the transaction. • getDecision(trans) -> Yes / No ▫ Call from participant to coordinator to ask for the decision on a transaction after it has voted Yes but has still had no reply after some delay. Used to recover from server crash or delayed messages.
  • 21. Communication in 2-phase commit protocol canCommit? Yes doCommit haveCommitted Coordinator 1 3 (waiting for votes) committed done prepared to commit step Participant 2 4 (uncertain) prepared to commit committed statusstepstatus
  • 22. Concurrency control for distributed transactions • Concurrency control based on locking in centralized databases. • Concurrency control based on locking in distributed databases.
  • 23. Concurrency control in distributed transactions • Concurrency control for distributed transactions: each server applies local concurrency control to its own objects, which ensure transactions serializability locally. • However, the members of a collection of servers of distributed transactions are jointly responsible for ensuring that they are performed in a serially equivalent manner. Thus global serializability is required.
  • 24. locks • Lock manager at each server decide whether to grant a lock or make the requesting transaction wait. • However, it cannot release any locks until it knows that the transaction has been committed or aborted at all the servers involved in the transaction. • A lock managers in different servers set their locks independently of one another. It is possible that different servers may impose different orderings on transactions.
  • 25. Timestamp ordering concurrency control • In a single server transaction, the coordinator issues a unique timestamp to each transaction when it starts. Serial equivalence is enforced by committing the versions of objects in the order of the timestamps of transactions that accessed them. • In distributed transactions, we require that each coordinator issue globally unique time stamps. The coordinators must agree as to the ordering of their timestamps. <local timestamp, server-id>, the agreed ordering of pairs of timestamps is based on a comparison in which the server-id is less significant. • The timestamp is passed to each server whose objects perform an operation in the transaction.
  • 26. Timestamp ordering concurrency control • To achieve the same ordering at all the servers, The servers of distributed transactions are jointly responsible for ensuring that they are performed in a serially equivalent manner. E.g. If T commits after U at server X, T must commits after U at server Y. • Conflicts are resolved as each operation is performed. If the resolution of a conflict requires a transaction to be aborted, the coordinator will be informed and it will abort the transaction at all the participants.
  • 27. locking T U Write(A) at X locks A Write(B) at Y locks B Read(B) at Y waits for U Read(A) at X waits for T **************************************************** ************** T before U in one server X and U before T in server Y. These different ordering can lead to cyclic dependencies between transactions and a distributed deadlock situation arises.
  • 28. Distributed deadlock • Deadlocks can arise within a single server when locking is used for concurrency control. Servers must either prevent or detect and resolve deadlocks. • Using timeout to resolve deadlock is a clumsy approach. Why? Another way is to detect deadlock by detecting cycles in a wait for graph.
  • 29. Distributed transaction managers must ensure that all transactions have the atomicity, durability, seriability and isolation properties. In most systems, this is obtained by implementing on top of existing local transaction managers the 2-phase- commitment protocol for reliability,2-phase-locking for concurrency control, and timeouts for deadlock detection. The 2-phase-commitment protocol ensures that the subtransactions of the same transaction will either all commit or all abort, in spite of the possible failures. 2-phase- commitment is resilient to any failure in which no log information is lost. The 2- phase-locking mechanism requires that all subtransactions acquire locks in the growing phase and release locks in the shrinking phase. Timeout mechanisms for deadlock detection simply abort those transactions which are in wait, possibly for a deadlock. Several computation and communication structures are possible for distributed transaction managers. The computation can use processes permanently assigned to transactions, or servers dynamically bound to them. Processes can have a centralized structure, in which one agent activates all other agents, or a hierarchical structure, in which each agent can in turn activate other agents. The communication can use sessions or datagrams. The communication structure of the commitment protocol can be centralized, hierarchical, linear, or distributed.