diff --git a/docs/source/build_network.rst b/docs/source/build_network.rst index 4200a8f5f82..316d0e820ad 100644 --- a/docs/source/build_network.rst +++ b/docs/source/build_network.rst @@ -895,6 +895,24 @@ The output should display the two marbles owned by ``jerry``: Query Result: [{"Key":"marble2", "Record":{"color":"red","docType":"marble","name":"marble2","owner":"jerry","size":50}},{"Key":"marble3", "Record":{"color":"blue","docType":"marble","name":"marble3","owner":"jerry","size":70}}] + +Why CouchDB +------------- +CouchDB is a kind of NoSQL solution. It is a document oriented database where document fields are stored as key-value mpas. Fields can be either a simple key/value pair, list, or map. +In addition to keyed/composite-key/key-range queries which are supported by LevelDB, CouchDB also supports full data rich queries capability, such as non-key queries against the whole blockchain data, +since its data content is stored in JSON format and fully queryable. Therefore, CouchDB can meet chaincode, auditing, reporting requirements for many use cases that not supported by LevelDB. + +CouchDB can also enhance the security for compliance and data protection in the blockchain. As it is able to implement field-level security through the filtering and masking of individual attributes within a transaction, and only authorizing the read-only permission if needed. + +In addition, CouchDB falls into the AP-type (Availability and Partition Tolerance) of the CAP theorem. It uses a master-master replication model with ``Eventual Consistency``. +More information can be found on the +`Eventual Consistency page of the CouchDB documentation `__. +However, under each fabric peer, there is no database replicas, writes to database are guaranteed consistent and durable (not ``Eventual Consistency``). + +CouchDB is the first external pluggable state database for Fabric, and there could and should be other external database options. For example, IBM enables the relational database for its blockchain. +And the CP-type (Consistency and Partition Tolerance) databases may also in need, so as to enable data consistency without application level guarantee. + + A Note on Data Persistence --------------------------