0

I have an ad campaign and I want to store data(like campId, number of impressions, start date, end date etc.) of each campaign on blockchain. Also, whenever I will pass campId, I should be able to access data of that particular campaign. I am just wondering should I just create simple contract and create new instance of it for every campaign and save the address of each contract in the relation db or I should use some pattern like Factory or Registry patten?

1 Answer 1

3

If you want to avoid having a backend/bd to store data and solely want to run your application on a decentralized way, then a Factory patter should be what you're looking for. This way you can store your campaigns in your factory. I would also recommend you look at the proxy contract patterns. You should create a proxy contract to that point to your factory. This way, in case you ever want to update your application (new features, bug fixing etc...) you can just deploy a new factory and point your proxy to it. Hope it helps.

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.