Indexation of the blockchains data

Best Practices for Indexing Chain Data for a Custom Explorer?

Hey everyone,

My friend and I are building our own explorer for a Cosmos-based chain, and we’re debating the best approach to indexing chain data. We’d love your input!

My approach:

I think we should fetch raw transactions from each block, decode them, and then dynamically index the events into our databases using a single script that handles fetching, decoding, and indexing.

My friend’s approach:

He suggests we should index data by querying each module separately (e.g., bank, staking, etc.), then index those results into our databases—essentially having separate scripts or processes for each module.

Our main questions:

  • Which approach is more scalable and maintainable in the long run?

  • What’s considered best practice or industry standard for Cosmos-based explorers?

  • Are there any tools, libraries, or frameworks you’d recommend for either approach?

Would love to hear your experiences, recommendations, or any pitfalls to watch out for!

Thanks in advance :rocket:

We need more data — where and what you want to store, how to retrieve the data, and so on.
But for now, I can say that it’s better to work with separate modules for data retrieval and export.
You can also use versions of AVL trees to update data in the database.

I wanted to store most of the data which is persent on the explorers.