# Multi canister architecture: how to create a master canister with Motoko?

**URL:** <https://forum.dfinity.org/t/multi-canister-architecture-how-to-create-a-master-canister-with-motoko/27909>\
**Category:** Programs & Applications\
**Tags:** Actor-Model\
**Created:** [February 26, 2024, 7:02pm UTC](https://forum.dfinity.org/t/multi-canister-architecture-how-to-create-a-master-canister-with-motoko/27909 "2024-02-26T19:02:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vdve1997](https://avatars.discourse-cdn.com/v4/letter/v/c0e974/32.png) [@vdve1997](https://forum.dfinity.org/u/vdve1997)\
**Post date:** [February 26, 2024, 7:02pm UTC](https://forum.dfinity.org/t/multi-canister-architecture-how-to-create-a-master-canister-with-motoko/27909/1 "2024-02-26T19:02:44Z")

</div>

Hey everybody, I am building a dapp, a token marketplace to be precise, and I have realized that for scalability, I need to use one canister per user and one canister per token. I saw that in the OpenChat architecture they do this, however, I still don’t understand if they use kind of a ‘master canister’ that creates the other canisters or how do they do it. I am coding in Motoko.

Does anyone have any code I could look at or documentation?

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [February 26, 2024, 10:54pm UTC](https://forum.dfinity.org/t/multi-canister-architecture-how-to-create-a-master-canister-with-motoko/27909/2 "2024-02-26T22:54:56Z")

</div>

[ICDevs.org](http://ICDevs.org) did a series of bounties on this last year. You can find a bunch of examples here:

- [Shared Canisters - Motoko](https://github.com/professionalGithub99/ScalingBounty)
- [Storage and Indexing across canisters - Rust](https://github.com/GLicDEV/quickstart_scaling/)
- [Autoscaling Nodes - Motoko](https://github.com/hoosan/auto-scaling-notes)
- [Internet Computer Storage Protocol - Motoko](https://github.com/PrimLabs/ICSP)
- [Scaled Storage - Rust](https://github.com/scroobius-pip/scaled_storage)
- [Bitcoin Federal Reserve - Actor Model - Motoko](https://github.com/professionalGithub99/actormodelbounty)
- [Colony Game - Actor Model - Rust](https://github.com/GLicDEV/ic-quickstart-actor-model)

---

<div class="post-metadata">

**Author:** ![vdve1997](https://avatars.discourse-cdn.com/v4/letter/v/c0e974/32.png) [@vdve1997](https://forum.dfinity.org/u/vdve1997)\
**Post date:** [February 29, 2024, 2:53pm UTC](https://forum.dfinity.org/t/multi-canister-architecture-how-to-create-a-master-canister-with-motoko/27909/3 "2024-02-29T14:53:24Z")

</div>

Thank you. It has been really helpful to browse through the OpenChat architecture post as well. However, I have some questions regarding pricing and costs. How could I calculate to some degree the cost of having this indexing-autoscaling architecture? I do want to make my dapp as scalable as possible, but I am aware that OpenChat has much more users than I probably will have at first. I am just wondering if its not smart to make it as scalable as posible at first… any advice?

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [February 29, 2024, 4:28pm UTC](https://forum.dfinity.org/t/multi-canister-architecture-how-to-create-a-master-canister-with-motoko/27909/4 "2024-02-29T16:28:28Z")

</div>

It depends on how much processing and storage you’re going to have on each canister. Provided each starts very low, then your estimation is just how many cycles you need to spin up each canister. At one point I thought it required 2 trillion cycles to start a canister but I don’t think that’s the case if you’re using a spawning method. I’d try to find a solution that puts as Few cycles as possible on each new canister, and then only add more cycles, if the user engages.

---

<div class="post-metadata">

**Author:** ![vdve1997](https://avatars.discourse-cdn.com/v4/letter/v/c0e974/32.png) [@vdve1997](https://forum.dfinity.org/u/vdve1997)\
**Post date:** [March 5, 2024, 7:30pm UTC](https://forum.dfinity.org/t/multi-canister-architecture-how-to-create-a-master-canister-with-motoko/27909/5 "2024-03-05T19:30:04Z")

</div>

Thanks. Do you have any resources with good info on this topic? To make an estimation.
