Transactions and Concurrency Control in distributed systems. Transaction properties, classification, and transaction implementation. Flat, Nested, and Distributed transactions. Inconsistent Retrievals, Lost Update, Dirty Read, and Premature Writes Problem
In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC) is a type of atomic commitment protocol (ACP). ... The protocol achieves its goal even in many cases of temporary system failure (involving either process, network node, communication, etc. failures), and is thus widely used.
Replication in computing involves sharing information so as to ensure consistency between redundant resources, such as software or hardware components, to improve reliability, fault-tolerance, or accessibility.
In transaction processing, databases, and computer networking, the two-phase commit protocol (2PC) is a type of atomic commitment protocol (ACP). ... The protocol achieves its goal even in many cases of temporary system failure (involving either process, network node, communication, etc. failures), and is thus widely used.
Replication in computing involves sharing information so as to ensure consistency between redundant resources, such as software or hardware components, to improve reliability, fault-tolerance, or accessibility.
Query Processing : Query Processing Problem, Layers of Query Processing Query Processing in Centralized Systems – Parsing & Translation, Optimization, Code generation, Example Query Processing in Distributed Systems – Mapping global query to local, Optimization,
DDBMS, characteristics, Centralized vs. Distributed Database, Homogeneous DDBMS, Heterogeneous DDBMS, Advantages, Disadvantages, What is parallel database, Data fragmentation, Replication, Distribution Transaction
Synchronization in distributed computingSVijaylakshmi
Synchronization in distributed systems is achieved via clocks. The physical clocks are used to adjust the time of nodes. Each node in the system can share its local time with other nodes in the system. The time is set based on UTC (Universal Time Coordination).
Query Processing : Query Processing Problem, Layers of Query Processing Query Processing in Centralized Systems – Parsing & Translation, Optimization, Code generation, Example Query Processing in Distributed Systems – Mapping global query to local, Optimization,
DDBMS, characteristics, Centralized vs. Distributed Database, Homogeneous DDBMS, Heterogeneous DDBMS, Advantages, Disadvantages, What is parallel database, Data fragmentation, Replication, Distribution Transaction
Synchronization in distributed computingSVijaylakshmi
Synchronization in distributed systems is achieved via clocks. The physical clocks are used to adjust the time of nodes. Each node in the system can share its local time with other nodes in the system. The time is set based on UTC (Universal Time Coordination).
DBF-Lecture11-Chapter12.ppt
Database Principles: Fundamentals of Design, Implementations and Management
Lecture11- CHAPTER 12: Transaction Management and Concurrency Control
Presented by Rabia Cherouk
*
ObjectivesIn this chapter, you will learn:About database transactions and their propertiesWhat concurrency control is and what role it plays in maintaining the database’s integrityWhat locking methods are and how they workHow stamping methods are used for concurrency controlHow optimistic methods are used for concurrency controlHow database recovery management is used to maintain database integrity
*
What is a Transaction?A transaction is a logical unit of work that must be either entirely completed or abortedSuccessful transaction changes database from one consistent state to anotherOne in which all data integrity constraints are satisfiedMost real-world database transactions are formed by two or more database requestsEquivalent of a single SQL statement in an application program or transaction
Same as Fig. 12.1 in your book
*
Same as Fig. 12.1 in your book
*
Evaluating Transaction Results Not all transactions update the databaseSQL code represents a transaction because database was accessedImproper or incomplete transactions can have devastating effect on database integritySome DBMSs provide means by which user can define enforceable constraintsOther integrity rules are enforced automatically by the DBMS
Same as Fig. 12.2 in your book
*
Figure 9.2
Same as Fig. 12.2 in your book
*
Transaction Properties
All transactions must display atomicity, consistency, durability and serializability (ACIDS).AtomicityAll operations of a transaction must be completedConsistency Permanence of database’s consistent stateIsolation Data used during transaction cannot be used by second transaction until the first is completed
*
Transaction Properties (cont..)Durability Once transactions are committed, they cannot be undoneSerializabilityConcurrent execution of several transactions yields consistent resultsMultiuser databases are subject to multiple concurrent transactions
*
Transaction Management with SQLANSI (American National Standard Institute) has defined standards that govern SQL database transactionsTransaction support is provided by two SQL statements: COMMIT and ROLLBACKTransaction sequence must continue until:COMMIT statement is reachedROLLBACK statement is reachedEnd of program is reachedProgram is abnormally terminated
*
The Transaction LogA DBMS uses a Transaction log to store:A record for the beginning of transactionFor each transaction component: Type of operation being performed (update, delete, insert)Names of objects affected by transaction“Before” and “after” values for updated fieldsPointers to previous and next transaction log entries for the same transactionEnding (COMMIT) of the transaction
Table 12.1 in your book
*
The Transaction Log
Table 12.1 in your book
*
Concurrency ControlIs the coordination o.
Introduction to transaction processing concepts and theoryZainab Almugbel
Modified version of Chapter 21 of the book Fundamentals_of_Database_Systems,_6th_Edition with review questions
as part of database management system course
Distributed database system is collection of loosely coupled sites that are independeant of each other.
Distributed transaction model
Concurrency control
2 phase commit protocol
Transaction Processing; Concurrency control; ACID properties; Schedule and Discoverability; Serialization; Concurrency control and Recovery; Two Phase locking; Deadlock Shadow Paging
Introduction to Machine Learning
Association Analysis
Supervised (inductive) learning
Training data includes desired outputs
Classification
Regression/Prediction
Unsupervised learning
Training data does not include desired outputs
Semi-supervised learning
Training data includes a few desired outputs
Reinforcement learning
Rewards from sequence of actions
Instruction Level Parallelism – Hardware Techniques such as Branch prediction (Static and Dynamic Branch Prediction).
Tomasulo Algorithm and Multithreading.
Advanced Computer Architecture – An IntroductionDilum Bandara
Introduction to advanced computer architecture, including classes of computers,
Instruction set architecture, Trends, Technology, Power and energy
Cost
Principles of computer design
Overview of the fundamental roles in Hydropower generation and the components involved in wider Electrical Engineering.
This paper presents the design and construction of hydroelectric dams from the hydrologist’s survey of the valley before construction, all aspects and involved disciplines, fluid dynamics, structural engineering, generation and mains frequency regulation to the very transmission of power through the network in the United Kingdom.
Author: Robbie Edward Sayers
Collaborators and co editors: Charlie Sims and Connor Healey.
(C) 2024 Robbie E. Sayers
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Quality defects in TMT Bars, Possible causes and Potential Solutions.PrashantGoswami42
Maintaining high-quality standards in the production of TMT bars is crucial for ensuring structural integrity in construction. Addressing common defects through careful monitoring, standardized processes, and advanced technology can significantly improve the quality of TMT bars. Continuous training and adherence to quality control measures will also play a pivotal role in minimizing these defects.
Courier management system project report.pdfKamal Acharya
It is now-a-days very important for the people to send or receive articles like imported furniture, electronic items, gifts, business goods and the like. People depend vastly on different transport systems which mostly use the manual way of receiving and delivering the articles. There is no way to track the articles till they are received and there is no way to let the customer know what happened in transit, once he booked some articles. In such a situation, we need a system which completely computerizes the cargo activities including time to time tracking of the articles sent. This need is fulfilled by Courier Management System software which is online software for the cargo management people that enables them to receive the goods from a source and send them to a required destination and track their status from time to time.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
COLLEGE BUS MANAGEMENT SYSTEM PROJECT REPORT.pdfKamal Acharya
The College Bus Management system is completely developed by Visual Basic .NET Version. The application is connect with most secured database language MS SQL Server. The application is develop by using best combination of front-end and back-end languages. The application is totally design like flat user interface. This flat user interface is more attractive user interface in 2017. The application is gives more important to the system functionality. The application is to manage the student’s details, driver’s details, bus details, bus route details, bus fees details and more. The application has only one unit for admin. The admin can manage the entire application. The admin can login into the application by using username and password of the admin. The application is develop for big and small colleges. It is more user friendly for non-computer person. Even they can easily learn how to manage the application within hours. The application is more secure by the admin. The system will give an effective output for the VB.Net and SQL Server given as input to the system. The compiled java program given as input to the system, after scanning the program will generate different reports. The application generates the report for users. The admin can view and download the report of the data. The application deliver the excel format reports. Because, excel formatted reports is very easy to understand the income and expense of the college bus. This application is mainly develop for windows operating system users. In 2017, 73% of people enterprises are using windows operating system. So the application will easily install for all the windows operating system users. The application-developed size is very low. The application consumes very low space in disk. Therefore, the user can allocate very minimum local disk space for this application.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
1. Transactions & Concurrency
Control
CS4262 Distributed Systems
Dilum Bandara
Dilum.Bandara@uom.lk
Some slides adapted from U Uthaiyashankar (WSO2) and Rajkumar
Buyya’s
3. Transactions
Transactions protect a shared resource (e.g.,
shared data) against simultaneous access by
several concurrent processes
Transactions can do much more…
They allow a process to access & modify multiple data
items as a single atomic operation
All-or-nothing property
3
4. Transactions in DBMS
A unit of work performed within a DBMS against
a database
Treated in a coherent & reliable way independent of
other transactions
2 main purposes
To provide reliable units of work that allow correct
recovery from failures & keep a database consistent
even in cases of (complete or partial) system failure
To provide isolation between programs accessing a
database concurrently
4
5. Goal of Transactions
To ensure objects managed by a server remain
in a consistent state when accessed by multiple
transactions in the presence of server failure
Transactions deal with process crash failures &
communication omission failures
Transactions don’t deal with Byzantine failure
5
6. Transaction Model
Recoverable objects
Objects that can be recovered after their server
crashes
Failure atomicity
Effects of the transaction are atomic even when
server crashes
Transactions require coordination among
A client program
Some recoverable objects
A coordinator
6
7. Transaction Model (Cont.)
Each transaction is created & managed by a
coordinator which implements the coordinator
interface
Coordinator gives each transaction an identifier (TID)
Clients invoke transaction coordinator interface
methods to perform a transaction
A transaction may be aborted by client or server
7
8. Transaction Coordinator Interface
openTransaction() → trans
Starts a new transaction & delivers a unique TID trans
trans will be used in other operations in the transaction
closeTransaction(trans) → (commit, abort)
Ends a transaction
commit – indicates that transaction has committed
abort – Indicates that it has aborted
abortTransaction(trans)
Aborts the transaction
8
9. Properties of a Transaction
Proposed by Harder & Reuter in 1983
ACID Property
Atomic
Consistent
Isolated
Durable
9
10. Atomic Property
Process all of a transaction or none of it
To outside world, transaction happens indivisibly
While a transaction happens, other processes
can’t see any intermediate states
Example
A file is 100 bytes long when a transaction starts to
append to it
If other processes read the file during transaction,
they should see & access only the 100 bytes
If transaction commits successfully, file grows
instantaneously to its new size
10
11. Consistent Property
Data on all systems reflects the same state
Transaction doesn’t violate system invariants
Example
In a banking system, a key invariant is the law of
conservation of money
After any internal transfer, amount of money in bank
must be same as it was before transfer
During internal transfer operations, this invariant may
be violated
But this violation isn’t visible outside the transaction
11
12. Isolated Property
Transactions don’t interact/interfere with one
another
Concurrent transactions don’t interfere with each
other
i.e., transactions are serializable
Example
If 2+ transactions are running at the same time, to
each of them & to other processes, final result
appears as though all transactions ran sequentially (in
some system-dependent order)
12
13. Durable Property
Effects of a completed transaction are persistent
Once a transaction commits, changes are
permanent
No failure after the commit can undo results or
cause them to be lost
13
14. Ensuring Transaction Properties
To support “failure atomicity” & “durability”,
objects must be recoverable
To support “isolation” & “consistency” server
needs to synchronize operations
Perform transactions serially (sequentially)
Generally, an unacceptable solution
Allow transactions to execute concurrently, if they
would have the same effect as a serial execution
Known as serializable or serially equivalent transactions
14
16. Flat Transactions
A series of operations
Don’t allow partial results to be committed or
aborted
e.g., booking multiple air lines from start to
destination
16
17. Nested Transactions
Constructed from a number of sub-transactions
Top-level transaction may fork off children that
run in parallel to one another
Incase of failure results of some sub-transaction
that committed must be undone
e.g., booking multiple air lines from start to
destination
17
18. Distributed Transactions
Logically, a flat, indivisible transaction that
operates on distributed data
In contrast, a nested transaction is logically
decomposed into a hierarchy of sub-transactions
18
Source: Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007
19. Achieving Transaction Properties in
Distributed Transactions
To achieve atomicity & durability
Distributed commit protocols
To achieve consistency & isolation
Concurrency control algorithms (distributed locking
protocols)
We need separate distributed algorithms to
handle “locking of data” & “committing entire
transaction”
19
20. Transaction Implementation
Consider transactions on a file system
If each process executing a transaction just updates
the file it uses in place, then transactions will not be
atomic
2 common implementation techniques
Private workspace
Write-ahead log
20
21. Private Workspace
Provide private (local) copies
All updates on private copies
Update the original (global) copy while
committing
Issues
Cost of copying everything
Possible solution
Keep a pointer to relevant file block
When writing copy file block, instead of entire file
Update original when closing file
Examples – Andrew file systems
21
22. Example – Private Workspace
Implementation
22
Source: Andrew S. Tanenbaum , Distributed Operating Systems
23. Write-Ahead Log
Files are modified in-place
Before any changes, a record is written in a log
indicating
Which transaction is making the change
Which file & block is being changed
What old & new values are
Change is made to file only after log is written
successfully
Example – log structured file system
If transaction succeeds & is committed, a commit
record is written in log
If transaction is aborted, log is used to revert file
back to its original state – rollback 23
25. Concurrency Control
Goal
Allow simultaneous execution of transactions
While enabling each transaction to be isolated & data
items being manipulated are left in a consistent state
Consistency
Achieved by giving transactions access to data items in
a specific order
Final result would be the same as if all transactions
were run sequentially
25
27. Achieving Concurrency Control
(Cont.)
Data manager
Performs actual read/write on data
Not concerned about transaction
Scheduler
Responsible for properly controlling concurrency
Determines which transaction is allowed to pass a read/write
operation to data manager & at which time
Schedules individual read/write s.t. transaction isolation &
consistency properties are met
Transaction manager
Guarantees transaction atomicity
Processes transaction primitives by transforming them into
scheduling requests
27
28. Each site has a scheduler & data manager
Each transaction is handled by a transaction manager
Transaction manager communicates with schedulers
at different sites
Scheduler may also communicate with remote data
managers
Distributed Concurrency Control
28
30. Schedules – Example
Schedule – system dependent order of actions
Final result looks as though all transactions ran sequentially
30
31. Concurrent Transaction Issues
Lost update problem
Transactions should not read a “stale” value & use it
in computing a new value
Inconsistent retrievals problem
Update transactions shouldn’t interfere with retrievals
Illustrated in the context of banking examples…
31
32. “Lost Update” Problem
3 bank accounts (A, B, C) with balances,
A = $100, B = $200, C = $300
Transaction T
Transfers from account A to B, for 10% increase in the B’s
balance
B = $200 + ($200*10%) = $220
A = $100 – ($200*10%) = $80
Transaction U
Transfers from C to B, for 10% increase in B’s balance
B = $220 + ($220*10%) = $242
C = $300 – ($220*10%) = $278
What might happen if transactions T & U are executed
concurrently?
32
34. “Inconsistent Retrievals” Problem
2 bank accounts (A, B) with balances
A = $200
B = $200
Transaction V
Transfers $100 of account A to B
A = $200 - $100 = $100
B = $200 + $100 = $300
Transaction W
Computes sum of all account balances (branch total)
Total = $100 + $300 +…… = $400 + ……
What might happen if transactions V & W are executed
concurrently? 34
36. Serial Equivalence
Serial equivalence prevents occurrence of lost
updates & inconsistent retrievals
Thus, serial equivalence is used as a criterion in
concurrency control algorithms
2 transactions are serially equivalent if
All pairs of conflicting operations of 2 transactions are
executed in same order at all of the objects that both
transactions access
36
37. Serial Equivalence (Cont.)
Consider 2 objects i & j, & 2 transactions T & U
Serially equivalent orderings require one of the
following 2 conditions
T accesses i before U, and T accesses j before U
U accesses i before T, and U accesses j before T
37
42. Issues in Aborting Transactions
Servers must record effects of all committed
transactions & none of aborted transactions
2 well-known problems
Dirty reads
Premature writes
Both of these can occur in the presence of
serially equivalent executions of transactions
42
44. Example – Premature Writes
Due to interaction between write operations on
the same object belonging to different
transactions
If U aborts & T commits, balance should be $105
44
45. Concurrency Control Algorithms
2-Phase Locking (2PL)
Get all locks, then release them
No more lock acquisition when a lock is release
Timestamp ordering
Lamport’s time stamp
Optimistic concurrency
Go & do the changes, if there is a problem let’s
handle them later
How to do these concurrently on a distributed
system? 45
Editor's Notes
Both T and U read the balance of B (200)
T overwrites the update by U without seeing it
W computes the sum before V updates account B
Both T and U read the balance of B (200)
T overwrites the update by U without seeing it