Confirming the Scope of the 2M Character JSON Metafield Limit

Hi everyone,

I’m in the process of designing an app and want to make sure I’m correctly understanding the metafield limits before I commit to an architecture.

The documentation states that the json metafield type has a limit of 2 million characters. My question is about the scope of this limit.

Does this mean:

  1. Per-Instance Limit: Each individual resource (like a specific customer or a specific product) can have its own json metafield that holds up to 2 million characters? (e.g., Customer A gets a 2M limit, and Customer B gets their own separate 2M limit).

OR

  1. Shared Limit: The limit is shared in some way across a resource type? (e.g., the combined size of all json metafields for all customers cannot exceed 2M).

The “Per-Instance” interpretation seems incredibly generous, which is why I’m seeking confirmation from those with more experience.

Could anyone who has worked with large-scale metafield data confirm how this limit is applied in practice?

Thanks in advance!

It’s ‘per metafield’, such that you can have many of them. Having really large JSON metafields will probably have SOME impact on liquid rendering performance, but my guess is that they are read into memory, and turned into a lookup table (or similar) which is what makes it viable.

It’s worth noting that there ARE limits in other areas. For example, in Shopify functions, there are ‘local’ overall limits, and also limits per metafield.

Hope that helps!

Hey @Ishaan_Shettigar - can you help me understand what you’ll use those 2 million characters for? Is there a limitation that forces this approach?

Hey James,

In 99.9% of cases we wont get near the 2 million limit. I was just trying to see, how far we can push Shopify infra. Once it gets anywhere close to the limit, we’ll have alerts to notify us and take some appropriate action. I need to understand what to set that limit to.

Essentially, if any merchant approaches the storage limit or throughput limit we want to take some action, such as, copy the data over to our own DB.

Does that help?

1 Like