Automated Canister Management for Storage of DSocial

Currently working on migrating DSocial to use IC for video and images. Main issue I have is: automated on-chain canister management.

For example:

  • Management Canister:
    • Holds list of canisters
    • Checks which canisters have free space
    • When we hit close to 80% space used, creates a new canister, adds to list

So from the front end, we can call the management canister, it gives us the canister ID which we should upload to, then:

  • We upload the chunks of the file(s)
  • We commit these chunks

I think each “storage” canister should call back to the management canister and update it’s free space counter.

Is there any examples of this approach of management canisters than can create canisters, deploy code etc etc?

1 Like

Hey Ashley,

This type of dynamic canister management is what I’ve been doing with CanDB. In fact, just this past week I ran some tests uploading chunked video to the IC, and then streaming that same video from the IC using the underlying data structures in CanDB.

CanDB is currently in alpha - I’d be happy to talk with you more if you’re interested in using it.

If you’re looking for an example to roll your own code off of, I’d recommend reading through of @peterparker’s great blog posts on this topic.

1 Like

Thanks @icme :pray:

Worth to note that the Motoko Playground now also supports actor classes, kind of handy to give a try to the pattern.

Regarding installing code, I noticed some new cool patterns in this Wednesday public global R&D, notably the fact that a manager can upgrade the code of its children. Did not gave it a try, don’t even know if it’s released yet but, look super promising.