Database Replication in WAN Yi Lin McGill University Distributed Information Systems.

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Outline Introduction Background Distributed Database Design
CS542 Topics in Distributed Systems Diganta Goswami.
Replication. Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
Consistency and Replication Chapter 7 Part II Replica Management & Consistency Protocols.
Multicast Fundamentals n The communication ways of the hosts n IP multicast n Application level multicast.
Reliability on Web Services Presented by Pat Chan 17/10/2005.
Middleware based Data Replication providing Snapshot Isolation Yi Lin Bettina Kemme Marta Patiño-Martínez Ricardo Jiménez-Peris June 15, 2005.
I.1 Distributed Systems Prof. Dr. Alexander Schill Dresden Technical University Computer Networks Dept.
Distributed Systems Fall 2010 Replication Fall 20105DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Replicating Basic Components Bettina Kemme McGill University, Montreal, Canada.
Prepared by: Mudra Patel (113) Locking Scheduler & Managing Hierarchies of Database Elements.
Network Operating Systems Users are aware of multiplicity of machines. Access to resources of various machines is done explicitly by: –Logging into the.
Database Replication techniques: a Three Parameter Classification Authors : Database Replication techniques: a Three Parameter Classification Authors :
Internet Networking Spring 2006 Tutorial 12 Web Caching Protocols ICP, CARP.
Group Communications Group communication: one source process sending a message to a group of processes: Destination is a group rather than a single process.
CMPT 431 Dr. Alexandra Fedorova Lecture XII: Replication.
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #13 Web Caching Protocols ICP, CARP.
Understanding Replication in Database & Distributed Systems SRDS’ Database Replication Techniques: A Three Parameter Classification M. Wiesmann F.
OSD Metadata Management
Self Healing Wide Area Network Services Bhavjit S Walha Ganesh Venkatesh.
EEC-681/781 Distributed Computing Systems Lecture 3 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University
Distributed Systems Fall 2009 Replication Fall 20095DV0203 Outline Group communication Fault-tolerant services –Passive and active replication Highly.
Distributed Systems 2006 Virtual Synchrony* *With material adapted from Ken Birman.
16: Distributed Systems1 DISTRIBUTED SYSTEM STRUCTURES NETWORK OPERATING SYSTEMS The users are aware of the physical structure of the network. Each site.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture XII: Replication.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
SQL Server Replication By Karthick P.K Technical Lead, Microsoft SQL Server.
Study of the Relationship between Peer to Peer Systems and IP Multicasting From IEEE Communication Magazine January 2003 學號 :M 姓名 : 邱 秀 純.
1 Distributed and Parallel Databases. 2 Distributed Databases Distributed Systems goal: –to offer local DB autonomy at geographically distributed locations.
Concurrency Control in Distributed Databases. By :- Rishikesh Mandvikar rmandvik[at]engr.smu.edu May 1, 2004.
1 CMPT 471 Networking II DHCP Failover and multiple servers © Janice Regan,
Replication and Consistency. Reference The Dangers of Replication and a Solution, Jim Gray, Pat Helland, Patrick O'Neil, and Dennis Shasha. In Proceedings.
CORE 2: Information systems and Databases CENTRALISED AND DISTRIBUTED DATABASES.
ECE291 Computer Engineering II Lecture 23 Dr. Zbigniew Kalbarczyk University of Illinois at Urbana- Champaign.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Mutual Exclusion Steve Ko Computer Sciences and Engineering University at Buffalo.
Massively Distributed Database Systems - Distributed DBS Spring 2014 Ki-Joune Li Pusan National University.
Reliable Communication in the Presence of Failures Based on the paper by: Kenneth Birman and Thomas A. Joseph Cesar Talledo COEN 317 Fall 05.
Consistent and Efficient Database Replication based on Group Communication Bettina Kemme School of Computer Science McGill University, Montreal.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Practical Byzantine Fault Tolerance
Lamport’s Logical Clocks & Totally Ordered Multicasting.
Oracle's Distributed Database Bora Yasa. Definition A Distributed Database is a set of databases stored on multiple computers at different locations and.
Applying Database Replication to Multi-player Online Games Yi Lin Bettina Kemme Marta Patiño-Martínez Ricardo Jiménez-Peris Oct 30, 2006.
CS338Parallel and Distributed Databases11-1 Parallel and Distributed Databases Lecture Topics Multi-CPU and distributed systems Monolithic system Client–server.
Replication (1). Topics r Why Replication? r System Model r Consistency Models – How do we reason about the consistency of the “global state”? m Data-centric.
Database Replication in WAN Yi Lin Supervised by: Prof. Kemme April 8, 2005.
Replication (1). Topics r Why Replication? r System Model r Consistency Models r One approach to consistency management and dealing with failures.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
Distributed Transaction Management, Fall 2002Lecture 2 / Distributed Locking Jyrki Nummenmaa
Chapter 4 Wenbing Zhao Department of Electrical and Computer Engineering Cleveland State University Building Dependable Distributed Systems.
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT By Jyothsna Natarajan Instructor: Prof. Yanqing Zhang Course: Advanced Operating Systems.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
Logical Clocks. Topics r Logical clocks r Totally-Ordered Multicasting.
Lecture 12-1 Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2012 Indranil Gupta (Indy) October 4, 2012 Lecture 12 Mutual Exclusion.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
Chapter pages1 Distributed Process Management Chapter 14.
I propose a VOIP based meal booking system that user’s can make use of for making meal bookings on campus or for a n enterprise offering catering services.
Topics in Distributed Databases Database System Implementation CSE 507 Some slides adapted from Navathe et. Al and Silberchatz et. Al.
System Models Advanced Operating Systems Nael Abu-halaweh.
Don’t be lazy, be consistent: Postgres-R, A new way to implement Database Replication Paper by Bettina Kemme and Gustavo Alonso, VLDB 2000 Presentation.
Reliable multicast Tolerates process crashes. The additional requirements are: Only correct processes will receive multicasts from all correct processes.
Navigating the options for Data Redundancy
Ganymed: Scalable Replication for Transactional Web Applications
Chapter 7: Consistency & Replication IV - REPLICATION MANAGEMENT -Sumanth Kandagatla Instructor: Prof. Yanqing Zhang Advanced Operating Systems (CSC 8320)
Consistent Data Replication: Is it feasible in WANs?
Ch 6. Summary Gang Shen.
Presentation transcript:

Database Replication in WAN Yi Lin McGill University Distributed Information Systems

What? Why? How? …… Montreal TorontoOttawa Toronto Montreal Ottawa Without ReplicationWith Replication Benefits: Performance, Scalability, Failover How?

How? Replication Protocols based on Group Communication Group Communication: Each group member can multicast messages to all members which will receive the messages in specified order such as –FIFO: messages of one sender are received in the order as they were sent. –TOTAL: if two members receive messages m1 and m2, both receive them in the same order. FIFO m1 m2 m1 m2 FIFO, not TOTAL m1 m2 m1 m2 m3 FIFO, TOTAL m1 m2 m1 m2 m3

Existing Replication Protocol for LAN Basic idea: –1. Upon receiving a read request from the client, submit it to execute immediately –2. Upon receiving a update request from the client: multicast the request to all sites in TOTAL order –3. Upon receiving an update request in TOTAL order: put the necessary lock requests in a locktable. –4. submit the transactions for execution once locks are granted

Example: 2 txns accessing X in 2 sites T2 Resp T1T2 T1 Resp X: T1 Locktable X: T1, T2 X:T2 multicast in TOTAL order Site ASite B X: T1 X: T1, T2 X:T2

Replication Protocol Variations T2 Resp T1 T2 T1 exe T2 exe T1 Resp Apply ws1 Apply ws2T2 Resp (a) Symmetric(b) Primary copy(c) Local copy Def Each site executes entire transactions Txn is executed in master site and its writeset is multicast to other sites to be applied Txn is executed in local submitted site and its writeset is multicast to other sites to be applied Pro s Simple, 1 msg/txnCPU lightweight, Load balance, Deterministic Fast local response with large data Con s CPU costly. Cann’t nonDeterministic 2 msg/txn, wait for its own writeset from primary 2 msg/txn, might need to wait for remote writesets T1 T2 T1 exe T2 exeApply ws1 Apply ws2 T1 T2 T1 exe T2 exe T2 Resp

Lesson 1 learned from experiments in Planetlab(WAN) Message delivery time accounts for 70-80% of txn response time whereas execution time only 5-10% Solution: a. Symmetric protocol preferred in WAN b. Propose a fast TOTAL order algorithm (Local Token) Msg delivery time Txn Exe time Waiting in locktable time Resp time

LAN prefers primary copy WAN prefers Symmetric LANWAN Resp Time Primary copy <local copy <symmetric Symmetric<local copy < primary copy Reasons1.Applying write set(e.g 10ms) is faster than executing the whole txn(e.g. 15ms). 2.Msg delivery time in LAN is very fast(e.g. 3-4 ms). Main part of response time is attributed to execution time. 3.Primary copy is good in load balancing 1.Msg delivery time(e.g. 100ms) in WAN is very slow comparing to execution time (e.g. 15ms). 2.Symmetric approach only requires one msg delay within txn boundary 3.Primary copy has up to two msgs delay within txn boundary. 4.If with no conflict to remote txns local copy has only 1 msg delay.

Local Token TOTAL order In each site there is one FIFO queue for one sender. All queues compose a ring (same ring configuration in each site). At any time one queue has a token. Upon receiving msg, append it in the corresponding queue. Upon holding token, deliver first msg (blocked if no msg) and pass the token to the next queue. Comparing Local Token with other TOTAL order algorithm (4 planetlab sites )

Lesson 2 learned from experiments Locking granularity in locktable has significant influence on performance. Table Level locking –In middleware level, since tuples to be accessed by txns are possibly unknown (if primary key is not provided), the reasonable locking mechanism is locking the tables to be accessed. Solution: –Optimistic delivery –Pseudo-tuple level locking

Optimistic Delivery In WAN a msg may be physically received much earlier than when its TOTAL order is determined. We can optimistically start execution (appending txn to locktable) upon receiving the msg instead of upon msg’s TOTAL order is determined. However txn will not be committed until its TOTAL order is determined. If there is no difference between optimistic delivery and TOTAL order delivery, or mismatch happens with non-conflicting txns, execution overlaps with determining the TOTAL order. Otherwise, txn is aborted and rollbacked. Total Order Txn Execution Response Time Time Total Order Optimistic Txn Execution Response Time (a)Regular delivery Optimistic-delivery TOTAL-delivery (b) With Optimistic delivery

Pseudo-Tuple Level locking DBMS serializable isolation level provides: T1 T2 x If two concurrent txns access the same data, the later txn will be blocked by the first txn and aborted upon the first txn’s commit. Table-level locking may lead to unnecessary blocking. We can take advantage of serializable isolation level to detect if two txns conflict at tuple level by optimistically applying both txns and checking if second txn will be blocked by the previous txn. This approach in conjunction with optimistic delivery may be able to detect tuple level conflict before txn TOTAL order is determined. x Executed blocked T1 commits T2 abort time