Camlistore

Brad Fitzpatrick
2011-05-07

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

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

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

Image filling the slide (with optional header)

Cat

A slide with an embed + title

Full-slide embed with (optional) slide title on top

Thank you!