Skip to main content
Sui’s storage model is designed around objects, with each object stored independently and accessed through its unique ID. This object-centric approach enables parallel execution and efficient state management.

Storage Architecture

Sui uses a versioned object storage model where:

Object-Based

Each object is stored independently with its own version

Content-Addressed

Objects are referenced by ID and version number

Permanent History

All object versions are retained for historical queries

Direct Access

Objects can be read directly without scanning

Object Serialization

Objects are stored as BCS (Binary Canonical Serialization) bytes:

Object Layout

The first 32 bytes of an object’s contents are always its ID:
This predictable layout allows Sui to efficiently extract object IDs without deserializing the entire object.

Storage Costs

Sui implements a storage fund mechanism to ensure sustainable long-term storage:

Storage Rebate System

From the storage fund implementation:

How Storage Charges Work

When you create an object, you pay for its storage:
This cost is held in the storage fund as a rebate for when the object is deleted.
A small portion of the storage rebate is non-refundable and goes to the storage fund to ensure long-term sustainability.

Object Size Limits

Sui enforces maximum object sizes to ensure efficient processing:

System Object Exception

System objects can exceed normal size limits when allow_unbounded_system_objects is enabled.

Optimized Storage for Coins

Coins have a special optimized storage format:
Coins always have a fixed 40-byte structure:
  • 32 bytes: Object ID
  • 8 bytes: Balance (u64)
This allows Sui to read and update coin balances without full deserialization, significantly improving performance for common operations like transfers and merges.

Dynamic Fields and Storage

Dynamic fields are stored as separate child objects:

Storage Benefits

Bypass Size Limits

Store unlimited data by splitting across dynamic fields

Efficient Updates

Modify individual fields without touching parent object

Selective Loading

Load only the fields you need

Granular Rebates

Receive storage rebates when removing fields

Storage Patterns

Small Objects

For small, frequently accessed data, use direct struct fields:
Best for: User profiles, NFT metadata, configuration

Large Collections

For large collections, use dynamic fields or Table:
Best for: Leaderboards, registries, mappings

Hierarchical Data

For nested structures, use object wrapping or dynamic object fields:
Best for: Organizations, complex game structures

Object Versioning

Sui maintains a complete version history of all objects:

Querying Historical State

You can query any past version of an object if you know its version number. This is useful for:
  • Auditing changes
  • Replaying transactions
  • Historical analysis
  • Debugging

Storage Best Practices

Smaller objects mean lower storage costs:
Choose the right structure for your access patterns:
  • Direct fields: Fast, fixed-size data
  • Dynamic fields: Flexible, variable-size data
  • Table: Large key-value collections
  • Bag: Heterogeneous collections
Delete objects when no longer needed to recover storage rebates:
For large data (images, documents), store only URLs or hashes on-chain:

Storage Fund Economics

The storage fund balances:
  • Total Object Storage Rebates: Sum of all storage rebates for active objects
  • Non-Refundable Balance: Accumulated fees that fund long-term storage

Objects

Understand the object model

Dynamic Fields

Extend objects at runtime

Gas Mechanism

Learn about gas and storage costs