DEV Community

Maddy for Neighbourhoodie

Posted on with Jan Lehnardt • Edited on

CouchDB’s Favourite File Systems

Picking the right file system can make a big difference in how well CouchDB runs. Every operating system has its default file system, and choosing the best one for your use case can help your database perform at its best. In this article, we walk you through the top file systems for CouchDB and discuss trade-offs so you can select the one that works best for you.

Every operating system comes with a file system that allows users to store and retrieve any kind of data in any number of files.

File systems are usually hierarchical structures with a top level starting point and any number of nested subdirectories that users can use for organising their data.

File systems have many functions. The most important ones for CouchDB are:

  • creating a file
  • finding a file
  • opening a file
  • writing data to a file
  • reading data from a file

The first three are important for creating and using databases, the last two are the most often used functions: getting data in and out of a storage medium.

There are a number of file systems available on modern systems that all have different trade-offs. This isn’t a comprehensive comparison of file systems, but just a brief overview so you can choose the right file system for your needs.

The list of recommended file systems for CouchDB are, in no particular order:

NTFS is Windows’s default file system and in comparison is a fairly good one, too. Since alternatives are uncommon, on Windows, use NTFS.

APFS is the default file system on macOS systems. It also is pretty good, and there aren’t many alternatives, so as with Windows, on a Mac, use APFS.

On Linux, you have the choice between ext4 (a common default) and xfs. Both are fine for use with CouchDB. ext4 usually has a little edge over xfs in read and write performance for individual files, where xfs has an advantage when writing to many files concurrently. xfs is a common first choice for database servers because of this. In CouchDB, especially with sharded databases, xfs is recommended.

On BSD you also have the choice of ZFS, which has a number of unique features like built in encryption, compression, snapshotting and checksumming. ZFS does not usually win raw performance benchmarks, but it is no slouch. And if you want to make managing your data safe and easy, ZFS is your first choice. ZFS is also available on Linux and Mac, but is not as fast and at times less reliable, so we don’t immediately recommend it there. However, if you are comfortable with the trade-offs there in favour of the nice features, CouchDB will work fine with ZFS on Linux and Mac.


You can discover more ways to keep your CouchDB project efficient on the Neighbourhoodie blog, where we regularly publish tips like this, guides to getting started, and tutorials. You can also join our mailing list to periodically get Apache CouchDB news and tips in your inbox, learn about our development projects, and discover new CouchDB solutions.

Top comments (0)