Stable structures
Intermediate
Rust
Tutorial
Stable structures are designed to use stable memory as the backing store, allowing them to grow to gigabytes in size without the need for pre_upgrade
/post_upgrade
hooks.
Using pre_ and post_upgrade hooks is discouraged. It is error-prone and can render a canister unusable. Per best practices, using these methods should be avoided if possible.
A stable structure library exists that aims to simplify managing data structures directly in stable memory and provides example code templates.
For more information about stable structures, please see the stable structures library and Roman's tutorial on stable structures.