Local DB vs Central DB in private blockchain

+2 votes

We are working on a Letter of Credit(LC) POC on multichain. As part of our setup, we are having 4 nodes on private blockchain - Exporter,Importer and their corresponding banks. Now we want to build a trade/business view out of the transactions which happen on the blockchain for these entities as part of LC cycle. For that we are trying to capture the transactions happening on the blockchain in a database by parsing every block and inputting the LC related transactions in the database.

Now our question is should we do this at all nodes or can we keep a central database and through access control we manage that the nodes which are actually involved in the transaction get a full view otherwise, they only see a partial view of the transaction or don't see the transaction at all?

What would be your recommendation on the database setup?

asked May 16, 2016 by amanc

1 Answer

0 votes
First, every transaction is visible to every node, because that's how a blockchain works.

So it you build a database to mirror the blockchain transactions, its read permissions won't truly affect transaction visibility for any of the nodes - though it might be harder for them to understand the transaction data themselves, especially if some of the metadata is encrypted.

As to whether to provide one database copy per node, or one central database, it depends on your needs. But I would say that part of the point of a blockchain is to enable every node to verify everything for itself, so that should probably also apply to this external database, meaning that each node runs its own.
answered May 16, 2016 by MultiChain
We are not doing any verification of the transactions at the node level, infact we only put the subset of the transactions in the local database. Do you still think, we should go with a per node db setup?
I'm not sure what you're saying, because if you are using MultiChain then every transaction is verified by every node. Or are you just using the metadata of MulitChain's "transactions" in order to record your own "transactions"?
Yes we understand that the multichain node is doing the verification of the every transaction happening on the blockchain. And we are using the metadata to record our own transactions in the database.

So do you still think, we should go with a per node db setup?
OK thanks, so in that case I assume you're encrypting these transactions in the metadata. As to whether to use a central database or not, it depends how the pattern of key ownership. If every node will have the keys to read the data which his relevant for it, then it makes sense to run a database at every node. But if the keys are only in the hands of a small number of parties it makes sense to run a central database, because the edge nodes can't do anything meaningful with the encrypted data anyway.