CouchDB Why couchdb Fabric supports two types of peer state databases. LevelDB is the default state database embedded in the peer node. LevelDB stores chaincode data as simple key-value pairs and only supports key, key range, and composite key queries. CouchDB is an optional, alternate state database that allows you to model data on the ledger as JSON and issue rich queries against data values rather than the keys. The CouchDB support also allows you to deploy indexes with your chaincode to make queries more efficient and enable you to query large datasets [1]. In order to leverage the benefits of CouchDB, namely content-based JSON queries, your data must be modeled in JSON format. You must decide whether to use LevelDB or CouchDB before setting up your network. Switching a peer from using LevelDB to CouchDB is not supported due to data compatibility issues. All peers on the network must use the same database type. If you have a mix of JSON and binary data values, you can still use CouchDB, however the binary values can only be queried based on key, key range, and composite key queries. Installing the Apache CouchDB packages [2] Debian or Ubuntu: Run the following commands: sudo apt update sudo apt install -y couchdb sudo apt-get install couchdb A CouchDB alternative: PouchDB Server If you have trouble installing CouchDB, you can also install PouchDB Server, which is a drop-in replacement for CouchDB that uses PouchDB under the hood: $ npm install -g pouchdb-server $ pouchdb-server --port 5984 Verify your installation [3] Once CouchDB is installed, it should be running at localhost:5984. To verify, you can open up your terminal and type $ curl localhost:5984 You should see something like: {"couchdb":"Welcome","version":"2.2.0",...} Next, open up http://localhost:5984/_utils/ in your browser. If you see a screen like the following, then you are ready to rock and roll with CouchDB: Browser http://localhost:5984/_utils/ References [1] https://hyperledger-fabric.readthedocs.io/en/release-2.2/couchdb_tutorial.html [2] https://docs.couchdb.org/en/latest/install/unix.html#installation-using-the-apache-couchdb-convenie nce-binary-packages [3] https://pouchdb.com/guides/setup-couchdb.html