Accessing Data
Data access on Sui is the process of reading onchain state, including transactions, checkpoints, objects, and events. Sui provides multiple interfaces for accessing this data, each optimized for different use cases.
Choosing a data access method
| Method | Best for | Latency | Historical depth |
|---|---|---|---|
| GraphQL RPC | Flexible queries, app backends, explorers | Low | Current state and recent history |
| gRPC | High-throughput streaming, real-time pipelines | Lowest | Current state and recent history |
| Custom indexing | Application-specific data models, analytics | Varies | Full history (you control retention) |
| Archival Store | Historical lookups after full node pruning | Higher | Complete history from genesis |
For most applications, start with GraphQL RPC. If you need real-time streaming or higher throughput, use gRPC. If you need a custom data model or application-specific indexes, build a custom indexing pipeline. For historical data beyond what full nodes retain, use the Archival Store.
You can also subscribe to onchain activity through events, which Move modules emit during transaction execution. Authenticated events provide cryptographic proof of event origin for cross-system verification.
For a list of hosted RPC providers, see RPC Providers.
Data Access Interfaces
Overview of the types of data access mechanisms available in Sui.
RPC and Data Providers
Third-party providers offering Sui gRPC, GraphQL RPC, and Archival Store and Service endpoints.
JSON-RPC Migration Guide
Choose between gRPC and GraphQL RPC when migrating from the deprecated JSON-RPC API. Includes a method mapping, decision criteria, and common migration gotchas.
gRPC
GraphQL
Archival Service
Emitting Events
Use events to notify onchain assets of activity your smart contracts initiate and query events from other packages to trigger logic based on emitted events.
Authenticated Events
Cryptographically verifiable Move events that can be verified by a light client without trusting any intermediary, suitable for trustless event consumption.