metafields vs gadget record
I want to optimize my request time and store settings for the app in gadget record, however i was wondering if it would be more efficient to store it in shopify metafields. My app is read intensive and the gadget record probably gets called a few thousand times so i was just wondering if it would be more efficient to store these settings in shopify api and save up on request time
9 Replies
or perhaps i store in both but the reading part i do using metafields in shopify api
Hello,
I think that it's generally best to store things in metafields and metaobjects if they're going to be fetched a lot by the storefront. That'll significantly reduce your request time
no they're not being fetched by the storefront, its being used in the orders/create action
In that case, why would you want it to be a metafield?
just to save up on request time
The metafield would need to be present on every order to save you request time. Metafields aren't a Gadget feature but instead a Shopify feature. You'll need to fetch the data from your database either way
oh okay i was thinking something along these lines:
store the srlettings in the app metafield as hson, for each orfer make a call tot he shopify api and parse the metafield value, and use the settings. Right now for each order i make a call to the internal api to use the data stored in the particular model for each store
Calling the Shopify API would never be faster than calling your own API. You would also use up API call tokens
oh alright