This question already has an answer here:
I am new to ethereum and the blockchain, but I am wondering about blockchain databases. Mainly I am wondering how exactly the database data and the blockchain merge. For instance, in a database you have basically SELECT, INSERT, DELETE, and UPDATE. The data is stored in tables or in a graph, etc. Then you query the data, that's basically it.
In a blockchain, the data seems to be stored in a Merkle tree. This seems to allow for storing versions of data, to handle the database versioning problem. It also has something to do with validating the data, but I'm not too sure how this works yet, but it seems valuable.
To merge the two, it seems you need to store the database in both a Merkle Tree and a graph database (if you're doing graph data). I don't see how this should really work. In addition, I would like to know at what granularity you are making the "blockchain transactions", because these seem processor intensive and so if you made them on every CREATE or INSERT, etc., it seems like that would bog down the db. Please advise.