Aims and Objectives
Introduction
Distributed File System Design
Distributed File System Implementation
Example: Sun's Network File System
File Service: specification of what the file system offers its clients
File Server: process which run on one or more machines and helps implement the file service
System can have multiple file servers, offering different file services (e.g., UNIX and DOS)
Users shouldn't need to know the details of how a request for a file is handled and neither should they need to know that there are several file servers
The File Service Interface
Byte sequence vs. data structure
Attributes (owner, creation/modified date, size, permissions)
Immutable vs. mutable
Protection via Capabilities vs. Protection via Access Control Lists
Upload/download
Remote Access
The Directory Server Interface
Location Transparency
Location Independence
Symbolic Names vs. Binary Names
Looking up a symbolic name and getting a list of binary names - refers to original and all backups, copies, etc. - Provides fault tolerence
What happens when two users read/modify the same file simultaneously?
UNIX semantics - mimics single processor system
UNIX semantics can be achieved on distributed systems as long as files are not cached - but this results in a poor service
Alterative - write cached file modifications to server immediately. Inefficient (e.g., temporary files)
Session Sematics
Relax UNIX semantics. "Changes to an open file are visible only to the process that modified the file"
But what about a file that is modified by 2 or more processes? Which gets written last?
And what about another process that attempts to read a file while it is being modified? - it won't get the latest version
Possible solutions
How big are files on average?
What's the average lifespan of a file?
Do files tend to be shared?
Issues Regarding the Internal organisation of file servers and directory servers
No difference
Client a server can run on same machine
Clients and servers are fundamentally different
Advantages of stateless servers | Advantages of stateful servers |
Fault tolerence | Shorter request messages |
No OPEN/CLOSE calls needed | Better performance |
No server space wasted on tables | Readahead possible |
No limits on number of open files | Idempotency easier |
No problem if a client crashes | File locking possible |
Caching
+ all files accessible to all clients
+ plenty of space
+ no consistency problems
- network transfers / performance
+ faster than disk access
- network transfer
- record might not be in cache
+ no network transfer
- slow performance
- file consistency
+ no network transfer if file/record is in cache
+ read ahead
- file consistency
Most popular option
Cache Consistency
NFS Architecture
NFS Protocols
Client sends request for permission to mount a path name
If request granted, server returns a file handle
NFS is stateless