> ## 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 to choose it for an EVM 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 — an EVM 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 — including real-time unfinalized blocks; node access
is needed only for direct contract state queries. The source itself is
swappable, too: the same query runs off a [Portal stream](./reference/evm-stream), a plain
[JSON-RPC endpoint](./reference/evm-rpc-stream), or a [fallback combination](./reference/evm-fallback)
of several sources with automatic failover.

## 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 the
[Portal API](/en/api/evm/introduction), 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);
* you need more flexibility than Squid SDK allows - see
  [Pipes SDK](/en/sdk/pipes-sdk/evm/quickstart) or
  [raw Portal API](/en/portal/evm/overview).

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


## Related topics

- [Design](/en/sdk/squid-sdk/solana/design.md)
- [ClickHouse](/en/sdk/pipes-sdk/evm/guides/basic-development/targets/clickhouse.md)
- [SQD Network Whitepaper](/en/network/whitepaper.md)
- [clickhouseTarget](/en/sdk/pipes-sdk/solana/reference/basic-components/target/clickhouse.md)
- [Make an indexer](/en/sdk/squid-sdk/evm/guides/make-an-indexer.md)
