0

Hello I have to create dapp, and more specific I want to create something like store where people can create items and sell them. The problem is I want to keep information about the items offchain (like title, description, picture etc..). For backend dB I want to use Mongo, and I was wondering can I save addresses of my users together with the items which they choose to sell in mongodb, and all other transactions onchain?

4
  • Your request is not too well defined. It should be possible to store some data onchain and some offchain. But you will have to work more on the details, to determine the data to be stored and how it will work. Also blockchains have reorgs how will your db be updated in case of data changes.
    – Ismael
    Mar 14, 2019 at 18:48
  • Well, i will emit events from my contract and listen to them in my frontend then provide them to server and finally into my db Mar 14, 2019 at 19:35
  • One important issue you will have to solve is how you will react on chain reorgs, data off chain might turn stale if not updated properly.
    – Ismael
    Mar 15, 2019 at 4:25
  • What I was thinking were: One user can set item for selling which will have expiration time of 24hours. During this time users can purchase current item and finally when time is passed owner of the item can withdraw ethers. In my mongodb all I want to save is reference to user address and the model of the item which he choose to sell. So state of data which is onchain stay clear. Mar 15, 2019 at 6:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.