1

The knowledge on RAM and smart contract is obscure to me.

In white paper, RAM is defined and I know now there're only 64GBs in total. However in developer manual https://developers.eos.io/ it never mentions the concept of RAM or log storage. So I'm confused how to understand RAM from the perspective of Smart Contract?

For example, if I launched that tic-tac-toe demo to the mainnet, where is its Multi-Index table data stored? Does RAM always caches the current state of the table? If so, in another scenario, if I'm developing a blogging dapp and for sure I don't want blog content go to RAM. What am I supposed to do?

2

For example, if I launched that tic-tac-toe demo to the mainnet, where is its Multi-Index table data stored? Does RAM always caches the current state of the table?

The Multi-Index struct content is exactly what is saved on ram and for all the smart contracts. At a moment all BPs will have in memory, every single table for every single smart contract posted on the network. The smart contract code itself is stored on run as well. Knowing this your application should be wise in memory management and erase the content not needed for processing.

If so, in another scenario, if I'm developing a blogging dapp and for sure I don't want blog content go to RAM. What am I supposed to do?

You should never store the blog content (text, images, videos,...) in the multi-index table. The ram cost would be very very high. The recommended solution is store this content in a distributed file system like IPFS. EOS is scheduled to support it natively by the and of this year.

  • What is your source on IPFS being said to be released by end of year? It's my inclination as well that this will be the case being that Dan is working on a steemit 2.0 and will need IPFS to support it. – Nat Jul 4 '18 at 15:35
  • 1
    For example : steemit.com/eos/@eosio/introducing-eos-io-application-stack but there are other more recent documents from block one talking about IPFS usage. The staked EOS will allow a IPFS storage quota in the same way of CPU and NET. – Evandro Lorenzoni Jul 4 '18 at 15:41
  • @EvandroLorenzoni I agree the "smart contract code itself is stored on run" part. But are you really really sure about BP stores entire multi-index table data in its RAM? I can just hardly believe because 64G RAM in total sounds too limited to use. Use the blogging example again, even if table stores simple key-value like "blogID -> IPFS_URL" it is still a concern as number of rows increases. In white paper, it mentions log storage (disk). What's the smart contract programming interface of log storage? – mzhang Jul 5 '18 at 4:56
  • Yes, everything is and will be on the RAM. That ois the reason the smart contract programmer will need to delete not used RAM. The sidechains will help in the future as new resources will be available on each . – Evandro Lorenzoni Jul 22 '18 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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