Distributed System: Definition

Similar documents
Distributed Systems Principles and Paradigms

Distributed Systems Principles and Paradigms. Chapter 12: Distributed Web-Based Systems

Distributed Systems Principles and Paradigms. Chapter 01: Introduction. Contents. Distributed System: Definition.

Distributed Systems Principles and Paradigms. Chapter 01: Introduction

Distributed Systems Principles and Paradigms

CA464 Distributed Programming

Distributed Systems Principles and Paradigms. Chapter 07: Consistency & Replication

殷亚凤. Processes. Distributed Systems [3]

Distributed Systems. Overview. Distributed Systems September A distributed system is a piece of software that ensures that:

Part 12 殷亚凤. Homepage: Room 301, Building of Computer Science and Technology

Introduction. Distributed Systems IT332

New Topic: Naming. Differences in naming in distributed and non-distributed systems. How to name mobile entities?

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 1. Introduction

Computing Parable. New Topic: Naming

殷亚凤. Naming. Distributed Systems [5]

Naming. Chapter 4. Naming (1) Name resolution allows a process to access a named entity. A naming system is necessary.

New Topic: Naming. Approaches

Distributed Naming. EECS 591 Farnam Jahanian University of Michigan. Reading List

Lecture 4 Naming. Prof. Wilson Rivera. University of Puerto Rico at Mayaguez Electrical and Computer Engineering Department

Last Class: RPCs and RMI. Today: Communication Issues

Today: Naming. Example: File Names

Naming. Naming entities

Distributed Systems. Edited by. Ghada Ahmed, PhD. Fall (3rd Edition) Maarten van Steen and Tanenbaum

Advanced Distributed Systems

Distributed Systems Principles and Paradigms

Replica Placement. Replica Placement

Naming. To do. q What s in a name q Flat naming q Structured naming q Attribute-based naming q Next: Content distribution networks

Naming. Distributed Systems IT332

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 1. Introduction

Distributed Systems. Chapter 1: Introduction

The Design and Implementation of a Next Generation Name Service for the Internet (CoDoNS) Presented By: Kamalakar Kambhatla

Traditional Web Based Systems

Distributed Systems. Edited by. Ghada Ahmed, PhD. Fall (3rd Edition) Maarten van Steen and Tanenbaum

CSE 5306 Distributed Systems. Naming

Systèmes Distribués. Master MIAGE 1. Andrea G. B. Tettamanzi. Université de Nice Sophia Antipolis Département Informatique

[Prof. Rupesh G Vaishnav] Page 1

Consistency and Replication (part b)

Consistency & Replication

CSE 5306 Distributed Systems

CS155b: E-Commerce. Lecture 3: Jan 16, How Does the Internet Work? Acknowledgements: S. Bradner and R. Wang

Announcements. me your survey: See the Announcements page. Today. Reading. Take a break around 10:15am. Ack: Some figures are from Coulouris

Send me up to 5 good questions in your opinion, I ll use top ones Via direct message at slack. Can be a group effort. Try to add some explanation.

Lecture 6 Consistency and Replication

Distributed Object-Based Systems The WWW Architecture Web Services Handout 11 Part(a) EECS 591 Farnam Jahanian University of Michigan.

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 3 Processes

DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S. TANENBAUM MAARTEN VAN STEEN. Chapter 5 Naming

Venugopal Ramasubramanian Emin Gün Sirer SIGCOMM 04

Assignment 5. Georgia Koloniari

CS454/654 Midterm Exam Fall 2004

Parallelism. Master 1 International. Andrea G. B. Tettamanzi. Université de Nice Sophia Antipolis Département Informatique

Networking and Internetworking 1

Computer Network 1 1

Verteilte Systeme (Distributed Systems)

Distributed Systems LEEC (2006/07 2º Sem.)

Session 2. Background. Lecture Objectives

Consistency and Replication

02 - Distributed Systems

02 - Distributed Systems

CS 403/534 Distributed Systems Midterm April 29, 2004

DISTRIBUTED SYSTEMS. Second Edition. Andrew S. Tanenbaum Maarten Van Steen. Vrije Universiteit Amsterdam, 7'he Netherlands PEARSON.

Web Programming Paper Solution (Chapter wise)

Chapter 1: Distributed Systems: What is a distributed system? Fall 2013

DISTRIBUTED COMPUTER SYSTEMS ARCHITECTURES

Distributed Systems. Lecture 4 Othon Michail COMP 212 1/27

EEC-682/782 Computer Networks I

Outline. Distributed Computing Systems. The Rise of Distributed Systems. Depiction of a Distributed System 4/15/2014

Lecture 9: MIMD Architectures

Chapter 5 Naming (2)

CONSISTENCY IN DISTRIBUTED SYSTEMS

Naming. Naming. Naming versus Locating Entities. Flat Name-to-Address in a LAN

Outline. Definition of a Distributed System Goals of a Distributed System Types of Distributed Systems

CS4513 Distributed Computer Systems

Today: World Wide Web! Traditional Web-Based Systems!

Distributed Information Processing

Information Network Systems The application layer. Stephan Sigg

Consistency and Replication. Some slides are from Prof. Jalal Y. Kawash at Univ. of Calgary

Lecture 7: February 10

Chapter 3: Naming Page 38. Clients in most cases find the Jini lookup services in their scope by IP

Outline Applications. Central Server Hierarchical Peer-to-peer. 31-Jan-02 Ubiquitous Computing 1

Cloud Computing CS

Networks, WWW, HTTP. Web Technologies I. Zsolt Tóth. University of Miskolc. Zsolt Tóth (University of Miskolc) Networks, WWW, HTTP / 35

CS 716: Introduction to communication networks th class; 11 th Nov Instructor: Sridhar Iyer IIT Bombay

INTRODUCTION TO Object Oriented Systems BHUSHAN JADHAV

0 0& Basic Background. Now let s get into how things really work!

CHAPTER 7 WEB SERVERS AND WEB BROWSERS

UNIT III. cache/replicas maintenance Main memory No No No 1 RAM File system n No Yes No 1 UNIX file system Distributed file

Lecture 1: January 23

Flash: an efficient and portable web server

Web as a Distributed System

Middleware. Adapted from Alonso, Casati, Kuno, Machiraju Web Services Springer 2004

Chapter 18: Database System Architectures.! Centralized Systems! Client--Server Systems! Parallel Systems! Distributed Systems!

Review for Internet Introduction

EECS 122: Introduction to Computer Networks DNS and WWW. Internet Names & Addresses

Introduction to Peer-to-Peer Systems

LECTURE 3: CONCURRENT & DISTRIBUTED ARCHITECTURES

Chapter Outline. Chapter 2 Distributed Information Systems Architecture. Layers of an information system. Design strategies.

Multi-Channel Clustered Web Application Servers

Application Layer: OSI and TCP/IP Models

CS514: Intermediate Course in Computer Systems

HTRC Data API Performance Study

Transcription:

2 / 25 Introduction Distributed System: Definition Definition A distributed system is a piece of software that ensures that: a collection of independent computers appears to its users as a single coherent system Two aspects: (1) independent computers and (2) single system middleware. Computer 1 Computer 2 Computer 3 Computer 4 Appl. A Application B Appl. C Distributed system layer (middleware) Local OS 1 Local OS 2 Local OS 3 Local OS 4 Network

Introduction Goals 8 / 25 Scale in Distributed Systems Observation Many developers of modern distributed system easily use the adjective scalable without making clear why their system actually scales. Scalability At least three components: Number of users and/or processes (size scalability) Maximum distance between nodes (geographical scalability) Number of administrative domains (administrative scalability) Observation Most systems account only, to a certain extent, for size scalability. The (non)solution: powerful servers. Today, the challenge lies in geographical and administrative scalability.

Introduction Goals 8 / 25 Scale in Distributed Systems Observation Many developers of modern distributed system easily use the adjective scalable without making clear why their system actually scales. Scalability At least three components: Number of users and/or processes (size scalability) Maximum distance between nodes (geographical scalability) Number of administrative domains (administrative scalability) Observation Most systems account only, to a certain extent, for size scalability. The (non)solution: powerful servers. Today, the challenge lies in geographical and administrative scalability.

Introduction Goals 8 / 25 Scale in Distributed Systems Observation Many developers of modern distributed system easily use the adjective scalable without making clear why their system actually scales. Scalability At least three components: Number of users and/or processes (size scalability) Maximum distance between nodes (geographical scalability) Number of administrative domains (administrative scalability) Observation Most systems account only, to a certain extent, for size scalability. The (non)solution: powerful servers. Today, the challenge lies in geographical and administrative scalability.

Introduction Goals Techniques for Scaling Distribution Partition data and computations across multiple machines: Move computations to clients (Java applets) Decentralized naming services (DNS) Decentralized information systems (WWW) 10 / 25

Introduction Goals 11 / 25 Techniques for Scaling Replication/caching Make copies of data available at different machines: Replicated file servers and databases Mirrored Web sites Web caches (in browsers and proxies) File caching (at server and client)

Introduction Goals Scaling The Problem Observation Applying scaling techniques is easy, except for one thing: Having multiple copies (cached or replicated), leads to inconsistencies: modifying one copy makes that copy different from the rest. Always keeping copies consistent and in a general way requires global synchronization on each modification. Global synchronization precludes large-scale solutions. Observation If we can tolerate inconsistencies, we may reduce the need for global synchronization, but tolerating inconsistencies is application dependent. 12 / 25

Introduction Goals Scaling The Problem Observation Applying scaling techniques is easy, except for one thing: Having multiple copies (cached or replicated), leads to inconsistencies: modifying one copy makes that copy different from the rest. Always keeping copies consistent and in a general way requires global synchronization on each modification. Global synchronization precludes large-scale solutions. Observation If we can tolerate inconsistencies, we may reduce the need for global synchronization, but tolerating inconsistencies is application dependent. 12 / 25

Introduction Goals Scaling The Problem Observation Applying scaling techniques is easy, except for one thing: Having multiple copies (cached or replicated), leads to inconsistencies: modifying one copy makes that copy different from the rest. Always keeping copies consistent and in a general way requires global synchronization on each modification. Global synchronization precludes large-scale solutions. Observation If we can tolerate inconsistencies, we may reduce the need for global synchronization, but tolerating inconsistencies is application dependent. 12 / 25

Introduction Goals Scaling The Problem Observation Applying scaling techniques is easy, except for one thing: Having multiple copies (cached or replicated), leads to inconsistencies: modifying one copy makes that copy different from the rest. Always keeping copies consistent and in a general way requires global synchronization on each modification. Global synchronization precludes large-scale solutions. Observation If we can tolerate inconsistencies, we may reduce the need for global synchronization, but tolerating inconsistencies is application dependent. 12 / 25

Introduction Goals Scaling The Problem Observation Applying scaling techniques is easy, except for one thing: Having multiple copies (cached or replicated), leads to inconsistencies: modifying one copy makes that copy different from the rest. Always keeping copies consistent and in a general way requires global synchronization on each modification. Global synchronization precludes large-scale solutions. Observation If we can tolerate inconsistencies, we may reduce the need for global synchronization, but tolerating inconsistencies is application dependent. 12 / 25

Architectures Architectural styles 2 / 25 Architectural styles Basic idea Organize into logically different components, and distribute those components over the various machines. Layer N Object Object Request flow Layer N-1 Response flow Object Method call Layer 2 Layer 1 Object Object (a) (b) (a) Layered style is used for client-server system (b) Object-based style for distributed object systems.

Architectures System Architectures Centralized Architectures Basic Client Server Model Characteristics: There are processes offering services (servers) There are processes that use services (clients) Clients and servers can be on different machines Clients follow request/reply model wrt to using services Client Wait for result Request Reply Server Provide service Time 4 / 25

Architectures System Architectures Application Layering Traditional three-layered view User-interface layer contains units for an application s user interface Processing layer contains the functions of an application, i.e. without specific data Data layer contains the data that a client wants to manipulate through the application components Observation This layering is found in many distributed information systems, using traditional database technology and accompanying applications. 5 / 25

Architectures System Architectures Application Layering Traditional three-layered view User-interface layer contains units for an application s user interface Processing layer contains the functions of an application, i.e. without specific data Data layer contains the data that a client wants to manipulate through the application components Observation This layering is found in many distributed information systems, using traditional database technology and accompanying applications. 5 / 25

6 / 25 Application Layering Architectures System Architectures User interface User-interface level Keyword expression Query generator Database queries Database with Web pages HTML page containing list HTML generator Ranking algorithm Ranked list of page titles Web page titles with meta-information Processing level Data level

7 / 25 Architectures Multi-Tiered Architectures System Architectures Single-tiered: dumb terminal/mainframe configuration Two-tiered: client/single server configuration Three-tiered: each layer on separate machine Traditional two-tiered configurations: Client machine User interface User interface User interface Application User interface Application User interface Application Database User interface Application Application Application Database Database Database Database Database Server machine (a) (b) (c) (d) (e)

9 / 33 Virtualization Processes Virtualizaton Observation Virtualization is becoming increasingly important: Hardware changes faster than software Ease of portability and code migration Isolation of failing or attacked components Program Program Interface A Hardware/software system A Interface A Implementation of mimicking A on B Interface B Hardware/software system B (a) (b)

Processes Virtualizaton Architecture of VMs Observation Virtualization can take place at very different levels, strongly depending on the interfaces as offered by various systems components: Library functions System calls Privileged instructions Application Library Operating system Hardware General instructions 10 / 33

11 / 33 Processes Virtualizaton Process VMs versus VM Monitors Application Runtime system Runtime system Runtime system Applications Operating system Operating system Operating system Operating system Virtual machine monitor Hardware (a) Hardware (b) Process VM: A program is compiled to intermediate (portable) code, which is then executed by a runtime system (Example: Java VM). VM Monitor: A separate software layer mimics the instruction set of hardware a complete operating system and its applications can be supported (Example: VMware, VirtualBox).

Architectures System Architectures 17 / 25 Hybrid Architectures: Client-server combined with P2P Example Edge-server architectures, which are often used for Content Delivery Networks Client Content provider ISP ISP Core Internet Edge server Enterprise network

Distributed Web-Based Systems Architecture 1 / 71 Distributed Web-based systems Essence The WWW is a huge client-server system with millions of servers; each server hosting thousands of hyperlinked documents. Documents are often represented in text (plain text, HTML, XML) Alternative types: images, audio, video, applications (PDF, PS) Documents may contain scripts, executed by client-side software Client machine Browser Server machine Web server 2. Server fetches document from local file OS 3. Response 1. Get document request (HTTP)

Distributed Web-Based Systems Architecture Multi-tiered architectures Observation Web sites were soon organised into three tiers. 3. Start process to fetch document 1. Get request 6. Return result HTTP request handler CGI program 4. Database interaction 5. HTML document created Web server CGI process Database server 2 / 71

Distributed Web-Based Systems Processes Clients: Web browsers Observation Browsers form the Web s most important client-side sofware. They used to be simple, but that is long ago. User interface Browser engine Display back end Rendering engine Network comm. Client-side script interpreter HTML/XML parser 3 / 71

Distributed Web-Based Systems Apache Web server Processes Observation: More than 52% of all 185 million Web sites are Apache. The server is internally organised more or less according to the steps needed to process an HTTP request. Module Module Function Module......... Hook Hook Hook Hook Link between function and hook Functions called per hook Apache core Request Response 4 / 71

Processes Threads 6 / 33 Threads and Distributed Systems Multithreaded Web client Hiding network latencies: Web browser scans an incoming HTML page, and finds that more files need to be fetched. Each file is fetched by a separate thread, each doing a (blocking) HTTP request. As files come in, the browser displays them. Multiple request-response calls to other machines (RPC) A client does several calls at the same time, each one by a different thread. It then waits until all results have been returned. Note: if calls are to different servers, we may have a linear speed-up.

Processes Threads Threads and Distributed Systems Multithreaded Servers Although there are important benefits to multithreaded clients, the main benefits of multithreading in distributed systems are on the server side. 7 / 33

Processes Threads 8 / 33 Threads and Distributed Systems Improve performance Starting a thread is much cheaper than starting a new process. Having a single-threaded server prohibits simple scale-up to a multiprocessor system. As with clients: hide network latency by reacting to next request while previous one is being replied. Better structure Most servers have high I/O demands. Using simple, well-understood blocking calls simplifies the overall structure. Multithreaded programs tend to be smaller and easier to understand due to simplified flow of control.

Distributed Web-Based Systems Processes 5 / 71 Server clusters Essence To improve performance and availability, WWW servers are often clustered in a way that is transparent to clients. Web server Web server Web server Web server LAN Front end Front end handles all incoming requests and outgoing responses Request Response

Processes Servers Server clusters: three different tiers Logical switch (possibly multiple) Application/compute servers Distributed file/database system Client requests Dispatched request First tier Second tier Third tier Crucial element The first tier is generally responsible for passing requests to an appropriate server. 22 / 33

Distributed Web-Based Systems Processes Server clusters Problem The front end may easily get overloaded, so that special measures need to be taken. Transport-layer switching: Front end simply passes the TCP request to one of the servers, taking some performance metric into account. Content-aware distribution: Front end reads the content of the HTTP request and then selects the best server. 6 / 71

Processes Servers Request Handling Observation Having the first tier handle all communication from/to the cluster may lead to a bottleneck. Solution Various, but one popular one is TCP-handoff Logically a single TCP connection Response Server Client Request Switch Request (handed off) Server 23 / 33

7 / 71 Server Clusters Distributed Web-Based Systems Processes Question Why can content-aware distribution be so much better? 6. Server responses 5. Forward other messages Web server Distributor 3. Hand of TCP connection f Client Other messages Setup request Switch 1. Pass setup request to a distributor 4. Inform switch Distributor Web server Dispatcher 2. Dispatcher selects server

1 / 37 Naming Entities Naming Naming Entities Names, identifiers, and addresses Name resolution Name space implementation

Naming Naming Entities Naming Essence Names are used to denote entities in a distributed system. To operate on an entity, we need to access it at an access point. Access points are entities that are named by means of an address. Note A location-independent name for an entity E, is independent from the addresses of the access points offered by E. 2 / 37

Naming Naming Entities Identifiers Pure name A name that has no meaning at all; it is just a random string. Pure names can be used for comparison only. Identifier A name having the following properties: P1: Each identifier refers to at most one entity P2: Each entity is referred to by at most one identifier P3: An identifier always refers to the same entity (prohibits reusing an identifier) Observation An identifier need not necessarily be a pure name, i.e., it may have content. 3 / 37

Naming Flat Naming Hierarchical Location Services (HLS) Basic idea Build a large-scale search tree for which the underlying network is divided into hierarchical domains. Each domain is represented by a separate directory node. The root directory node dir(t) Top-level domain T Directory node dir(s) of domain S A subdomain S of top-level domain T (S is contained in T) A leaf domain, contained in S 13 / 37

Naming Structured Naming 19 / 37 Name resolution Problem To resolve a name we need a directory node. How do we actually find that (initial) node? Closure mechanism The mechanism to select the implicit context from which to start name resolution: www.cs.vu.nl: start at a DNS name server /home/steen/mbox: start at the local NFS file server (possible recursive search) Question 0031204447784: dial a phone number 130.37.24.8: route to the VU s Web server Why are closure mechanisms always implicit?

Naming Structured Naming 19 / 37 Name resolution Problem To resolve a name we need a directory node. How do we actually find that (initial) node? Closure mechanism The mechanism to select the implicit context from which to start name resolution: www.cs.vu.nl: start at a DNS name server /home/steen/mbox: start at the local NFS file server (possible recursive search) Question 0031204447784: dial a phone number 130.37.24.8: route to the VU s Web server Why are closure mechanisms always implicit?

Naming Structured Naming 19 / 37 Name resolution Problem To resolve a name we need a directory node. How do we actually find that (initial) node? Closure mechanism The mechanism to select the implicit context from which to start name resolution: www.cs.vu.nl: start at a DNS name server /home/steen/mbox: start at the local NFS file server (possible recursive search) Question 0031204447784: dial a phone number 130.37.24.8: route to the VU s Web server Why are closure mechanisms always implicit?

Naming Structured Naming Name linking Hard link What we have described so far as a path name: a name that is resolved by following a specific path in a naming graph from one node to another. 20 / 37

Naming Structured Naming 23 / 37 Name-space implementation Basic issue Distribute the name resolution process as well as name space management across multiple machines, by distributing nodes of the naming graph. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers.

Naming Structured Naming 23 / 37 Name-space implementation Basic issue Distribute the name resolution process as well as name space management across multiple machines, by distributing nodes of the naming graph. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers.

Naming Structured Naming 23 / 37 Name-space implementation Basic issue Distribute the name resolution process as well as name space management across multiple machines, by distributing nodes of the naming graph. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers.

Naming Structured Naming 23 / 37 Name-space implementation Basic issue Distribute the name resolution process as well as name space management across multiple machines, by distributing nodes of the naming graph. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers.

Naming Structured Naming 23 / 37 Name-space implementation Basic issue Distribute the name resolution process as well as name space management across multiple machines, by distributing nodes of the naming graph. Distinguish three levels Global level: Consists of the high-level directory nodes. Main aspect is that these directory nodes have to be jointly managed by different administrations Administrational level: Contains mid-level directory nodes that can be grouped in such a way that each group can be assigned to a separate administration. Managerial level: Consists of low-level directory nodes within a single administration. Main issue is effectively mapping directory nodes to local name servers.

Naming Structured Naming Name-space implementation org net jp us nl sun eng yale eng ai linda robot acm jack jill ieee keio cs cs pc24 co nec csl oce vu cs ftp www ac com edu gov mil pub globe index.txt Managerial layer Administrational layer Global layer Zone 24 / 37

25 / 37 Naming Name-space implementation Structured Naming Item Global Administrational Managerial 1 Worldwide Organization Department 2 Few Many Vast numbers 3 Seconds Milliseconds Immediate 4 Lazy Immediate Immediate 5 Many None or few None 6 Yes Yes Sometimes 1: Geographical scale 4: Update propagation 2: # Nodes 5: # Replicas 3: Responsiveness 6: Client-side caching?

34 / 37 Replication of records Naming Structured Naming Definition Replicated at level i record is replicated to all nodes with i matching prefixes. Note: # hops for looking up record at level i is generally i. Observation Let x i denote the fraction of most popular DNS names of which the records should be replicated at level i, then: [ d i (logn C) x i = 1 + d + + d logn 1 ] 1/(1 α) with N is the total number of nodes, d = b (1 α)/α and α 1, assuming that popularity follows a Zipf distribution: The frequency of the n-th ranked item is proportional to 1/n α

Naming Structured Naming 35 / 37 Replication of records Meaning If you want to reach an average of C = 1 hops when looking up a DNS record, then with b = 4, α = 0.9, N = 10,000 and 1,000,000 records that 61 most popular records should be replicated at level 0 284 next most popular records at level 1 1323 next most popular records at level 2 6177 next most popular records at level 3 28826 next most popular records at level 4 134505 next most popular records at level 5 the rest should not be replicated

Consistency & Replication Client-Centric Consistency Models 12 / 40 Consistency for mobile users Example Consider a distributed database to which you have access through your notebook. Assume your notebook acts as a front end to the database. At location A you access the database doing reads and updates. At location B you continue your work, but unless you access the same server as the one at location A, you may detect inconsistencies: your updates at A may not have yet been propagated to B you may be reading newer entries than the ones available at A your updates at B may eventually conflict with those at A

Consistency & Replication Client-Centric Consistency Models Consistency for mobile users Note The only thing you really want is that the entries you updated and/or read at A, are in B the way you left them in A. In that case, the database will appear to be consistent to you. 13 / 40

14 / 40 Basic architecture Consistency & Replication Client-Centric Consistency Models Client moves to other location and (transparently) connects to other replica Replicas need to maintain client-centric consistency Wide-area network Portable computer Read and write operations Distributed and replicated database

22 / 40 Consistency & Replication Distribution protocols Replica Management Replica server placement Content replication and placement Content distribution

Consistency & Replication Replica Management Replica placement Essence Figure out what the best K places are out of N possible locations. Select best location out of N K for which the average distance to clients is minimal. Then choose the next best server. (Note: The first chosen location minimizes the average distance to all clients.) Computationally expensive. Select the K -th largest autonomous system and place a server at the best-connected host. Computationally expensive. Position nodes in a d-dimensional geometric space, where distance reflects latency. Identify the K regions with highest density and place a server in every one. Computationally cheap. 23 / 40

Consistency & Replication Replica Management Replica placement Essence Figure out what the best K places are out of N possible locations. Select best location out of N K for which the average distance to clients is minimal. Then choose the next best server. (Note: The first chosen location minimizes the average distance to all clients.) Computationally expensive. Select the K -th largest autonomous system and place a server at the best-connected host. Computationally expensive. Position nodes in a d-dimensional geometric space, where distance reflects latency. Identify the K regions with highest density and place a server in every one. Computationally cheap. 23 / 40

Consistency & Replication Replica Management Replica placement Essence Figure out what the best K places are out of N possible locations. Select best location out of N K for which the average distance to clients is minimal. Then choose the next best server. (Note: The first chosen location minimizes the average distance to all clients.) Computationally expensive. Select the K -th largest autonomous system and place a server at the best-connected host. Computationally expensive. Position nodes in a d-dimensional geometric space, where distance reflects latency. Identify the K regions with highest density and place a server in every one. Computationally cheap. 23 / 40

Consistency & Replication Replica Management Replica placement Essence Figure out what the best K places are out of N possible locations. Select best location out of N K for which the average distance to clients is minimal. Then choose the next best server. (Note: The first chosen location minimizes the average distance to all clients.) Computationally expensive. Select the K -th largest autonomous system and place a server at the best-connected host. Computationally expensive. Position nodes in a d-dimensional geometric space, where distance reflects latency. Identify the K regions with highest density and place a server in every one. Computationally cheap. 23 / 40

Consistency & Replication Replica Management 24 / 40 Content replication Distinguish different processes A process is capable of hosting a replica of an object or data: Permanent replicas: Process/machine always having a replica Server-initiated replica: Process that can dynamically host a replica on request of another server in the data store Client-initiated replica: Process that can dynamically host a replica on request of a client (client cache)

25 / 40 Content replication Consistency & Replication Replica Management Server-initiated replication Client-initiated replication Permanent replicas Server-initiated replicas Client-initiated replicas Clients

26 / 40 Consistency & Replication Server-initiated replicas Replica Management Server without copy of file F C 2 Client P Q Server with copy of F C 1 File F Server Q counts access from C and C as if they would come from P 1 2 Keep track of access counts per file, aggregated by considering server closest to requesting clients Number of accesses drops below threshold D drop file Number of accesses exceeds threshold R replicate file Number of access between D and R migrate file

Consistency & Replication Replica Management Content distribution Model Consider only a client-server combination: Propagate only notification/invalidation of update (often used for caches) Transfer data from one copy to another (distributed databases) Propagate the update operation to other copies (also called active replication) Note No single approach is the best, but depends highly on available bandwidth and read-to-write ratio at replicas. 27 / 40