Hi,
I have an app that enables merchants to track unique details about individual items, such as serial numbers, warranty durations, and any other business-specific custom information: IMEI, lot numbers, supplier SKUs, you name it. Some merchants track multiple serial numbers per item, i.e. one serial per part.
All items (sold or on hand) are stored in the app’s database, which is the source of truth. It enables merchants to filter items by their unique references in the app.
However, this data can’t be accessed in other parts of Shopify, e.g. notifications, Order Printer app, etc. Merchants want to share these details with their customers for support and warranty purposes. So, the app stores an array of sold items in Shopify order metafield. Additionally, parts of the app access this data through metafields to improve performance. I love how quick the Shopify admin API is, and I’ve been thinking about using metafields for this purpose even more.
I’ll admit that four years ago, when I released the app, I wasn’t sure how the app would evolve, if at all. So, I kept the metafield schema simple, but verbose - a 2M character limit felt safe. Items are stored as an array of objects with the following properties:
- Item ID (as stored in the app’s database)
- Serial number (built-in field)
- Warranty duration
- Merchant-defined custom fields: an array of key-value pairs
- Shopify’s numeric line item ID (no metafield for LineItem)
- Shopify’s numeric product variant ID
For brevity, let’s assume an item currently takes 160 bytes to store (not unreasonable, and may be larger). That’s 100 individual (not line!) items per order, which is probably enough for most merchants most of the time, but laughable for larger B2B businesses, who are showing more interest in the app as I keep improving it and adding new features.
Sure, I could normalise the data and split it across multiple metafields, maybe use metaobjects for some custom fields, but even then, it may not be enough given the 16KB limit.
Let’s assume an average serial number is 16 characters long. That’s ~1000 serial numbers per order. I started thinking about changing the schema last year, when one client hit the 2M-character limit with 50,000 items, or a similar number, multiple times. The client uninstalled the app, but there are still a few orders with over 1,000 individual items. I’m not only worried about the code changes, additional complexity, and data migration, but also about all the clients impacted by the app’s schema changes. Surely, the competitor apps will be affected by this, as well.
For a solo developer like me, it’s becoming really difficult to keep up with the breaking changes these days. First, forced migration to the web components lib + Preact for extensions. Now this…
Please, Shopify, reconsider this!
Thank you