CS743 - Principles of Database Management and Use Distribution, - - PowerPoint PPT Presentation

cs743 principles of database management and use
SMART_READER_LITE
LIVE PREVIEW

CS743 - Principles of Database Management and Use Distribution, - - PowerPoint PPT Presentation

CS743 - Principles of Database Management and Use Distribution, Replication, and CAP Ken Salem David R. Cheriton School of Computer Science University of Waterloo Fall 2014 Data Partitioning DBMS Data Partitioning DBMS DBMS DBMS DBMS


slide-1
SLIDE 1

CS743 - Principles of Database Management and Use Distribution, Replication, and CAP

Ken Salem

David R. Cheriton School of Computer Science University of Waterloo

Fall 2014

slide-2
SLIDE 2

Data Partitioning

DBMS

slide-3
SLIDE 3

Data Partitioning

DBMS DBMS DBMS DBMS

slide-4
SLIDE 4

Two Phase Commit (2PC)

T S DBMS B DBMS A R X DBMS C

  • 1. UPDATE R
slide-5
SLIDE 5

Two Phase Commit (2PC)

T S DBMS B DBMS A R X DBMS C T

  • 1. UPDATE R
  • 2. UPDATE S
slide-6
SLIDE 6

Two Phase Commit (2PC)

T T T S DBMS B DBMS A R X DBMS C

  • 1. UPDATE R
  • 2. UPDATE S
  • 3. UPDATE X
slide-7
SLIDE 7

Two Phase Commit (2PC)

T T T S DBMS B DBMS A R X DBMS C prepare prepare commit req

  • 1. UPDATE R
  • 2. UPDATE S
  • 3. UPDATE X
  • 4. COMMIT
  • 2PC phase 1
slide-8
SLIDE 8

Two Phase Commit (2PC)

T T T S DBMS B DBMS A R X DBMS C ack ack

  • 1. UPDATE R
  • 2. UPDATE S
  • 3. UPDATE X
  • 4. COMMIT
  • 2PC phase 1
slide-9
SLIDE 9

Two Phase Commit (2PC)

T T T S DBMS B DBMS A R X DBMS C commit commit ack

  • 1. UPDATE R
  • 2. UPDATE S
  • 3. UPDATE X
  • 4. COMMIT
  • 2PC phase 1
  • 2PC phase 2
slide-10
SLIDE 10

Two Phase Commit (2PC)

T T T S DBMS B DBMS A R X DBMS C ack ack

  • 1. UPDATE R
  • 2. UPDATE S
  • 3. UPDATE X
  • 4. COMMIT
  • 2PC phase 1
  • 2PC phase 2

Strict 2PL at each site plus 2PC ensures global serializability.

slide-11
SLIDE 11

Data Replication

DBMS

slide-12
SLIDE 12

Data Replication

DBMS DBMS DBMS DBMS

slide-13
SLIDE 13

1-Copy Serializability (1SR)

  • correctness criterion suitable for replicated databases
  • system behaves as if there is a single copy of each object
  • n which transactions appear to execute sequentially in

some order

slide-14
SLIDE 14

Eager Read One, Write All (ROWA) Replication

  • to read R, read local replica of R
slide-15
SLIDE 15

Eager Read One, Write All (ROWA) Replication

  • to read R, read local replica of R
  • to update R, update all replicas of R
slide-16
SLIDE 16

Eager Read One, Write All (ROWA) Replication

  • to read R, read local replica of R
  • to update R, update all replicas of R
  • each local site has a local concurrency controller
slide-17
SLIDE 17

Eager Read One, Write All (ROWA) Replication

  • to read R, read local replica of R
  • to update R, update all replicas of R
  • each local site has a local concurrency controller
  • use 2PC to atomically commit transaction updates
slide-18
SLIDE 18

Eager Read One, Write All (ROWA) Replication

  • to read R, read local replica of R
  • to update R, update all replicas of R
  • each local site has a local concurrency controller
  • use 2PC to atomically commit transaction updates

Global Serializability

Local strict two-phase locking + 2PC for commit coordination is sufficient to ensure global 1SR.

slide-19
SLIDE 19

CAP

Consistency: serializability Availability: nodes that are up should eventually respond to requests Partition-Tolerance: system should remain consistent and available even if it partitions

slide-20
SLIDE 20

CAP

Consistency: serializability Availability: nodes that are up should eventually respond to requests Partition-Tolerance: system should remain consistent and available even if it partitions

Brewer’s CAP Conjecture (PODC 2000)

It is impossible build a [distributed database] system that provides consistency, availability, and partition-tolerance.