neighbourhoodie-nnh-logo

Sharding — Increasing the Number of Shards posted Tuesday, September 29, 2020 by The Neighbourhoodie CouchDB Team

This advice is only true for CouchDB 3.0.0 or later. Next week, we’ll cover increasing the number of shards in CouchDB 2.x.

Increasing the number of shards in CouchDB is implemented by a technique called shard splitting. It allows you to specify for any one shard in a database to be split into two equal-sized shards.

CouchDB does all the hard work for you: a single request to the /_reshard endpoint will start the process. Shard splitting is a background process that can go on while your CouchDB cluster is fully operational. Once the split shards are available, CouchDB starts using them to serve requests instead of the original shard, which then gets deleted.

Note that shard copies are replicated across your cluster. We recommend you split one shard at a time. In addition, we recommend to split all shards of a database around the same time in order to guarantee consistent performance.