Upgrade to Pro — share decks privately, control downloads, hide ads and more …

BaseCouch

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for Jens Alfke Jens Alfke
October 25, 2012

 BaseCouch

Letting CouchDB (and TouchDB) replicate with Couchbase Server 2

Avatar for Jens Alfke

Jens Alfke

October 25, 2012
Tweet

More Decks by Jens Alfke

Other Decks in Programming

Transcript

  1. BaseCouch letting CouchDB (and TouchDB) replicate with Couchbase Server 2

    Jens Alfke ~ Oct 24, 2012 Thursday, October 25, 12
  2. BaseCouch Is… a little HTTP listener written in Go (~2500LOC;

    my first Go program!) that understands a subset of CouchDB’s REST API: For pull: _changes, GET doc … For push: _revs_diff, _bulk_docs … and stores CouchDB docs in Couchbase Thursday, October 25, 12
  3. BaseCouch Is Not… a full CouchDB-compatible server (no views, no

    replicator, other API bits missing) a way to make Couchbase databases accessible through CouchDB Thursday, October 25, 12
  4. Schema: Document {“id”: “sample-doc”, “rev”: “3-cfsdklaeip”, “sequence”: 231, “history”: {

    “revs”: [...], “parents”: [...], “keys”: [...], “deleted”: [...] } } doc:demodb/A9FF:sample-doc parent 2-9#f(Jq key sha1-X*@! deleted false 3-cfsdklaeip Conceptually, “history” is a map: Thursday, October 25, 12
  5. Revisions/Attachments {“name”: “INVISIBLE SANDWICH”, “year”: 2007, “subtype”: “invisible things” “_attachments”:

    { “img.jpg”: { “digest”: “md5-X&_x3”, “length”: 8032 } } } rev:sha1-X*@! att:md5-X&_x3 Thursday, October 25, 12
  6. Revisions/Attachments Content-Addressable Store No duplicates are stored Efficient for Syncpoint-style

    server with lots of similar databases Requires explicit garbage collection Thursday, October 25, 12