I am deciding on whether I want to create my database as a multi canister architecture due to the 4GiB Motoko Canister storage limitation. I have some questions that I am unsure the answer regarding this decision.
- Is the best tactic for a multi canister architecture to have one “management” canister which is responsible for creating, keeping a record of, and querying dynamically created canisters? If so, is the “management” canister at risk of becoming a bottleneck (Every request must first be routed to the management canister - then to the corresponding sub canister - meaning the management canister will receive a lot of traffic). Are there any ways to prevent the “management” canister from being a bottleneck?
- If I use the above method to shard my database, how can I perform database wide searches? If each canister only holds a sub section of the data, would I have to query all of the sharded canisters to conduct a full database search? This would be very inefficient and still not very practical. Is there a good way to shard my database so it can be easily searched as a whole?
- I have read in the forum that enhanced orthogonal persistence could in the VERY near future allow for a Motoko canister to hold up to 400 GiB in heap memory. This would solve all of my problems. Can I expect this update within the next month or so? Is it worth waiting it out?
- If orthogonal persistence is still in the distant future or if it will not actually provide 400 GiB of heap memory, is it worth it for me to look into the Motoko Stable Regions API. Can the Stable Regions API handle a lot of query and update traffic efficiently and at a reasonable cost? Is it worth the extra cost and complexity of not having to spin up the equivalent of 100 canisters (debatably 200) to achieve the same storage functionality?
Sorry for all of my questions recently. Just do not want to rush my backend architecture to save myself the technical debt. Thank you all DFINITY developers for all your help so far, much appreciated keep up the great work!