Advent 2021: ZFS
This blog is part of the 24 posts long series "Advent 2021":
- Advent 2021: Intro (December 01, 2021)
- Advent 2021: C++ (December 02, 2021)
- Advent 2021: C# (December 03, 2021)
- Advent 2021: Python (December 04, 2021)
- Advent 2021: Go (December 05, 2021)
- Advent 2021: TypeScript (December 06, 2021)
- Advent 2021: CMake (December 07, 2021)
- Advent 2021: Django (December 08, 2021)
- Advent 2021: Angular (December 09, 2021)
- Advent 2021: Flask (December 10, 2021)
- Advent 2021: gRPC (December 11, 2021)
- Advent 2021: GraphQL (December 12, 2021)
- Advent 2021: XML & JSON (December 13, 2021)
- Advent 2021: Matplotlib, Pandas & Numpy (December 14, 2021)
- Advent 2021: Linux (December 15, 2021)
- Advent 2021: Ansible (December 16, 2021)
- Advent 2021: SQLite (December 17, 2021)
- Advent 2021: Catch2 (December 18, 2021)
- Advent 2021: Zstandard (December 19, 2021)
- Advent 2021: ZFS (December 20, 2021)
- Advent 2021: Thunderbird (December 21, 2021)
- Advent 2021: Visual Studio Code (December 22, 2021)
- Advent 2021: Blender (December 23, 2021)
- Advent 2021: Open source (December 24, 2021)
Now for something completely different, I guess. You may wonder how someone can be excited about a file system. After all, that’s as boring as it gets, isn’t it? Fortunately, it isn’t, and I’ve been a huge fan of ZFS from the moment it got announced until today. Today, I’ll try to get you excited about it as well! Or rather, the OpenZFS flavor, as ZFS only works on Sun Solaris whereas OpenZFS is the variant that is actively maintained and available across a variety of operating systems.
ZFS is at its core a file system designed for file servers. That’s where it originated, and you can clearly see that heritage in two features:
- All the data is stored with checksums. Nothing can rot over time.
- It’s a copy-on-write file system which makes it ridiculously simple to create snapshots.
Combined with the ability to add read and write caching, various forms of redundancy, easy hot-plugging, the ability to incrementally backup, and support for files and block storage, it truly is a Swiss army knife in the storage space. The combination of being copy-on-write and check-summed means that I don’t have to worry about my data silently getting corrupted. I can also jump back in time in case I accidentally delete or overwrite a file (which is easy to script – if you’re curious, you can look at my ZFS snapshot script). There’s really no alternative either – BTRFS comes close but is nowhere nearly as mature as ZFS, and that’s about it in terms of competition.
I’ve been using it on my home servers and professionally for nearly a decade now, and I continue to be impressed by the stability and feature set. It’s also under constant development and new things like a persistent cache have been added recently. For me, the persistent cache was a big deal, as I tend to turn off my home server regularly over night and previously the cache was always discarded, rendering it useless for me. Another recently added feature to OpenZFS is Zstd compression which is great as I have lots of easily compressible data – like all my emails from the past 20 years. If file systems are of any interest to you at all, do give ZFS a try!