internals.rst 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. .. include:: global.rst.inc
  2. .. _internals:
  3. Internals
  4. =========
  5. The internals chapter describes and analyses most of the inner workings
  6. of Borg.
  7. Borg uses a low-level, key-value store, the :ref:`repository`, and
  8. implements a more complex data structure on top of it, which is made
  9. up of the :ref:`manifest <manifest>`, :ref:`archives <archive>`,
  10. :ref:`items <item>` and data :ref:`chunks`.
  11. Each repository can hold multiple :ref:`archives <archive>`, which
  12. represent individual backups that contain a full archive of the files
  13. specified when the backup was performed.
  14. Deduplication is performed globally across all data in the repository
  15. (multiple backups and even multiple hosts), both on data and file
  16. metadata, using :ref:`chunks` created by the chunker using the
  17. Buzhash_ algorithm ("buzhash" chunker) or a simpler fixed blocksize
  18. algorithm ("fixed" chunker).
  19. To perform the repository-wide deduplication, a hash of each
  20. chunk is checked against the :ref:`chunks cache <cache>`, which is a
  21. hash-table of all chunks that already exist.
  22. .. figure:: internals/structure.png
  23. :figwidth: 100%
  24. :width: 100%
  25. Layers in Borg. On the very top commands are implemented, using
  26. a data access layer provided by the Archive and Item classes.
  27. The "key" object provides both compression and authenticated
  28. encryption used by the data access layer. The "key" object represents
  29. the sole trust boundary in Borg.
  30. The lowest layer is the repository, either accessed directly
  31. (Repository) or remotely (RemoteRepository).
  32. .. toctree::
  33. :caption: Internals contents
  34. internals/security
  35. internals/data-structures
  36. internals/frontends