Lounge

Lounge is another tool that allows you to create a cluster of CouchDB nodes. It is available under an open source license and is maintained by Meebo. Lounge takes a different approach to clustering than BigCouch. Lounge is itself a proxy server that manages a cluster of CouchDB nodes. Lounge requires a small patch to CouchDB that enables design-only replication (so that only design documents and views are replicated) but, other than that, uses CouchDB as-is.

Lounge actually includes two proxy servers—a dumbproxy and a smartproxy. The dumbproxy is nginx packaged up with a custom proxying module. The dumbproxy handles routing requests to the correct shard, or partition, for documents and for everything else that is not a view. Document IDs are hashed using a consistent hashing algorithm. This hash determines to which node an HTTP request gets sent. Since the document ID is included in both reads and writes, the dumbproxy will always send both reads and writes to the correct node. The smartproxy is a Python Twisted daemon which handles the sharding of views—see Chapter 19 in CouchDB: The Definitive Guide (O’Reilly). Finally, Lounge includes a replicator which keeps design documents synchronized and can replicate documents for redundancy.

Warning

Neither BigCouch nor Lounge support automatic resharding. For this reason, you may want to consider oversharding your database. Basically, this means having multiple shards on each CouchDB node. For example, if you have 8 shards on 2 nodes, ...

Get Scaling CouchDB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.