> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Design

> Why Squid SDK works the way it does, and when it is the right tool for a Substrate indexer.

Squid SDK is a set of open-source TypeScript libraries for building blockchain indexers
(*squids*). Three design choices define it.

## Batches, not events

Every stage of a squid — extraction, decoding, transformation, persistence — operates on
[batches of blocks](guides/advanced/batch-processing) rather than one event at a time. Handlers
receive many blocks at once, decode what they need, and write results with a single database call
per batch. This is the main reason squids sync one to two orders of magnitude faster than
event-callback indexers: the database sees a handful of large transactions instead of millions of
small ones.

## Code, not configuration

The data handler is plain TypeScript. There is no DSL and no sandbox — you can call
[external APIs](guides/advanced/external-apis-ipfs), use any npm package, keep in-memory state
across batches, and structure the project like any Node.js application. The trade-off is
explicitness: you request exactly the data items and fields you need, and you write the
transformation yourself, with [generated typings](reference/packages-overview) keeping the
decoding type-safe.

## Modular pipeline

A squid composes independent parts — a Substrate data source, a
[store](reference/data-stores/store-interface) (PostgreSQL, files, BigQuery), optional code
generators, and an optional [GraphQL server](guides/serving-graphql) — connected by narrow
interfaces. Any store works with any source, and custom implementations plug in at every seam.
Data comes primarily from the [SQD Network](/en/network/overview), which serves pre-filtered
data far faster and cheaper than chain nodes; a complementary
real-time source covers the last stretch to the chain tip.

## What it's good for

Squid SDK is a batteries-included framework that shines when you need to get from an idea to
a GraphQL API or Postgres tables fast.

In many aspects it's similar to other popular indexing frameworks like TheGraph, Ponder and Envio.
If you want a similar self-contained framework that works with [SQD Network](/en/network/overview) gateways, Squid SDK is the right choice.

Consider the [alternatives](/en/sdk/options-comparison) if

* you want an approach that allows you to more readily split your requests and transforms into
  modules, then mix and match them - see [Pipes SDK](/en/sdk/pipes-sdk/evm/quickstart) (currently EVM and Solana only);
* you need more flexibility than Squid SDK allows - see
  the [raw gateway API](/en/network/overview).

Next: [How it works](how-it-works) explains the moving parts, and the [Quickstart](quickstart)
gets a squid running in five minutes.
