How to fully utilize the 96 gig of stable storage in Motoko?

Is there currently a way of using the 96 gig of canister stable storage in motoko? In Azle and Rust canisters it seems pretty straight forward with the stableBtree structures.
For motoko the StableBtree is not yet production ready and the motoko hashmap only uses the heap, is there another way of achieving this in motoko for now? if not, when can we expect stable stable structures in motoko and utilize the 96 gib seamlessly?

About to board a flight so will be brief.

Motoko has long exposed low-level direct access to Stable Memory via library Experimental stable memory.mo.

Motoko 0.10.0 and onwards address support for (stable) Regions, that are isolated subregions of stable memory, similar to the memory abstraction in rust stable structures.
Isolation makes it easier for libraries to use stable memories (via regions) without trampling on each others’ feet.

For both approaches you need to use compile time flag --max-stable-pages to access more than the default 4GB of stable memory.

There is a grant based implementation of StableBTrees but I don’t know how production ready it is. We did some work porting it to use regions which had promising perf improvements, but it’s still an open PR.

Boarding flight now…

1 Like

The October Public Global R&D had a ten minute slot on regions…

1 Like

Thank you, I had not watched it yet. Watching it now!.