Chapter 9

Indexing with The Graph

Scanning the blockchain from scratch on every page load is slow and rate-limited. Indexers preprocess events into databases — The Graph is the standard data layer for Ethereum dApps that need history or aggregation.

Index when you need historical lists — past trades, votes, transfers — aggregations like volume and leaderboards, or relationships linking NFTs to owners over time. Ponder, Envio, and custom indexers compete on speed and developer experience.

Subgraph latency is usually acceptable for dashboards and activity feeds. For time-critical reads — current user balance, open position status — query the contract directly via RPC and treat the indexer as a cache for everything else.