Reputation: 337
I need a private blockchain system in which I would store complex data structures such as JSON documents.
The idea is that every transaction is a JSON document (with potentially various schema).
Hyperleadger Fabric seems to be a great fit since it can run using CouchDB. Although, from my understanding (please correct me if I'm wrong), in Fabric, CouchDB is supposed to be used as a state database that contains the latest state of the blockchain. Furthermore, data stored in CouchDB is not actually part of the blockchain which means it doesn't support Byzantine fault tolerance. So I could only use that system in a trusted consensus. If that is the case, then the use of a Blockchain over a distributed database system becomes irrelevant altogether.
Am I missing something?
Could I store my heterogeneous JSON documents in the ledger via transactions to benefit byzantine fault tolerance? If that is the case will it be possible to query the blockchain at this point?
Upvotes: 1
Views: 1091
Reputation: 31
A blockchain ledger consists of two distinct, though related, parts – a world state and a blockchain.
Firstly, there’s a world state – a database that holds the current values of a set of ledger states. The world state makes it easy for a program to get the current value of these states, rather than having to calculate them by traversing the entire transaction log. Ledger states are, by default, expressed as key-value pairs, though we’ll see later that Hyperledger Fabric provides flexibility in this regard. The world state can change frequently, as states can be created, updated and deleted.
Secondly, there’s a blockchain – a transaction log that records all the changes that determine the world state. Transactions are collected inside blocks that are appended to the blockchain – enabling you to understand the history of changes that have resulted in the current world state. The blockchain data structure is very different to the world state because once written, it cannot be modified. It is an immutable sequence of blocks, each of which contains a set of ordered transactions.click here to read more
We are using ledger to get the current state/data of blockchain. Without ledger we would have to traverse each block for trasaction logs & calculate current state.
Could I store my heterogeneous JSON documents in the ledger via transactions
Yes, you can store JSON documents in the ledger and create composite keys.
Upvotes: 3