I’m currently doing a solidity project where users can create crowdfunding campaigns and others can participate financially to them.

Each campaign is defined by a struct containing basic informations like : owner address, title, current balance, category, target, deadline, img link.

But It also contains the description which can get quite long for a crowdfunding campaign as you can imagine.

For now I can display easily the campaigns on my website, using a getCampaigns function. But I’m sure that if the contract reach for example 100k campaigns, the getcampaigns returning 100k struct would be a nightmare.

How would you optimize this ? Use an external database that updates every time a user create a campaign ? Or maybe it would just work ?

And for the description, should I store it elsewhere, maybe offchain ? Because it would be nice if I could add image to them, which is not feasible for now

  • 2
    Have you considered content-addressable off-chain storage, e.g. IPFS? It gives you a guarantee of data integrity but isn't immediately available (nor should it be, by the sounds of it). Commented Feb 2 at 11:56

1 Answer 1


Yeah, -Arran Schlosberg got it right when he recommended content-addressable off-chain storage solutions, there are some considerations to keep in mind, but for your use case storage solutions like SWARM or IPFS would be Ideal.

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.