Skip to content
🎉 Welcome to the new Aptos Docs! Click here to submit feedback!

Defining a Data Schema

The first step with indexing is choosing a database and defining a schema for the data that you want to store.

Schema Considerations

When designing an indexer data schema, consider the following:

  • Customizability: A schema serves as an interface for your dApp to access data tailored to your specific contract or application. Ensure your schema is customized to meet your dApp’s unique requirements.
  • Query Optimization: A well-designed schema can enable more efficient data retrieval, supporting advanced operations such as aggregations, complex filtering, and table joins.
  • Enhanced Performance: Schema design can significantly improve your dApp’s performance. By using the indexer, a single indexer query can often replace multiple queries to the fullnode.

Aptos Core Processors

All data exposed by the Indexer API is initially indexed using custom processors. Each core processor indexes a specific type of data. You can explore the full list of processors and the complete indexer data schema.

The Aptos core processors and the Quickstart Guide use PostgreSQL as the database and Diesel as the ORM. However, you are free to choose any database or ORM that fits your needs. Popular alternatives include SeaORM and SQLx. Setting up a database and using an ORM is beyond the scope of these tutorials. If you need guidance, refer to the tutorials linked above for more information.