Skip to content

Commit

Permalink
[FAB-16274] - Add link to off_chain_data sample
Browse files Browse the repository at this point in the history
Change-Id: I77fe329bd4467180af5ee35bd2997a24c5fd30e2
Signed-off-by: NIKHIL E GUPTA <negupta@us.ibm.com>
  • Loading branch information
NIKHIL E GUPTA committed Sep 24, 2019
1 parent 003c8c5 commit 14e85ce
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/source/couchdb_tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ of data or blocks on your network.
It is also important to plan the indexes you install with your chaincode. You
should install only a few indexes per chaincode that support most of your queries.
Adding too many indexes, or using an excessive number of fields in an index, will
degrade the performance of your network. This is because the indexes are updated
degrade the performance of your network. This is because the indexes are updated
after each block is committed. The more indexes need to be updated through
"index warming", the longer it will take for transactions to complete.
Expand Down Expand Up @@ -605,7 +605,7 @@ ledger, this query will take a long time to respond or may timeout.
While it is important to follow best practices with your queries, using indexes
is not a solution for collecting large amounts of data. The blockchain data
structure is optimized to validate and confirm transactions, and is not suited
structure is optimized to validate and confirm transactions and is not suited
for data analytics or reporting. If you want to build a dashboard as part
of your application or analyze the data from your network, the best practice is
to query an off chain database that replicates the data from your peers. This
Expand All @@ -616,8 +616,10 @@ You can use block or chaincode events from your application to write transaction
data to an off-chain database or analytics engine. For each block received, the block
listener application would iterate through the block transactions and build a data
store using the key/value writes from each valid transaction's ``rwset``. The
:doc:`peer_event_services` provide replayable events to ensure the integrity of
downstream data stores.
:doc:`peer_event_services` provide replayable events to ensure the integrity of
downstream data stores. For an example of how you can use an event listener to write
data to an external database, visit the `Off chain data sample <https://github.com/hyperledger/fabric-samples/tree/master/off_chain_data>`__
in the Fabric Samples.
.. _cdb-pagination:
Expand All @@ -633,7 +635,7 @@ chaincode that executes the query until no more results are returned. For more i
this `topic on pagination with CouchDB <http://hyperledger-fabric.readthedocs.io/en/master/couchdb_as_state_database.html#couchdb-pagination>`__.
We will use the `Marbles sample <https://github.com/hyperledger/fabric-samples/blob/master/chaincode/marbles02/go/marbles_chaincode.go>`__
We will use the `Marbles sample <https://github.com/hyperledger/fabric-samples/blob/master/chaincode/marbles02/go/marbles_chaincode.go>`__
function ``queryMarblesWithPagination`` to demonstrate how
pagination can be implemented in chaincode and the client application.
Expand Down

0 comments on commit 14e85ce

Please sign in to comment.