/ abzu-core / src / storage / mod.rs
mod.rs
 1  //! Storage Module
 2  //!
 3  //! Multi-tenant storage foundation with pluggable backends.
 4  //!
 5  //! # Architecture
 6  //!
 7  //! - [`StorageBackend`] - Trait for pluggable persistence (sled, redb, sqlite)
 8  //! - [`UserStore`] - User-scoped storage with automatic key prefixing
 9  //! - [`UserRegistry`] - Manages active user sessions
10  //!
11  //! # Key Format
12  //!
13  //! All keys are prefixed with user identity:
14  //! ```text
15  //! {user_id:32 bytes}/{collection:utf8}/{key:variable}
16  //! ```
17  //!
18  //! This enables:
19  //! - User data isolation (by construction)
20  //! - Clean user deletion (prefix scan + delete)
21  //! - Data portability (export user keyspace)
22  
23  mod backend;
24  mod user_store;
25  mod registry;
26  mod error;
27  
28  pub use backend::{StorageBackend, SledBackend};
29  pub use user_store::{UserStore, collections};
30  pub use registry::UserRegistry;
31  pub use error::StorageError;