ZFS, BTRFS, XFS, EXT4 and LVM with KVM – A Storage Performance Comparison (2015)
Here a few things to note:<p>BTRFS has had Copy on Write disabled, while ZFS (not possible, cause the whole idea of the FS is intended to be copy on write), which actually makes BTRFS look even worse compared to ZFS, cause BTRFS writes once instead of twice and has most of its features not work, while still performance pretty bad. But then it&#x27;s also younger.<p>Both ZFS and BTRFS (only know specifics of ZFS) can be configured to be better for DB workloads. On ZFS, I know a couple of people using it cause it has nice properties.<p>Anyway. You might not want to use ZFS or BTRFS for a (pure) database system when performance is the important thing (compared to data security).<p>What I find kind of missing is UFS because of the BSD world (it&#x27;s kind of what Ext4 is in the sense of &quot;your general purpose FS with good performance for DBs&quot;), but okay.<p>And yeah, that all may sound a bit biased towards ZFS, but so far my experience with ZFS has been rather pleasent compared to BTRFS, but again. You might wanna use UFS or Ext4.<p>It&#x27;s also kind of &quot;wrong&quot; to compare those file systems. It&#x27;s like while you could use Redis and PostgreSQL for the same things it&#x27;s probably not what you want to for one reason or the other.<p>But then of course it&#x27;s good, cause you might really have a thing where you want to have a comparison of those two things to take the right decision for your specific application. Like those cases where you say &quot;It&#x27;s slow, but it makes a lot of thing easier&quot; or &quot;It doesn&#x27;t guarantee that, but when I take care of it in the design I will only need only a fraction of the resources. And the other downsides don&#x27; t annoy me thaaat much&quot;.<p>Because the question came up. COW means Copy on Write and it really means what it says. You copy the data (so have find and to write blocks, duplicating your data on write) which in case of a full blown database which does that again (WAL, Autovacuum, keeping lots of metadata, etc.) you really shouldn&#x27;t be surprised that it&#x27;s a lot slower on write heavy sytems. It is more than expected.<p>On the other hand because the FS does a lot of things in a similar way to a database, other than snapshots and replication and all that cool stuff ZFS does things related to metadata extremely quickly and that&#x27;s why some CDNs that have many small files use it. Besides just being an amazing thing for managing your data in general.<p>Also if you wanna learn more a about ZFS and have a good understanding of how you can run databases and other things on ZFS and really utilize it (not just gaining more performance) then I highly recommend the book FreeBSD Mastery: Advanced ZFS.