Storing application data?

Highlighted
Tourist
13 0 2

I'm curious what the best practices are for storing data such as an apps user preferences. I'm extremely new to Shopify app development, Ruby on Rails, and developing web based apps in general. So I've been getting by just by piecing together examples I've found online.

Just to get started, I'm developing a small app that makes a pop up appear on the online store. I'd like the store owner/app user be able to customize the text that appears in that pop up. 

So far I've been (barely) able to stand up a public app using Heroku and load a ScriptTag to show my pop up on the online store. But now I'm at a loss of how to store a users preferences. What is the best way to go about this?

 

Thanks in advance!

0 Likes
Highlighted
Shopify Staff
Shopify Staff
486 42 106

Hi Phil,

The way you could access this data and pass it into your app would be through using ActiveRecord, which you can find a lot of resources online for.  To store your data, a popular option would be to use a database.  If you want to keep everything on Heroku, they offer a free Postgresql plan that you could start with: https://devcenter.heroku.com/articles/heroku-postgresql.

Cheers,

Ryan O

Developer Experience @ Shopify
0 Likes
Highlighted
Tourist
13 0 2

Hi there, thanks for the response. After doing some more research, would using metafields for the shop be an acceptable approach to storing some basic data such a user color preference?

0 Likes
Highlighted
New Member
1 0 0

Hello sir, 

i want to store data from public app input field using react post request. how can i store it in shopify database? 

0 Likes
Highlighted
New Member
4 0 0

May i know do we have any inbuild storages to store the data in shopify

 

0 Likes
Highlighted
New Member
4 0 0

am having same question have you got any answer for that and this ui also looks me little bit confusing i couldnt able to click on message icon and its showing 2 or 13 some count. but couldnt able to click other than replay icon

0 Likes
Highlighted
Explorer
41 9 9

Hi mate,

Add Metafields guru to your store

And take a look around the Shop level metafields.

Heaps of apps store their settings and data there.

So their apps can be stateless as all the data is kept on the client store! No database upkeep required.

 

If its a Web app and such you can store metafields against a page as well.

0 Likes