couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <>
Subject _changes formats
Date Sun, 13 Sep 2009 04:38:17 GMT
I'm in the process of refactoring for COUCHDB-495, taking the simple
step of adding include_docs to changes, so we can remove
all_docs_by_seq, which is deprecated in 0.10. But it is making me
think of possibilities.

I'd like to replicate between to CouchDB instances with only a USB stick.

So I plug the stick into machine A, which is up to seq 8000, and run:

curl http://localhost:5984/mydb/_changes?style=full&since=5000 >

Dumping the latest 3k or so updates to the USB stick. Then I walk
across the room to machine B, and run:

cat /path/to/usb/stick/mydb-since-5000.couch | curl -X POST
http://localhost:5984/mydb/_changes -d -

And get those 3k updates into its local couch.

Punting on multipart mime for now, and doing the attachments as base64
would be worth it just to establish the capability. But I think
multipart mime is the smarter way to do it, for the sake of attachment
streamability and overall smaller file size.

Anyway, just wanted to drop the idea out there. It's a fairly big
undertaking but it's a well-defined goal.

Maybe we'd do well to have options for changes style:

main_only (for local events)
all_docs (used by replication)
full (for json file-based replication)
mime (for multipart file-based replication)

base64 style has its advantages, because getting the entire db across
while staying in JSON could be easier for some clients to consume.
Maybe we should independently have options for whether or not to
include attachments, or just stubs. Also these _changes will be
subject to _filter and maybe even _list, for the yays!

Anyway, I guess I just think the file-based replication is a really
good smell. It makes our replication system much more flexible, and
the fact that we can make it work this simply, just makes me happy.


Chris Anderson

View raw message