X-ShardId

The HTTP X-ShardId response header is an unofficial, Shopify-specific header identifying the database shard serving a merchant store's data.

Usage

Shopify distributes merchant data across many MySQL database shards. Each shard is part of a pod, an isolated instance of the Shopify platform containing its own database, Redis, and Memcached datastores. The X-ShardId header exposes which shard handled the database operations for a given request.

The shard identifier is assigned when Shopify's load balancer routes the request to the correct pod using the Sorting Hat routing layer. Because each pod maps to a single MySQL shard, the X-ShardId value often matches the X-Sorting-Hat-PodId value in the same response. Shopify rebalances shards over time by migrating stores between pods using an internal tool called Ghostferry, so a store's shard assignment is not permanent.

Note

The X- prefix for non-standard headers is deprecated per RFC 6648.

Values

Numeric shard identifier

The value is a positive integer identifying a specific MySQL database shard. Each number maps to an isolated database instance serving a group of merchant stores. Requests for stores on the same shard return the same X-ShardId value.

-1

A value of -1 indicates the request was not associated with a specific database shard. This appears on requests to generic Shopify endpoints or unresolved store domains where no store-specific data lookup occurred.

Example

A request to a Shopify store returned shard 263. This means the store's database records are stored on MySQL shard 263.

X-ShardId: 263

A different store assigned to shard 43. Stores on separate shards have fully isolated database instances with no shared data between them.

X-ShardId: 43

A value of -1 means no shard was involved in processing the request.

X-ShardId: -1

The X-ShardId header typically appears alongside other Shopify infrastructure headers. The shard ID and pod ID sometimes share the same numeric value because each pod maps to one database shard, though the identifiers use separate assignment spaces.

X-ShardId: 337
X-Sorting-Hat-PodId: 337
X-ShopId: 12345678
X-Sorting-Hat-ShopId: 12345678

Takeaway

The X-ShardId header identifies the MySQL database shard serving a Shopify store's data. The numeric value maps to an isolated database instance within Shopify's podded architecture, providing visibility into the data partitioning layer behind each request.

See also

Last updated: March 6, 2026