Moaz Amin
Moaz Amin

Reputation: 11

Handle data of multiple shopify custom apps installs

I am working on a shopify app and new to shopify app development. I am building this app in laravel framework. I have some confusions in basic concepts of shopify app installs.

I am giving you a scenario that, there is an app build by some developer in laravel framework and mysql database, and this app is get store's data using API like list of orders, list of customers and etc. This app is also storing some metadata in app's database (mysql database)

For example

A store_a is install this app and this app save store's metadata in mysql

A store_b is also install this app and it will also save the store_b data in mysql

Similarly there may be hundreds of app installs How it will save and manage the data

please guide me with best approach

Upvotes: 0

Views: 448

Answers (1)

Sean S.
Sean S.

Reputation: 116

I would usually to something like this: You create 2 tables in database, one for assigning each store with unique ID and one to store the metadata.

For example table 1:

[ID] [shop_name]
1    mystore.myshopify.com

table 2:

[ID] [store_id] [metadata1] [metadata2]...
1    1          some data..

So store_id from table 2 matches ID from table 1. So to retrieve the data later first you would get ID from table 1 and then select all the rows from table 2 that match with the store_id

Upvotes: 2

Related Questions