ICS 214B: Transaction Processing and Distributed Data Management - PowerPoint PPT Presentation

Loading...

PPT – ICS 214B: Transaction Processing and Distributed Data Management PowerPoint presentation | free to download - id: 6c910f-ZThhM



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

ICS 214B: Transaction Processing and Distributed Data Management

Description:

Lecture 15: Data Replication with Network Partitions & Transaction Processing Systems Professor Chen Li – PowerPoint PPT presentation

Number of Views:7
Avg rating:3.0/5.0
Date added: 13 March 2020
Slides: 51
Provided by: Chen2153
Learn more at: http://www.ics.uci.edu
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: ICS 214B: Transaction Processing and Distributed Data Management


1
ICS 214B Transaction Processing and Distributed
Data Management
  • Lecture 15 Data Replication with Network
    Partitions
  • Transaction Processing Systems
  • Professor Chen Li

2
Network partitions
  • Groups of nodes may be isolated or nodes may be
    slow in responding

P
P
Net
3
Network Partitions
  • No replicated data
  • Quorum-based 3PC
  • abort, commit quorums
  • Replicated data
  • at most one operational group
  • coterie
  • propagation of updates

4
Quorums
. a
. c
b .
. d
  • C1 a,b,c, a,b,d, a,c,d, b,c,d
  • A1 a,b, a,c, a,d, b,c, b,d, c,d
  • Important property X?C1 ? ?Y?A1 X?Y?Ø
  • Y?A1 ? ?X?C1 X?Y?Ø

5
  • Some quorums can be implemented with vote
    assignments
  • To commit ? 3
  • To abort ? 2
  • Votes to commit votes to abort gt total votes
  • Why?

1
. a
. c
b .
1
1
. d
1
6
Not all quorums can be implemented via votes
  • C2 a,b, c,d
  • A2 a,c, a,d, b,c, b,d

b
a
d
c
7
Proof
  • C2 a,b, c,d
  • A2 a,c, a,d, b,c, b,d
  • Suppose it can be implemented via votes
  • Let each site symbol represent its vote
  • Let x be the commit threshold
  • Let y be the abort threshold
  • Commit Abort
  • a b gt x a c gt y
  • y gt c d x gt b d
  • c d gt x a d gt y
  • y gt a b x gt b c
  • b c
    gt y
  • x gt a d
  • b d
    gt y
  • x gt a c
  • 2y gt 2(abcd) gt 2x 4x gt 4(abcd) gt 4y

8
Another Proof
  • C2 a,b, c,d
  • A2 a,c, a,d, b,c, b,d
  • Commit Abort
  • a b gt x a c gt y
  • c d gt x a d gt y
  • b c gt y
  • b d gt y
  • 2 () 1 ()
  • 4(abcd) gt 4x 4y
  • abcd gt x y ? contradiction!

9
Partitions and data replication
  • Options
  • (1) All copies required for updates
  • (2) Group may update, but at most one (at a time)
  • (3) Any group may update

10
Updates by at most one group
. a
. c
b .
  • Coterie
  • C1 a,b,c, a,b,d, a,c,d, b,c,d
  • C2 a,b, a,c, a,d, b,c,d
  • X1 a,b, c,d not valid
  • Important property
  • S?C ? ?G?C, S?G?Ø

. d
11
Reading replicated data
. a
. c
b .
. d
  • C1 a,b,c, a,b,d, a,c,d, b,c,d
  • R1 a,b, a,c, a,d,b,c, b,d, c,d
  • C2 R2 a,b, a,c, a,d, b,c,d

12
Reading replicated data - Votes
  • C1 a,b,c, a,b,d, a,c,d, b,c,d
  • R1 a,b, a,c, a,d,b,c, b,d, c,d

1
. a
to write get 3 votes (Vw) to read get 2 votes (VR)
. c
b .
1
1
. d
1
13
Reading replicated data - Votes
  • C2 R2 a,b, a,c, a,d, b,c,d

2
. a
to write get 3 votes (Vw) to read get 3 votes (VR)
. c
b .
1
1
. d
1
14
A Problem
  • Example a 3-node system, 1 vote each node,
    replicated data
  • Now T1 . a T1 is committed at a,b.
  • But after T1 writes data
  • at b before it writes
  • data at a, the network
  • gets repartitioned.
  • T1 . b . c

15
  • Later T1 . a T2 reads at c
  • (not seeing T1)
  • . b . c then writes and commits
    at a, c

Then c doesnt see T1!
16
Solution
  • Each node keeps list of committed transactions
  • Whenever a new quorum is formed
  • Compare sequence numbers to see which node has
    the latest updates
  • All node apply latest updates
  • Then resume processing

17
Network Partitions Summary
  • No replicated data
  • abort, commit quorums
  • Replicated data
  • at most one operational group
  • coterie
  • propagation of updates

18
Next Transaction Processing Systems
19
Basic concepts
  • Business Transactions
  • Real-world interaction
  • On-line Transactions
  • execution of program that performs some
    function(s) of business transaction
  • steps
  • get inputs
  • do work (access DBs)
  • produce response

20
Example applications
  • ATMs
  • E.g., 1 trans per minute per ATM
  • 60 ATMs ? 1 trans/sec
  • Stock exchange

21
Transaction Processing System (TPS)

Presentation manager
Presentation manager
servers clients
transaction programs
workflow control
resource managers
22
TP Monitor
  • The operating system for the TPS
  • Functions
  • manage processes that run trans. programs
  • load balancing
  • commit distributed transactions
  • route requests from clients to servers
  • etc.

23
TP monitor architecture
Presentation server
Network manager
requests
queues
Workflow controller
net
Transaction server
Transaction server
.
24
  • Two-tier Three-tier

Client
presentation
workflow
database server
transaction servers
25
TP monitor glue and veneer
  • TP application programs

TP monitor API veneer
transactional communications
request routing
2 phase commit
...
operating system services
communi- cation services
database system services
user interface services
26
TP monitor functions
  • presentation
  • communication clients-servers
  • workflow management
  • commit coordination
  • process management
  • security
  • queue management

...
27
Presentation services
  • user interaction
  • constructing requests
  • authentication
  • communication
  • logging

28
User interaction
Go Airlines
agent
Fred Smith
task
check-in
reservation
do it
query
29
Check In

Flight no
Date
today
Passenger
Search for passenger
Announcements
Storm heading our way!!
30
Old-fashioned approach for client
  • Display
  • menu box
  • of screen
  • Wait for
  • user input send msg
  • to server

Code that does everything ----- ----- ----- -----
----- ----- ----- -----
31
Client using TP monitor services
  • Check in schema
  • Flight ___
  • Date ___
  • Do_check_in schema
  • Flight ___
  • Date ___

DISPLAY_FORM (CHECK_IN) some logic no date
validation? SEND_REQ (DO_CHECK_IN) some logic
(what next?)...
...
...
...
...
32
Data validation in forms
  • Best done using cached copy of valid values
  • OK for static values
  • e.g. product codes, flight numbers
  • Not OK for dynamic values
  • e.g. seats left in plane account balance
  • do this validation at server (can access DB)

33
Authentication 2 levels
  • user

client
server
Do I know/trust user?
Do I know/trust client?
34
Process Management
server
  • REQ

db
code that does the work
client
?
more code
35
OS Solution
server
db
client1
Code for all REQs
process 1
...
db
...
clientX
Code for all REQs
...
process X
? Problem too many processes.. does not scale!
36
Old fashioned TP solution
server
db
client1
single process
- code for all REQs - threading implementation
...
db
clientX
...
waiting
todo
37
  • ? Problem
  • complexity
  • need all application code in one process

38
Server processes
server
db
client1
code for req1
db
...
...
workflow/ routing
clientX
code for req2
db
39
Can be generalized
client1
routing
...
clientX
routing
40
Routing
?
REQ
  • Consider factors such as load balancing, failures

41
NEXT Inter-process communication
router
server process
another process (eg DBMS)
do work
do work
42
Transactional RPC
  • Transaction info (e.g., TRANS ID) is passed with
    calls
  • Execution of server code becomes part of
    transaction

client start-trans call commit
server
...
DB
...
work
...
...
...
43
Example
credit_card
client start-trans pay_cc debit_bank commit
pay_cc
...
...
work
...
...
...
accounts
...
debit_bank
...
...
work
...
44
Fault tolerance in RPC
client
server
____ ____ ____ call
____ ____ ____ work
timeout ??
NO REPLY
  • Timeout retry?
  • give up?

45
Motivation for queues
  • (a) server unavailable
  • (b) server loses request

client
server
?
req
client
server
46
Motivation for queues
  • (c) client down
  • (d) queues also useful for
  • - load balancing
  • - request priorities

req
client
server
ans
?
47
server
client
req
req
enqueue
dequeue
req
req
queue
other clients
other servers (load balancing)
48
client
Trans1 start_trans get inputs construct
req enqueue (Q1) commit
server
Q1 request queue
Trans2 start_trans dequeue (Q1) process
req enqueue (Q2) commit
Trans3 start_trans dequeue (Q2) decode
reply process output commit
Q2 reply queue
49
TP monitors and the web
  • http

web browser
web server
TP monitor client
daemon
TP monitor protocol
TP system
50
Summary of TPS
  • Architecture
  • Presentation services
  • Routing and workflow control
  • Process management
  • Communication services
  • RPC
  • Queues
About PowerShow.com