Fast Inter-Canister Query Calls

I discovered yesterday that Query calls cannot emit messages. My hope was that I could have a bunch of bucket canisters, and one “root” canister that could interact with them acting like a facade.

However, since query calls can’t emit messages, all my get calls have to reach consensus like an update call would. Making this impractical.

What’s the workaround here, and is there a hopeful future where we can execute intercanister query → query calls?

The obvious solution is treat the root canister as a registry, that returns the address of the correct canister to the user, which then on the FE instantiates a canister js instance and executes the call.

That could be a good solution. You could approach it like hash table buckets.
BigMap is also coming which might meet your needs.

Something to note is that because these query calls won’t go through consensus you’re trusting the response of a single replica each time, this might be perfectly acceptable for your use case though.

1 Like

Gotcha, I’ve seen this brought up a few times before. Would my concern here be a replica is malicious, or possibly just not yet in sync with other replicas?

Malicious, so for example a banking system would want to use update calls for all critical reads.

1 Like