Can we use mongodb store state?

EOS.IO Asked by user2644 on November 28, 2020

I read chainbase and fork database, I understood chainbase which stores user state and fork database which stores blocks. So Can I use mongodb to store user state and ignore chainbase? If it can, we do not more RAM, right?

One Answer

Well, it depends.

But you've already got the right path to reduce RAM usage.

The first thing is whether the user state you mention is intend to be stored on the blockchain or not, fully or partly?

What is the difference?

To be simplified:

  • on chain data is what in the RAM. Smart contract can interact with the on chain data. It is also "protected" by the blockchain.

  • off chain data is what not stored on the blockchain. Many decentralized exchange are doing off chain matching. They may have an off chain database for the task. As it is not on the blockchain, when a success match send back to blockchain, a validation process should involved.

So you will need to clearly split the user state, decide which part must put into chainbase and which part can be put into off chain mongodb. Cryptography algorithms may help you reduce the ram usage like moving data off chain and protect them with their hash on chain.

Answered by twksos on November 28, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP