The Relaxed Atomicity Property

advertisement
Why should a database transaction be atomic?
ABORT = Removal of the updates of a transaction
An abort is implemented by a DBMS roll back
recovery where the before images of the log-file
are restored in the database tables.
What can initiate an automatic abort?
When should a programmer initiate an abort?
The Relaxed Atomicity Property:
Root transaction
Committing subtransaction
The Relaxed Atomicity Property:
Root transaction
Committing subtransaction
In E-commerce the
following locations are
involved:
Seller, Bank of Seller,
Buyer, Bank of Buyer, and
Card issuer.
In which locations should
the compensatable, pivot
and retriable
subtransactions be
executed?
Nested atomic subtransactions:
Subtransactions of a
compensatable
subtransaction must also
be compensatable.
Subtransactions of a
retriable subtransaction
must also be retriable.
Subtransactions of a
pivot subtransaction must
either be compensatable
Where would you recommend to use retriable
or retriable.
sub-subtransactions in E-commerce?
The Relaxed Atomicity Property:
Root transaction
Committing subtransaction
How would you
implement relaxed
atomicity in a realtime money
transfer between
two domestic
banks?
The Relaxed Atomicity Property:
Root transaction
Committing subtransaction
How would you
implement relaxed
atomicity in a realtime money
transfer between
banks in different
contries?
The Relaxed Atomicity Property:
Root transaction
Committing subtransaction
How would you
implement the
different types of
the 0-safe design
by using relaxed
atomicity?
Implementation of retriable subtransactions:
Manage compensatable and pivot subtransactions

Remote Procedure Call (RPC)

Update Propagation (UP)
Manage retriable subtransactions
In practice SOA services function as RPCs and may
also be used to implement UP.
Architecture for PULL Update Propagation from A to B:
System A
System B
Local
database
including a
transaction
file.
Local
database
including a
state record.
Architecture for PUSH Update Propagation from A to B:
System A
Local
database
including a
transaction
file.
System B
Local
database
including a
transaction
file.
PULL versus PUSH Update Propagation:
• PULL UPs are batch orientated, as transaction records are
only transferred periodically.
• PULL UPs have smaller execution cost.
• PULL UPs have a smaller programming cost.
• PULL UPs of transaction records are single threaded.
• PULL UPs may be initiated by a push.
• PULL replication from a primary copy may have lost
transactions but not lost update anomalies.
Structure of a global update transaction:
•[The user starts to read data]
•The user enters data for the update process.
•The user starts the update using the model with
compensatable, pivot, and retriable subtransactions.
Syntax
for State
diagrams:
Event
[condition]
/Action
UML-Statechart diagram
for a global transaction
Routing by using flexible transactions.
Question 1. Describe a
Petri net workflow for
flexible transactions.
Question 2. Change the
Petri net workflow in such
a way that it also functions
for recovered transactions.
Syntax for the State
diagram:
Event
[condition]
Action
The main problems of mobile computing:
•Disconnections
•Location dependency
•Resource constraints
•Low bandwidth
The disconnection problem:
Mobile
host
Communication
cell operated by a
mobile support
station
1
4 disconnection
Foreign
agent
Wiered
network
2
3
Database
server
The location dependency problem:
Mobile
host
Communication
cell operated by a
mobile support
station
1
4
5
Foreign
agent
Wiered
network
2
Moved
Mobile
host
3
Database
server
New
foreign
agent
Communication
cell operated
by the new
mobilesupport
station
Push message propagation:
Mobile
host
Communication
cell operated by a
mobile support
station
1
4 disconnection
6
7
Foreign
agent
Wiered
network
2
3
5 push
8 acknow ledgement
Database
server
Pull message propagation:
Mobile
host
Communication
cell operated by a
mobile support
station
1
4 disconnection
5
8
Foreign
agent
Wiered
network
2
3
6
Database
server
7 pull the answer
Pull message propagation after motion:
Mobile
host
Communication
cell operated by a
mobile support
station
1
Moved
Mobile
host
4
5
6
7
10
New
foreign
agent
Foreign
agent
8
Wiered
network
Communication
cell operated
by the new
mobile support
station
2
3
Database
server
9
Atomicity in mobile computing:
How can SOA help in
implementing mobile atomicity?
Exercise:
Describe and design an integrated distributed database including mobile
databases where an e-commerce supplier can deliver its products direct
to its customers and at the same time get automatic acknowledgement for
the delivery in both the database of the supplier and the customer.
Describe also the integrated workflow of the integration.
Can the earlier described distributed ERP system be used?
Customers
Orders
Locations
Orderlines
Productstocks
Products
Input
Input is supplier
orders or deliveries.
New
Supplier
orders.
Orderlines
are replicated
to the mobile
controllers
Workflow for making mobile
control of supplier deliveries.
Reduced product delivery
Product
Delivery
AND
SPLIT
deliveries
larger than
Accepted product
ordered
Select
deliveries
AND
JOIN
a control
action
Update the
local stock
Delivery
matches an
Orderline
Accepted product
deliveries
Reduced
orderline
Orderlines
Delivery
less than
ordered
AND
SPLIT
Replicate the mobile
registrations to the
central ERP system
Delivery
is not
ordered
Error reports
End of workflow
End of session
Thank you !!!
Implementation of distributed CSCW:
•Describe compensatable, pivot, and retriable
subtransactions for the most important update transactions
•Describe the countermeasures recommended for the most
important transactions
Objectives for a DDBMS
(Distributed DataBase Management System):
Distribution transparency, that is
Replication transparency
Distributed optimizer
Distributed ACID properties
Homogeneity as Heterogeneity is not in the marked
Distribution architectures
Synchronous distributed
database management
system (DDBMS)
Central database
with distributed
clients
Multidatabases with
flexible transactions.
Hot backup
possibility
n-safe and mirroring
Only mirroring is
possible
0- safe, 1 safe and
mirroring
Read performance/
capacity
Best
Worst
Average
Write performance
Worst
Average
Best
Blocking possibility
Yes
No
no
Ease of failure
recovery
Worst (The systems are
very complex)
Best
Best
Disaster recovery
Best
Worst
Average
The probability of
lost data[1]
Best.
pn
Worst
p
Average
Transaction logging
Not supported
Not supported
Recommended
Availability[2]
1-qn
1-q
1-qn
Atomicity
Best
Best
Best
Consistency
Best
Best
Worst
Isolation
Best
Best
Worst
Durability
Best
Best
Best
Develop-ment costs
Best
Best
Worst
Evaluation criteria
(Relaxed ACID properties)
Distributed DataBase Management System(DDBMS)
TM = Transaction Manager.
DM = Data Manager.
Global user views
Distribueret
data dictionary: Global conceptual
view
Distribution schema
Fragmentation
schema
Allocation schema
Local conversion schema
Other
Locallocations
conver-
Local schema
Local schema
Server
Server
sion schema
Other locations
Distributed DataBase Management System(DDBMS)
TM = Transaction Manager.
DM = Data Manager.
Homogenious
DDBMS.
TM
dictionary
DM
dictionary
Heterogenious
DDBMS.
TM
dictionary
TM
dictionary
Conversion
schema
Commit by using distributed 2PC:
Abort with distributed 2PC
Download