Close ad

At last year's WWDC Apple's worldwide developer conference introduced the new APFS file system. With an update on iOS 10.3 the first devices from the Apple ecosystem will switch to it.

A file system is a structure that provides storage of data on disk and all work with it. Apple currently uses the HFS+ system for this, which was already deployed in 1998, replacing the HFS (Hierarchical File System) from 1985.

So APFS, which stands for Apple File System, is supposed to replace the system that was originally created more than thirty years ago, and it's supposed to do so on all Apple platforms during 2017. Its development only started less than three years ago, but Apple tried Replace HFS+ since at least 2006.

First, however, efforts to adopt ZFS (Zettabyte File System), probably the most recognized file system at the moment, failed, followed by two projects developing their own solutions. So APFS has a long history and a lot of anticipation. However, many are still uncertain about Apple's ambitious plan to adopt APFS across its ecosystem, pointing to features known from other systems (especially ZFS) that are missing from it. But what APFS promises is still a significant step forward.

APFS

APFS is a system designed for modern storage – of course, it's built specifically for Apple hardware and software, so it's supposed to be well-suited to SSDs, large capacities, and large files. For example, it natively supports TRIM and does it constantly, which keeps the disk performance high. The main features and advantages over HFS+ are: cloning, snapshots, space sharing, encryption, failover protection and fast calculation of used/free space.

Cloning replaces classic copying, when a second file of data identical to the copied one is created on the disk. Cloning instead only creates a duplicate of the metadata (information about the file's parameters), and if one of the clones is modified, only the modifications will be written to disk, not the entire file again. The advantages of cloning are saved disk space and a much faster process of creating a "copy" of the file.

Of course, this process only works within one disk - when copying between two disks, a complete duplicate of the original file must be created on the target disk. A possible disadvantage of clones may be their handling of space, where deleting a clone of any large file will free up almost no disk space.

A snapshot is an image of the state of the disk at a certain point in time, which will allow files to continue working on it while still preserving their form, as it was at the time the snapshot was taken. Only changes are saved to the disk, no duplicate data is created. So this is a backup method that is more reliable than what Time Machine currently uses.

Space sharing enables several disk partitions share the same physical disk space. For example, when a disk with an HFS+ file system is divided into three partitions and one of them runs out of space (while the others have space), it is possible to just delete the next partition and attach its place to the one that ran out of space. AFPS displays all free space on the entire physical disk for all partitions.

This means that when creating partitions, there is no need to estimate their required size, as it is completely dynamic depending on the required free space in the given partition. For example, we have a disk with a total capacity of 100 GB divided into two partitions, where one fills 10 GB and the other 20 GB. In this case, both partitions will show 70 GB of free space.

Of course, disk encryption is already available with HFS+, but APFS offers its much more complex form. Instead of two types (no encryption and single-key whole-disk encryption) with HFS+, APFS is able to encrypt a disk using multiple keys for each file and a separate key for metadata.

Failure protection refers to what happens in the event of a failure while writing to disk. In such cases, data loss often occurs, especially when the data is being overwritten, because there are moments when both the erased and written data are in the course of transmission and are lost when the power is disconnected. APFS avoids this problem by using the Copy-on-write (COW) method, in which old data is not directly replaced by new ones and therefore there is no risk of losing them in the event of a failure.

Features present in other modern file systems that APFS (currently) lacks include compression and complex checksums (duplicates of metadata to verify the integrity of the original - APFS does this, but not for user data). APFS also lacks data redundancy (duplicates) (see cloning), which saves disk space, but makes it impossible to repair data in case of corruption. In connection with this, Apple is said to be appealing to the quality of the storage it installs in its products.

Users will first see APFS on iOS devices, already when updating to iOS 10.3. The next exact plan is not yet known, except that in 2018, the entire Apple ecosystem should run on APFS, that is, devices with iOS, watchOS, tvOS and macOS. The new file system should be faster, more reliable and more secure thanks to optimization.

Sources: Apple Lossless Audio CODEC (ALAC),, DTrace (2)
.