Do you want to quickly experience CouchDB’s powerful replication? Jan Lehnardt, one of the people behind CouchDB, announced yesterday that he’d made a copy of the very good book Pro Git available as a CouchDB Application (a CouchApp). There are two ways you can go about getting that:
- Follow his instructions on getting the app with
git, for which you’ll need an installed couchapp program.
- Continue reading. (Hint: this is much more sexy and more in line with showing off what CouchDB is capable of.)
What I’m going to show you here, is how to replicate the content of the
progit database Jan created. The result will be a copy of the Pro Git book
on your machine:
I’m assuming that you
- have a running copy of CouchDB on a machine. (On a Mac, I recommend Jan’s one-click CouchDB package; download, double-click, relax. :-) )
- your CouchDB is running on address
Send off a replication command to your CouchDB to “pull” the content of the database.
This instructs your CouchDB to connect to the source URL and start
replicating the progit database. Your CouchDB will create the target
database, also called progit. (Note: the
create_target option is new for
CouchDB 0.11; if you have an older version omit the option and pre-create the
database in Futon.) This can take a bit of time. When replication finishes,
you should see the results, which will look something like this (reformatted
Now point your Web browser at your own CouchDB instance (which is probably
127.0.0.1), with a URL of
which should get you a page that looks like what you saw above.
After browsing around a bit, I recommend you use Futon to access your CouchDB
http://127.0.0.1:5984/_utils/index.html) and look at what is
And, if you didn’t feel like doing all that and simply want to see what it looked like, you can do so here.