I come across a situation where i need to implement a relational database for an application. Now my question is how to implement it and where should i save the data? also i don't want to save data on RAM as it get very expensive when data size grows.

2 Answers 2


A good way would be to use the demux-js library. It listens for specified actions and allows updating logic for whatever kind of database you like. This is a RAM free option which essentially allows you to achieve CRUD functionality by creating a mirror image of what the blockchain would show if you played through all of your actions.

Mind the mess, but you can see me implement demux here.

  • blockchain is decentralized and so the data is just want to confirm by using demux the data will be centralized.is it good for a dapp? Commented Sep 6, 2018 at 9:37
  • 1
    Demux provides a mirror of the chain for ease of use. You can still verify on chain.
    – Nat
    Commented Sep 6, 2018 at 9:40
  • that's great !! if i setup mongo db at my local server and do save data before every transaction ! is it good practice ? Commented Sep 6, 2018 at 11:19
  • So inorder to run demux do i need to run my own node (nodeos) in develpment server. Commented Oct 4, 2018 at 3:06
  • 1
    @YashwanthKambala No, but you'll want to use a local node. "// Locally hosted node needed for reasonable indexing speed". You can also set the initial block that you want to listen for so you don't start at the first block. github.com/EOSIO/demux-js
    – Nat
    Commented Oct 5, 2018 at 11:25

Another option is to use eosio mongodb_plugin for archive blockchain log into mongodb by running a node then apply queries on it.


@Nat i need your opinion about that option.

  • 3
    It may be viable, but I think demux is more flexible because you can use almost every db you like.
    – tmm
    Commented Sep 6, 2018 at 7:59
  • Yeah, that one of plus point. we want to save data in decentralized database and give data ownership to user. is there any decentralized db who work well in that situation ?? Commented Sep 6, 2018 at 8:03
  • 1
    To be honest, I haven't touched that plugin. I'm still compiling contracts on 1.07 :). I'll update when the docs do. They're working hard at b1 right now and short handed in that department. I agree with TeeAttack42.
    – Nat
    Commented Sep 6, 2018 at 8:16
  • Thank you so much Nat & TeeAttack42 for your quick response. That help us a lot. Commented Sep 6, 2018 at 8:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.