Whole file caching, as utilized by the Andrew File System (AFS), can become impractical or impossible under certain conditions, particularly when dealing with very large files or environments with limited local storage resources.
Here's a scenario where the whole file caching of AFS would be impractical or impossible, but the per-operation based caching (or lack thereof) in NFS would still work:
Large Files and Limited Cache Space: Imagine you have a client machine with limited cache space, and you want to access a massive file stored on a DFS where the file size exceeds the local cache capacity. In AFS, typically when a file is opened, it is fully cached before it can be used. If the file size is larger than the available cache space on the client machine, AFS wouldn't be able to cache it, making whole file caching impossible.
On the other hand, NFS operates more granularly by retrieving only the data that is requested for a given operation without requiring the entire file to be stored in the local client's cache. So, if a client wants to read or write a particular portion of a large file, NFS would only fetch or send the necessary data blocks rather than the entire file. This makes it more feasible for NFS to handle large files on a client with limited cache space as it doesn't attempt to prefetch the whole file.
This characteristic is especially pertinent with systems that handle massive multimedia files, large databases, or scientific datasets where the file sizes can be in the order of gigabytes or terabytes, easily surpassing local cache capability.
Additionally, NFS's stateless protocol can be an advantage in environments with high client mobility or dynamic IP settings. If a client crashes or disconnects before writing back the entire cached file, as in the AFS scenario, there could be issues with recovering the state and ensuring consistency. NFS would just lose the last operation, which could be a more manageable situation, especially if NFSv4 is used with its stateful operations that include robust recovery procedures.
In summary, NFS can handle read and write operations on large files in environments with limited cache capacity, because it does not require whole file caching like AFS does.