Camlistore

Brad Fitzpatrick
2011-05-07

(use arrow keys or PgUp/PgDown to move slides)

Who am I?

But why am I in Brazil?

Camlistore!

Camlistore

Camlistore is a way to store, sync, share, model and back up content
camlistore.org

Motivation

Motivation (cont)

Motivation (cont)

The Product

Security Model

So what's with the silly name?

Camlistore

Content-Addressable

Multi-Layer, Indexed

Logically

In reality

From the bottom up...

Blob Server

Blob Server: how dumb it is

Blob Server: seriously, no metadata

Uh, what can you do with that?

Uh, what can you do with that?

Filesystem Backups

Filesystem Backups

Schema: how to model your content

Schema Blobs

Minimal Schema Blob

{
  "camliVersion": 1,
  "camliType": "whatever"
}

Whitespace doesn't matter. Just must be valid JSON in its entirety. Use whatever JSON libraries you've got.

That one is named
sha1-19e851fe3eb3d1f3d9d1cefe9f92c6f3c7d754f6

or perhaps: sha512-2c6746aba012337aaf113fd63c24d994a0703d33eb5d6ed58859e45dc4e02dcf
dae5c4d46c5c757fb85d5aff342245fe4edb780c028a6f3c994c1295236c931e

Schema blob; type "file"

{"camliVersion": 1,
 "camliType": "file",
 "fileName": "foo.dat",
 "unixPermission": "0644",
 ...,
 "size": 6000133,
 "contentParts": [
   {"blobRef": "sha1-...dead", "size": 111},
   {"blobRef": "sha1-...beef", "size": 5000000, "offset": 492 },
   {"size": 1000000},
   {"blobRef": "digalg-blobref", "size": 22},
  ]
}

Schema blob; type "directory"

{"camliVersion": 1,
 "camliType": "directory",
 "fileName": "foodir",
 "unixPermission": "0755",
  ...,
 "entries": "sha1-c3764bc2138338d5e2936def18ff8cc9cda38455"
}

Schema blob; type "static-set"

{"camliVersion": 1,
 "camliType": "static-set",
"members": [
     "sha1-xxxxxxxxxxxx",
     "sha1-xxxxxxxxxxxx",
     "sha1-xxxxxxxxxxxx",
     "sha1-xxxxxxxxxxxx",
     "sha1-xxxxxxxxxxxx",
     "sha1-xxxxxxxxxxxx",
  ]
}

Backup a directory...

$ camput --file $HOME
sha1-8659a52f726588dc44d38dfb22d84a4da2902fed

(like git/hg/fossil, that identifier represents everything down.)

Iterative backups are cheap, easy identifier to share, etc

But how will you remember that identifier? (later)

But what about mutable data?

Objects & "Permanodes"

Terminology

Permanode

$ camput --permanode
sha1-ea799271abfbf85d8e22e4577f15f704c8349026

$ camget sha1-ea799271abfbf85d8e22e4577f15f704c8349026
{"camliVersion": 1,
  "camliSigner": "sha1-c4da9d771661563a27704b91b67989e7ea1e50b8",
  "camliType": "permanode",
  "random": "oj)r}$Wa/[J|XQThNdhE"
,"camliSig":"iQEcBAABAgAGBQJNRxceAAoJEGjzeDN/6vt8ihIH/Aov7FRIq4dODAPWGDwqL
1X9Ko2ZtSSO1lwHxCQVdCMquDtAdI3387fDlEG/ALoT/LhmtXQgYTt8QqDxVdu
EK1or6/jqo3RMQ8tTgZ+rW2cj9f3Q/dg7el0Ngoq03hyYXdo3whxCH2x0jajSt4RCc
gdXN6XmLlOgD/LVQEJ303Du1OhCvKX1A40BIdwe1zxBc5zkLmoa8rClAlHdqwo
gxYFY4cwFm+jJM5YhSPemNrDe8W7KT6r0oA7SVfOan1NbIQUel65xwIZBD0ah
CXBx6WXvfId6AdiahnbZiBup1fWSzxeeW7Y2/RQwv5IZ8UgfBqRHvnxcbNmScrzl
p3V3ZoY"}

Backup a directory...

$ camput --file $HOME
sha1-8659a52f726588dc44d38dfb22d84a4da2902fed
$ camput --permanode --file $HOME
sha1-ea799271abfbf85d8e22e4577f15f704c8349026
$ camput --permanode --name="Brad's home directory" --file $HOME
sha1-ea799271abfbf85d8e22e4577f15f704c8349026

Aside: Garbage Collection

Modeling non-filesystem objects

Example: a photo gallery

How to make sense of that?

Indexing & Search

Indexing: summary

For each blob, build an index of:

Indexing & Replication

Replication Implementation

Search

...similar to your email, or docs.google.com. "My stuff" or "My bookmarks".

Privacy Model

What if you want to share with friends, or globally publish something?

Sharing & Share Blobs

the act of sharing involves creating a new share claim, just another blob, signed.

here is: sha1-071fda36c1bd9e4595ed16ab5e2a46d44491f708:

{"camliVersion": 1,
  "authType": "haveref",
  "camliSigner": "sha1-f019d17dd308eebbd49fd94536eb67214c2f0587",
  "camliType": "share",
  "target": "sha1-0e5e60f367cc8156ae48198c496b2b2ebdf5313d",
  "transitive": true
,"camliSig":"iQEcBAABAgAGBQJNQJGuAAoJEIUeCLJL7Fq1EuAIAL/nGoX8caGaANnam0bcIQT7C61wXMRW4qCCaFW+w67ys5z4ztfnTPKwL9ErzMF8Hd32Xe/bVcF6ZL38x/axqI7ehxN8lneKGQNoEdZDA9i752aAr0fkAba6eDehoOj9F4XxOzk3iVrq445jEXtu/+twamHV3UfRozWK1ZQb57dM+cRff47M/Y6VIBRSgW2BrABjuBs8G6PiKxycgh1mb+RL8f9KG+HB/yFuK37YJqZ0zU2OTRp6ELiOgTxbeg99koV9Duy4f4mQgxQgli46077Sv/ujzIeVbmdFL3OenGEzQnyKG0fhf8fa5WkED0XfH7zibAHLiSq3O7x11Q0406U==ANug"}
Target w/ ?via= parameter: sha1-0e5e60f?via=sha1-071fda & next hop

Sharing Details & Implementation

What can be shared

Project Status

Project Status

In Review

Thank you!

Brad Fitzpatrick, brad@danga.com; Want to help? More info: camlistore.org