To never miss an article subscribe to my newsletter
No ads. One click unsubscribe.

BTRFS the reason to finally understand Binary Trees

2 min read

Hallo geweldig persoon,

as during the last week a xfs filesystem failed on me I did research what other filesystem options are out there and stumbled over the new kid on the block: BTRFS a quite modern filesystem (2007) trying to solve some problems the older ones are failing on. As it is more modern than the others it cares about SSDs by design. The paper has quite some pages due to graphics, but no worries it will not take your whole afternoon to understand as it is quite straight forward. In the end I settled for an ext4 instead of the xfs as it is a bit more mature, but BTRFS is definitely something to keep an eye on or try out in your home lab.


BTRFS is a Linux filesystem, headed towards mainline default status. It is based on copy-on-write, allowing for efficient snapshots and clones. It uses b-trees as its main on-disk data-structure. The design goal is to work well for many use cases and workloads. To this end, much effort has been directed to maintaining even performance as the filesystem ages, rather than trying to support a particular narrow benchmark use case.A Linux filesystem is installed on smartphones as well as enterprise servers. This entails challenges on many different fronts.

  • Scalability: The filesystem must scale in many dimensions: disk space, memory, and CPUs.
  • Data integrity: Losing data is not an option, and much effort is expended to safeguard the content. This includes checksums,metadata duplication, and RAID support built into the filesystem.
  • Disk diversity: the system should work well with SSDs and hard-disks. It is also expected to be able to use an array of different sized disks; posing challenges to the RAID and striping mechanisms.

This paper describes the core ideas, data-structures, and algorithms of this filesystem. It sheds light on the challenges posed by defragmentation in the presence of snapshots, and the tradeoffs required to maintain even performance in the face of a wide spectrum of workloads.

Download Link:

It would be awesome if you could help growing our little paper community even more by sharing it with your circles (you can also @eu_frey me on Twitter for retweets :D):

If you have any paper recommendation for me, please do not hesitate to approach me via [email protected] (Please keep the Backend & DevOps topic focus in mind)

With much love,

Simon Frey