Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
980 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...