Skip to content

Data Persistence

TODO: Write content for this page.

Guide developers through storing data in canisters. Cover stable structures (StableBTreeMap in Rust), persistent actors (Motoko), MemoryManager for multiple data structures, and pre/post-upgrade hooks. Include idempotency patterns for safe data mutation. Show code examples for both Rust and Motoko.

  • Portal: building-apps/canister-management/storage.mdx, best-practices/storage.mdx, best-practices/idempotency.mdx
  • icskills: stable-memory
  • Examples: daily_planner (both), superheroes (Motoko), photo_gallery (Rust)
  • Rust CDK: https://docs.rs/ic-cdk/latest/ic_cdk/
  • concepts/orthogonal-persistence — conceptual background
  • guides/canister-management/lifecycle — upgrade hooks
  • languages/rust/stable-structures — Rust-specific deep dive
  • languages/motoko/ — Motoko persistence patterns