2

The storage should appear on EOS by the end of 2018. https://github.com/EOSIO/Documentation/blob/master/EOS.IO%20Storage.pdf

Would it be possible to simply move the ram-tables to a storage, once we don't need them (lets say, after doing an airdrop) and clear the RAM ? However, once we need the tables back in RAM, we simply populate the RAM and do whatever needs to be done ...

If not, why not ?

here is an explanation about a swap

https://www.centos.org/docs/5/html/5.2/Deployment_Guide/s1-swap-what-is.html

1

Usage of swap or virtual memory is already considered in the way that it has always worked on regular operating systems. To explain this it's important to understand the following:

The amount of RAM that is available in the EOS blockchain is basically just a configuration parameter of the blockchain itself. It doesn't mean that the block producers actually have that exact amount of physical RAM in their nodes.

When you store things in the EOSIO DB tables, the nodes will keep that memory in RAM if they can, meaning that their physical RAM might already be full and the OS of the node will start using swap memory instead. This allows the blockchain's RAM to be way more that what a node physically has, but it has negative impact on the performance of the node in case the physical RAM fills up, because then it will start needing to swap memory on and off between the physical RAM and the storage device (hard drive/SSD). These operations take long compared to operating directly on physical RAM, and thus the transactions will take longer to process. This can cause the node to miss blocks if they are a block producer!

Fortunately, as explained by Dan Larimer in this article, operating systems prioritize keeping in RAM the most frequently used memory (or the memory that was accessed most recently), and in any case, the actual RAM usage in the blockchain is still very low - the speculation in the RAM market is what made it so expensive, not the actual usage of the RAM that was being reserved.

I recommend reading that article to understand better the details of the situation, as Dan explained it quite nicely.

Regarding your point about having a functionality of doing a "backup" of the DB tables into IPFS storage and being able to restore it back to your RAM when you wanted to use them again, I think it could definitely be a useful feature, especially for taking and archiving snapshots of token balances or other interesting use cases like that. In technical terms, I don't see why it wouldn't be possible to implement, but it would have to be at the base layer of the blockchain probably, maybe allowing the IPFS storage functionality to take the data directly from the DB. Of course, it all depends on how exactly they end up implementing it though. You could contribute by opening an issue in the EOS Github repository to suggest it! Be sure to add details about possible use cases, etc.

I hope this clears your doubts.

  • 1
    I had no doubts :) I was just wondering about the possibilities and the future. Thank you kindly for such a detailed answer, it is worth reading and the links are worth studying ! – Damir Olejar Jul 22 '18 at 2:38
1

Why EOS is working with RAM in the first place? To be fast. To have 3000 tx/per second (current maximum). If you will have to write data to disk - it will take a lot of time (comparing to RAM). It will cost a lot of staked EOS for CPU or will just be forbidden by BPs. The only way i see it can be really implemented - is by running it some how outside of CPU limit, so it can be implemented in node software, but definitely not in a smart-contract.

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.