All Projects → systemd → Casync

systemd / Casync

Content-Addressable Data Synchronization Tool

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Casync

ZDrive
Seamless download/upload contents via Google Drive 📂
Stars: ✭ 25 (-97.19%)
Mutual labels:  download, upload
angular-material-datatransfer
A HTML5 datatransfer UI for handling upload and download of multiple simultaneous files.
Stars: ✭ 13 (-98.54%)
Mutual labels:  download, upload
httputils
Http工具包:OkHttp轻量封装 、功能全面、设计力求优雅与纯粹,Java领域前后端处Http问题的新选择。
Stars: ✭ 21 (-97.64%)
Mutual labels:  download, upload
miniprogram-network
Redefine the Network API of Wechat MiniProgram (小程序网络库)
Stars: ✭ 93 (-89.55%)
Mutual labels:  download, upload
kubefilebrowser
kubernetes container filebrowser and webshell
Stars: ✭ 23 (-97.42%)
Mutual labels:  download, upload
rsync
gokrazy rsync
Stars: ✭ 308 (-65.39%)
Mutual labels:  download, upload
simple http server
simple http server for upload and download
Stars: ✭ 101 (-88.65%)
Mutual labels:  download, upload
Bita
Differential file synchronization over http
Stars: ✭ 145 (-83.71%)
Mutual labels:  synchronization, download
tar
Memory-efficient, streaming implementation of the tar archive format in Dart
Stars: ✭ 18 (-97.98%)
Mutual labels:  tar, archive
UniBorg
Pluggable Telegram bot and userbot based on Telethon
Stars: ✭ 196 (-77.98%)
Mutual labels:  download, upload
fansly
Simply scrape / download all the media from an fansly account
Stars: ✭ 351 (-60.56%)
Mutual labels:  download, archive
Rx Mvp
RxJava2+Retrofit2+RxLifecycle2+OkHttp3 封装RHttp 使用MVP模式构建项目
Stars: ✭ 343 (-61.46%)
Mutual labels:  download, upload
UserFileSystemSamples
IT Hit User File System Engine samples in .NET/C#. Samples implement Virtual File System for Windows and Mac with synchronization support, on-demand loading, offline files, and Windows File Manager integration.
Stars: ✭ 60 (-93.26%)
Mutual labels:  synchronization, file-system
Backdoor
A backdoor that runs on Linux and Windows
Stars: ✭ 36 (-95.96%)
Mutual labels:  download, upload
Libarchivejs
Archive library for browsers
Stars: ✭ 145 (-83.71%)
Mutual labels:  tar, archive
speed-cloudflare-cli
📈 Measure the speed and consistency of your internet connection using speed.cloudflare.com
Stars: ✭ 99 (-88.88%)
Mutual labels:  download, upload
Poosh
🌎 Publish local files to virtually any remote endpoint (e.g. AWS S3)
Stars: ✭ 55 (-93.82%)
Mutual labels:  synchronization, upload
Desync
Alternative casync implementation
Stars: ✭ 140 (-84.27%)
Mutual labels:  synchronization, archive
PyroGramBot
pluggable Telegram Bot based on Pyrogram
Stars: ✭ 168 (-81.12%)
Mutual labels:  download, upload
Godfs
A simple fast, easy use distributed file system written in go.
Stars: ✭ 256 (-71.24%)
Mutual labels:  download, upload

casync — Content Addressable Data Synchronizer

What is this?

  1. A combination of the rsync algorithm and content-addressable storage

  2. An efficient way to store and retrieve multiple related versions of large file systems or directory trees

  3. An efficient way to deliver and update OS, VM, IoT and container images over the Internet in an HTTP and CDN friendly way

  4. An efficient backup system

See the Announcement Blog Story for a comprehensive introduction. The medium length explanation goes something like this:

Encoding: Let's take a large linear data stream, split it into variable-sized chunks (the size of each being a function of the chunk's contents), and store these chunks in individual, compressed files in some directory, each file named after a strong hash value of its contents, so that the hash value may be used to as key for retrieving the full chunk data. Let's call this directory a "chunk store". At the same time, generate a "chunk index" file that lists these chunk hash values plus their respective chunk sizes in a simple linear array. The chunking algorithm is supposed to create variable, but similarly sized chunks from the data stream, and do so in a way that the same data results in the same chunks even if placed at varying offsets. For more information see this blog story.

Decoding: Let's take the chunk index file, and reassemble the large linear data stream by concatenating the uncompressed chunks retrieved from the chunk store, keyed by the listed chunk hash values.

As an extra twist, we introduce a well-defined, reproducible, random-access serialization format for directory trees (think: a more modern tar), to permit efficient, stable storage of complete directory trees in the system, simply by serializing them and then passing them into the encoding step explained above.

Finally, let's put all this on the network: for each image you want to deliver, generate a chunk index file and place it on an HTTP server. Do the same with the chunk store, and share it between the various index files you intend to deliver.

Why bother with all of this? Streams with similar contents will result in mostly the same chunk files in the chunk store. This means it is very efficient to store many related versions of a data stream in the same chunk store, thus minimizing disk usage. Moreover, when transferring linear data streams chunks already known on the receiving side can be made use of, thus minimizing network traffic.

Why is this different from rsync or OSTree, or similar tools? Well, one major difference between casync and those tools is that we remove file boundaries before chunking things up. This means that small files are lumped together with their siblings and large files are chopped into pieces, which permits us to recognize similarities in files and directories beyond file boundaries, and makes sure our chunk sizes are pretty evenly distributed, without the file boundaries affecting them.

The "chunking" algorithm is based on the buzhash rolling hash function. SHA512/256 is used as a strong hash function to generate digests of the chunks (alternatively: SHA256). zstd is used to compress the individual chunks (alternatively xz or gzip).

Is this new? Conceptually, not too much. This uses well-known concepts, implemented in a variety of other projects, and puts them together in a moderately new, nice way. That's all. The primary influences are rsync and git, but there are other systems that use similar algorithms, in particular:

(ordered alphabetically, not in order of relevance)

File Suffixes

  1. .catar → archive containing a directory tree (like "tar")
  2. .caidx → index file referring to a directory tree (i.e. a .catar file)
  3. .caibx → index file referring to a blob (i.e. any other file)
  4. .castr → chunk store directory (where we store chunks under their hashes)
  5. .cacnk → a compressed chunk in a chunk store (i.e. one of the files stored below a .castr directory)

Operations on directory trees

# casync list /home/lennart
# casync digest /home/lennart
# casync mtree /home/lennart (BSD mtree(5) compatible manifest)

Operations on archives

# casync make /home/lennart.catar /home/lennart
# casync extract /home/lennart.catar /home/lennart
# casync list /home/lennart.catar
# casync digest /home/lennart.catar
# casync mtree /home/lennart.catar
# casync mount /home/lennart.catar /home/lennart
# casync verify /home/lennart.catar /home/lennart  (NOT IMPLEMENTED YET)
# casync diff /home/lennart.catar /home/lennart (NOT IMPLEMENTED YET)

Operations on archive index files

# casync make --store=/var/lib/backup.castr /home/lennart.caidx /home/lennart
# casync extract --store=/var/lib/backup.castr /home/lennart.caidx /home/lennart
# casync list --store=/var/lib/backup.castr /home/lennart.caidx
# casync digest --store=/var/lib/backup.castr /home/lennart.caidx
# casync mtree --store=/var/lib/backup.castr /home/lennart.caidx
# casync mount --store=/var/lib/backup.castr /home/lennart.caidx /home/lennart
# casync verify --store=/var/lib/backup.castr /home/lennart.caidx /home/lennart (NOT IMPLEMENTED YET)
# casync diff --store=/var/lib/backup.castr /home/lennart.caidx /home/lennart (NOT IMPLEMENTED YET)

Operations on blob index files

# casync digest --store=/var/lib/backup.castr fedora25.caibx
# casync mkdev --store=/var/lib/backup.castr fedora25.caibx
# casync verify --store=/var/lib/backup.castr fedora25.caibx /home/lennart/Fedora25.raw (NOT IMPLEMENTED YET)

Operations involving ssh remoting

# casync make foobar:/srv/backup/lennart.caidx /home/lennart
# casync extract foobar:/srv/backup/lennart.caidx /home/lennart2
# casync list foobar:/srv/backup/lennart.caidx
# casync digest foobar:/srv/backup/lennart.caidx
# casync mtree foobar:/srv/backup/lennart.caidx
# casync mount foobar:/srv/backup/lennart.caidx /home/lennart

Operations involving the web

# casync extract http://www.foobar.com/lennart.caidx /home/lennart
# casync list http://www.foobar.com/lennart.caidx
# casync digest http://www.foobar.com/lennart.caidx
# casync mtree http://www.foobar.com/lennart.caidx
# casync extract --seed=/home/lennart http://www.foobar.com/lennart.caidx /home/lennart2
# casync mount --seed=/home/lennart http://www.foobar.com/lennart.caidx /home/lennart2

Maintenance

# casync gc /home/lennart-20170101.caidx /home/lennart-20170102.caidx /home/lennart-20170103.caidx
# casync gc --backup /var/lib/backup/backup.castr /home/lennart-*.caidx

# casync make /home/lennart.catab /home/lennart (NOT IMPLEMENTED)

Building casync

casync uses the Meson build system. To build casync, install Meson (at least 0.40), as well as the necessary build dependencies (gcc, liblzma, libcurl, libacl, and optionally libfuse). Then run:

# meson build && ninja -C build && sudo ninja -C build install
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].