Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
982 views
in Technique[技术] by (71.8m points)

local storage - Is there best practice solution to store draft data out of blockchain in dapp?

I use ethereum platform for develop dapp. And I need to store some draft data out of blockchain before push it to network . In this case can I use smart contracts or store draft data in db or store it in localStorage . Which solution is good ? Or there is something else solution for such case ?

question from:https://stackoverflow.com/questions/65906502/is-there-best-practice-solution-to-store-draft-data-out-of-blockchain-in-dapp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

If you are using a public Ethereum, then storing draft data on a smart contract will be expensive (since that means storing it on the blockchain). If this is a private Ethereum, then it depends on whether the draft data should be available only on the node where it was created or on all or some of the network nodes too. Keep in mind that to reduce the size of data stored directly on the blockchain, you can use either a decentralized file system (IPFS, Ethereum swarm) for distributed data storage or cloud storage with only links to the data itself being transferred to the blockchain.

While the draft data can only be accessed by the site where it is created, the choice between a database and file storage is essentially a matter of taste and personal preference. The size of the data — tens of bytes or megabytes — and the capabilities of the available database management systems can also be affected.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...