file-systems.rst.inc 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. File systems
  2. ~~~~~~~~~~~~
  3. We recommend using a reliable, scalable journaling filesystem for the
  4. repository, e.g., zfs, btrfs, ext4, apfs.
  5. Borg now uses the ``borgstore`` package to implement the key/value store it
  6. uses for the repository.
  7. It currently uses the ``file:`` store (posixfs backend) either with a local
  8. directory or via SSH and a remote ``borg serve`` agent using borgstore on the
  9. remote side.
  10. This means that it will store each chunk into a separate filesystem file
  11. (for more details, see the ``borgstore`` project).
  12. This has some pros and cons (compared to legacy Borg 1.x segment files):
  13. Pros:
  14. - Simplicity and better maintainability of the Borg code.
  15. - Sometimes faster, less I/O, better scalability: e.g., borg compact can just
  16. remove unused chunks by deleting a single file and does not need to read
  17. and rewrite segment files to free space.
  18. - In the future, easier to adapt to other kinds of storage:
  19. borgstore's backends are quite simple to implement.
  20. ``sftp:`` and ``rclone:`` backends already exist, others might be easy to add.
  21. - Parallel repository access with less locking is easier to implement.
  22. Cons:
  23. - The repository filesystem will have to deal with a large number of files (there
  24. are provisions in borgstore against having too many files in a single directory
  25. by using a nested directory structure).
  26. - Greater filesystem space overhead (depends on the allocation block size — modern
  27. filesystems like zfs are rather clever here, using a variable block size).
  28. - Sometimes slower, due to less sequential and more random access operations.