DevelopersArchitectureObjects
Architecture

Objects

Objects are files discovered on your devices and drives, but can also be virtual, existing only within Spacedrive.

All metadata associated with files in Spacedrive is linked to the Object for that file.

If two or more files are discovered that are identical, they are linked to the same Object in Spacedrive.

Some Objects are purely virtual, meaning they have no Path and are likely only used in a Space.

Content Addressable Storage (CAS) IDs

A CAS ID is a unique identifier generated from a file's content using the blake3 hashing algorithm. The ID generation is optimized for different file sizes:

  • For small files (~100KB): The entire file content is hashed
  • For large files: A sampling approach is used:
    • First 8KB (header)
    • Last 8KB (footer)
    • 4 samples of 10KB each taken at regular intervals throughout the file

CAS IDs are used to:

  • Link identical files to the same Object (deduplication)
  • Track file changes
  • Generate and cache thumbnails

Hash Validation

Spacedrive uses a full checksum to validate file integrity. This is used for file sync, overwrite protection, and other sensitive operations.

Types of object

NameDescriptionCode
UnknownA file that can not be identified by the indexer0
DocumentA known filetype, but without specific support1
FolderA virtual filesystem directory2
Text FileA file that contains human-readable text3
PackageA folder that opens an application4
ImageAn image file5
AudioAn audio file6
VideoA video file7
ArchiveA compressed archive of data8
ExecutableAn executable program or application9
AliasA link to another Object10
Encrypted BytesRaw bytes with self contained metadata11
LinkA link to a web page, application or Space12
Web Page ArchiveA snapshot of a webpage, with HTML, JS, images and screenshot13
WidgetA widget is a mini app that can be placed in a Space at various sizes, associated Widget struct required14
AlbumAlbums can only have one level of children, and are associated with the Album struct15
CollectionIts like a folder, but appears like a stack of files, designed for burst photos/associated groups of files16
DatabaseA database file17
MeshA 3D mesh object18
Textured MeshA 3D mesh object with textures19
EntityA rigged character20