| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 | .. include:: global.rst.inc.. _internals:Internals=========The internals chapter describes and analyses most of the inner workingsof Borg.Borg uses a low-level, key-value store, the :ref:`repository`, andimplements a more complex data structure on top of it, which is madeup of the :ref:`manifest <manifest>`, :ref:`archives <archive>`,:ref:`items <item>` and data :ref:`chunks`.Each repository can hold multiple :ref:`archives <archive>`, whichrepresent individual backups that contain a full archive of the filesspecified when the backup was performed.Deduplication is performed globally across all data in the repository(multiple backups and even multiple hosts), both on data and filemetadata, using :ref:`chunks` created by the chunker using theBuzhash_ algorithm ("buzhash" chunker) or a simpler fixed blocksizealgorithm ("fixed" chunker).To perform the repository-wide deduplication, a hash of eachchunk is checked against the :ref:`chunks cache <cache>`, which is ahash-table of all chunks that already exist... figure:: internals/structure.png    :figwidth: 100%    :width: 100%    Layers in Borg. On the very top commands are implemented, using    a data access layer provided by the Archive and Item classes.    The "key" object provides both compression and authenticated    encryption used by the data access layer. The "key" object represents    the sole trust boundary in Borg.    The lowest layer is the repository, either accessed directly    (Repository) or remotely (RemoteRepository)... toctree::    :caption: Internals contents    internals/security    internals/data-structures    internals/frontends
 |