transaction

advertisement
Course overview grouped by
System integration software types:
1. Homogeneous ERP systems integrated by using a common database.
2. Heterogeneous ERP systems from different suppliers may be
integrated by using relaxed ACID properties.
3. Workflows and Relaxed transaction can send subtransactions to other
systems and they may use a common (distributed) database.
4. Data warehouses integrate distributed data by sending data to a
common data warehouse database by using ETL
(Extract, Transform, and Load) of data from the operative systems.
1
Work flow
example with
insurance
claims.
What are the differences
between
Work flow diagrams and
Flow chart diagrams?
2
Petri Net is an attempt to standardize Work Flows:
• Transition = Task.
• Token = Case with a transaction
illustrated as a black dot in a place.
• Place = Queue for cases/transactions before a transition.
3
Terminology of WorkFlow Management Coalition
• Task = Atomic logic
activity in a process.
• Case = Transaction in a
process.
• Place = Queue for
cases/transactions
before a transition.
• Process = A set of tasks
and a set of conditions
that determine the order
of the tasks.
4
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
What is the most
important part of the
workflow from a
system integration
point of view?
Delivery
less than
ordered
AND
SPLIT
Replicate the mobile
registrations to the
central ERP system
Delivery
is not
ordered
Error reports
End of workflow
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
How would you
implement the
database of the
workflow?
Delivery
less than
ordered
AND
SPLIT
Replicate the mobile
registrations to the
central ERP system
Delivery
is not
ordered
Error reports
End of workflow
from
Workflow
nodes
A:
to
Activities
Places
Branches from
one workflow
node to another
Colored tokens
Integrated E-commerce workflows:
Customers
Orders
Locations
Orderlines
Products
Productstocks
1. Design the workflow between an e-commerce system
and an ERP system that manage the stocks of products?
2. Is the possible to use the ERP system of the suppliers if a
product is out of stock?
Example:
Petri net
Work flow
for global
E-commerce
transactions
where the
stocks are in
the locations
of the
different
suppliers.
Start
Canseled order
1. Put products in the basket
Stock
rejected
order
Non
confirmed
order
2. Confirm order-lines and
update stocks in servers
Sub
orders
3.Suppliers send
products
Confirmed
order
Timer
OR split
5. Send the received
products to the
customer
En
Products
4. Receive products from
suppliers and update
QUANTITY received
All products
are received
6. Send the rest of the
products to the customer
SubPetri net of
activity 2
AND split
Order
-line
Non
confirmed
order
2.1 try to confirm the
next order-line
Order
-line
2.2 Supplier's server
try to confirm
order-line
More order-lines
Order
2.3 Update Order with supplier
answer for each order-line
OR split
AND join
All answers received
Order
Stock
rejected
order
2.4 Send Order with confirm
answers to the Customer. If the
Order was confirmed The Timer
is set and confirming Sub-orders
are send to the involved
suppliers.
When are the suborders committed Confirmed Order
globally in the location of the suppliers?
Timer
Sub-orders
Answer
Exercise
Customers
Branch
offices
The figure illustrates an
ER-diagram of a car rental
company like Hertz or Avis.
Orders
Contracts
Pick up
Reservations
Car return
Cars
Car types
Garage
services
Garages
Design a workflow for the car
rental company including
reservation, car pic up, car
return, and car return service.
Exercise: Design a workflow
for producing healthy patients.
Patients_____
Patient ID
Name
Address
Entities of
physical objects
Patient records
Doctors
Patient record subtypes
Patient admits
...
Sympthoms
Diagnoses/
diseases
Ordinations
Treatments
Patient
discharges
Ordination lines
Patient admit
types
...
Sympthom
types
Entities of
ER-diagram
conceptual
for a hospital.
objects
Disease
types
Treatment
types
Medicin types
Medicin products
Medical tests
Patient
discharges
types
Medicin
companies
Opgave 1.30
Beskriv databasen for et transportfirma og dets
underleverandører med et integreret logistikstyringssystem,
hvor pakker kan indsættes i collies, som herefter kan indsættes i
containers, der kan transporteres af firmaet selv eller andre
operatører/underleverandører. Transportruternes enkelte dele
kaldes ”legs”. Det er vigtigt for transportfirmaet altid at vide,
hvor en pakke er også selv om der er opstået fejl, hvor f. eks. en
pakke, collie eller container er blevet beskadiget og derefter
genpakket. Det er også vigtigt altid at kunne vælge den
optimale transportmulighed, som kan afhænge af både
transporttid og pris.
Beskriv herefter et workflow for det integrerede
transportsystem.
Hertil 1.3.2013
Concept definitions used in logistics:
Pallet = wooden skeleton where packages
may be stored in such a way that they all can
be moved by a truck.
Collie = alle the packages that are stored on a
pallet(palle).
Leg = Route or subroute where the
transportation does not have stops
ER-diagram of a logistics management system
Transport Orders
Orderlines
from
Packages, Collies and
Containers
Package- Damage
relationship
Collie
hierarchy
Customers
to
Locations
from
to
Physical
containers
Container-routes
relationships of order 3
Route-leg
hierarchy
Routes
and legs
Transport
operator
Scheduled routes
and legs
Transport medias like ships, airplanes, and trucks.
Describe the local databases in the central location of the transport
company, the locations of the integrated transport suppliers, and the
mobile locations of the Transport medias. Design a workflow with focus
on the integration of the local database locations.
The ACID properties are implemented by a
DBMS (DataBase Management System).
Relaxed ACID properties are implemented by
the application programs.
•
•
•
•
Atomicity
Concistency
Isolation
Durability
17
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)
18
Evaluation of distribution architectures 1.
Evaluation
criteria
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
Ease of
disaster
recovery
Best
Worst
Average
19
Evaluation of distribution architectures 2.
Evaluation
criteria
Synchronous distributed
database management
system (DDBMS)
Central database with
distributed clients
Multidatabases
with flexible
transactions.
The probability Best
of lost data
pn
Worst p
Average
Logging of the
update
transaction
Not supported
Not supported
Recommended
Availability
1-qn
1-q
1-qn
Atomicity
Best
Best
Best
Consistency
Best
Best
Worst
Isolation
Best
Best
Worst
Durability
Best
Best
Best
Development costs
Best
Best
Worst
20
End of session
Thank you !!!
Database recovery:
Exersice.
A DB logfile stores before
images and after images of
all dataabase updates. The
logfile also stores transaction
starts and commitments.
Periodically the checkpoint
records are logged with the
IDs of all non committed
transactions.
Transaction
types
Transaction 1
Transaction 2
Transaction 3
Transaction 4
How is it possible to recover
transaction types 1 to 5 after
a transaction failure and a
CPU failure respectively?
Transaction 5
Time
Checkpoint
time
Time of
failure
22
Two Phase Commit (2PC)
and Two Phase Locking (2PL)
Exercise.
Describe the basic principles for the Two Phase Commit (2PC)
recovery protocol and the Two Phase Locking (2PL) protocol
for concurrency control.
Time
Transaction
start
Transaction
commit
23
Exercise:
Describe exactly when a transaction is committed.
What is the difference between failure and disaster recovery?
Is the durability property always trustworthy?
Is it possible to run batch programs that lock many thousends
records concurrent with on line updates that only locks a few
records?
24
ACID kravene til transaktionsafvikling:
----------------------------------------------• Atomicity = udelelighed.
• Concistency = konsistensen skal bevares
• Isolation = en transaktions opdateringer må
ikke ses af andre før de er committede.
• Durability = Holdbarhed dvs. committede
opdateringer skal kunne retableres.
25
Full ACID løsninger.
Relaxed ACID løsning.
26
Download