Download presentation
Presentation is loading. Please wait.
Published byLauryn Glaspell Modified over 9 years ago
1
Implementing A Simple Storage Case Consider a simple case for distributed storage – I want to back up files from machine A on machine B Avoids many tricky issues – Multiple nodes – Multiple writers – Most synchronization How might I design such a system? 1
2
Distributed Backup Keeping it simple, there’s only one live machine – Machine A And one machine holding the backups – Machine B Periodically I want to back up A’s files on B Occasionally I want to fetch a backed up file from B to A 2
3
Illustrating the Situation 3 Machine A Machine B We want to copy files from A to B on command Preferably only files not yet on B (or files that have changed) Stored on B in a way that will make it possible to recover them
4
Basic Approach Separate processes run on A and B B runs a server process – Always active – Waiting for requests from A A runs a process on demand – When the user wants to perform backup A’s process contacts B’s to tell it what to do 4
5
The Process On A (Backing Up) Needs to know what should be backed up Three choices: 1.A stores information about what was already backed up 2.A asks B for information on what was already backed up 3.A sends B an inventory of what A has and B asks for what it needs Which is best? 5
6
Illustrating the Choices for A 6 1. A keeps an inventory 2. A asks B 2. A tells B what he’s got ?
7
The Process on B (Backing Up) Server process waiting for A to contact it – Or should it be pro-active... ? Assuming A knows what is to be backed up, Should A send B an inventory of what’s coming? Or should A simply feed files to B, one by one? 7
8
Illustrating The Choices 8 foo bar foobar... fo o bar 1. Ship an inventory first 2. Just send the files foo bar foobar... fo o bar
9
Backing Up One File A decides file foo needs to be backed up Does he: 1.Send all of file foo at once? 2.Figure out what’s changed in file foo since he last backed it up and only send the diffs? In the second case, how does A know what to do? – And how does he tell it to B? 9
10
Sending the Entire File Assuming A is going to send the entire file, does he: 1.Send a message telling B what he’s going to do (e.g., name of file, length of file, etc.) and wait for B to say “OK” 2.Just start sending pieces of the file (maybe with control info in the first message?) Should A use TCP or UDP? Can B ask for flow control? 10
11
Sending Multiple Files Should A send all of file foo before sending file bar? – When does he start sending bar? 1.After the last part of foo is sent? 2.After B tells him foo is taken care of? Or start sending multiple files off at once? – All in parallel? – Some number >1 but less than all? 11
12
Handling An Incoming File on B File foo starts arriving on B What does B do? – Buffer all the data of foo till he has a complete file? – Write the contents of each incoming message to the appropriate place in the file on disk? – Fill a fixed size buffer up, then write it to disk? 12
13
How Does B Handle Multiple File Transfers? What is used to indicate to B that file foo is done and file bar is coming? Does B confirm handling of an entire file to A? – Even if A is using TCP? If multiple files are moving at once, how does B tell which part belongs to which file? Can B request that A slow down? 13
14
What Records Does B Keep? Nothing but the files themselves? The files plus an inventory of what he’s got? A transcript of a backup session? – If so, how many kept and for how long? 14
15
How About Failures? What happens if B fails during backup? – During the setup phase? – During transfer of one/multiple files? What happens if A fails during backup? – During setup phase? – While transferring files? In either case, what happens on recovery? 15
16
Restoring Files Does A ask for restore of full set of files? Or for selected files? How does A know what is backed up on B? – Does A keep records? – Does he ask B for an inventory? How does A handle moving an individual file? – Akin to the questions about B receiving it 16
17
Restoration From B’s Side Just on a per-file basis? – I.e., A asks for what he wants and B provides it Or some big “whole set” backup? – Done one file at a time or in parallel? Does A provide flow control information to B? Does B keep records about restorations? 17
18
Failures During Restoration What if A fails in the middle of a restore operation? What happens to files being restored at time of failure? What if B fails in the middle of a restore operation? – What’s different than the actions taken on A’s failure? What happens on recovery? – Complete restart or from where the failure occurred? 18
19
Extending the System What if B is a backup machine servicing several other machines? How does B’s software differ? Do the machines B services run the same software as before? Or does their client software need to be altered? 19
20
Going From Here We will start talking about these design questions in class Think about what you consider the best answers to each Be prepared to suggest alternatives and discuss why to use them Concentrate on distributed systems aspects – But some local issues may impact the distributed issues 20
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.