Skip to content

Commit

Permalink
[FAB-1759] [FAB-1703] Doc couchDB
Browse files Browse the repository at this point in the history
Added the required CouchDB doc for V1 Fabric.
What is, why, when needed etc.

Change-Id: Ia827f3a284ee1ecaab9a8457c78860fca6592b57
Signed-off-by: luomin <luomin_tokyotech@hotmail.com>
  • Loading branch information
luomin committed Jul 27, 2017
1 parent f3d0f5c commit 09a6585
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/source/build_network.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://docs.couchdb.org/en/latest/intro/consistency.html>`__.
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
--------------------------

Expand Down

0 comments on commit 09a6585

Please sign in to comment.