Re: mixing CouchDB and LevelDB

Siddharth Jain

Thanks. That's what I wanted to confirm. So its a should not a must.

From: David Enyeart <enyeart@...>
Sent: Friday, December 27, 2019 8:27 AM
To: Siddharth Jain <siddjain@...>
Cc: fabric@... <fabric@...>
Subject: Re: [Hyperledger Fabric] mixing CouchDB and LevelDB

The general guidance as that all peers on a channel should use the same database type to ensure deterministic endorsement and validation across peers.
We know that CouchDB itself places limitations on valid keys and even valid JSON content as documented here:
Therefore what may pass endorsement and validation on LevelDB may not pass validation on CouchDB.
Similarly, range queries used in transactions are validated at commit time on every peer to ensure the results at endorsement time still match current results, and although both LevelDB and CouchDB sort keys as bytes lexicographically, it is possible that in some edge cases LevelDB and CouchDB would return results in different order and therefore you could get different validation results (I don't know of any such edge cases, but I also haven't reviewed LevelDB and CouchDB source code to completely rule out any such cases).

You don't necessarily have to follow the general guidance however. If your chaincode data validation limits keys and values to what is supported on both LevelDB and CouchDB, there is no technical reason why you can't have both LevelDB and CouchDB based peers on the same channel.

BTW there is a Jira to add a channel capability that would enforce CouchDB data validation at endorsement time on all peers (not just CouchDB-based peers as is done in v1.4.x). See

Dave Enyeart

"Siddharth Jain" ---12/24/2019 07:03:06 PM---this is the link where I read All peers on the network *must* use the same database type https://url

From: "Siddharth Jain" <siddjain@...>
To: fabric@...
Date: 12/24/2019 07:03 PM
Subject: [EXTERNAL] Re: [Hyperledger Fabric] mixing CouchDB and LevelDB
Sent by: fabric@...

this is the link where I read All peers on the network must use the same database type

Pardon me but I am still trying to understand whether this is a must or a should.

also w.r.t.

There may also be scenarios where range query results are sorted differently across LevelDB and CouchDB, causing differences in range query validation.

is it possible to give an example illustrating what is meant in above? how will it cause differences in range query validation?

Join to automatically receive all group messages.