Alec Ramos
Alec Ramos

Reputation: 1

Shopify external database connection

I'm looking for the best solution to retrieve and post data from an external database. What type and where the database is stored is still up for discussion. Whatever is the fastest and easiest to implement with shopify will be chosen. Ideally it would be a javascript implemention. The data that has to be passed would be a string and non float values.

Upvotes: 0

Views: 1066

Answers (1)

Fabio Filippi
Fabio Filippi

Reputation: 1965

Your question is a bit too broad, I'll just try give you some advice, based on my experience.

I can think of two different approaches, depending on differenct factors (how many entries you need, how they are structured, etc).

  1. Serverless

You won't need a Shopify app for this. Just create and endpoint (lambda+API Gateway with DynamoDB) like GET yourapidomain.com/mydata?myParam=2 and POST yourapidomain.com/mydata be careful with CORS, and you're done. This approach is quite generic, it can work in any situation.

  1. Using metafields

If you don't have too many entries, and the structure is quite simple, you can use the metafields on Shopify as database.

If, for example, your data is for each product you can save it in the metafields of the product (or of the customer, etc). You will still need an endpoint to post the data from your page but you will be able to retrieve the data from the liquid file (server side).

Without knowing your particular use case is difficult to go more into details.

Upvotes: 1

Related Questions