How can I create and save a database in JavaScript?

Topic summary

How to store form data in a Shopify app and what database to use.

Key points:

  • There is no required database for Shopify apps. You can use any backend database (e.g., MySQL, MongoDB, SQLite) based on your needs and familiarity.
  • The provided sample app (Product Reviews) persists data using Shopify metafields rather than a traditional database.
  • Metafields are custom fields attached to Shopify resources (e.g., products, orders, shop) that can store app-specific data within Shopify.
  • Some official tutorials demonstrate SQLite for simplicity, but the choice is platform-agnostic and depends on your architecture and persistence needs.

Outcome/next steps:

  • The asker acknowledges they can use MySQL or MongoDB and plans to investigate and implement storage via Shopify metafields.

Status:

  • Issue appears resolved with guidance provided and a clear next action (explore metafields).
Summarized with AI on February 5. AI used: gpt-5.

Hello.

We are currently copying the sample application here and have even been able to complete the form.

URL

I would like to save the information entered in the form to the database, but I have not been able to do so by trial and error.

Also, I would like to know what type of DB to use when creating an application. (mysql,mongodb,sqlite…)
If you have any tips, please help us.

This statement was translated using DeepL.

use whatever database you want to on your apps backend.

There is no prescribed database system.

If you need to retain data in your system use whichever database systems your software requires or you know how to use.

The example app just uses metafields for the data layers.

https://github.com/Shopify/product-reviews-sample-app/blob/main/docs/technical-details/data-layer.md

Some tutorials use sqlite

https://shopify.dev/apps/getting-started/build-app-example/backend

Overall this is a platform agnostic development questions, it’s an incredibly broad question better suited for stackexchange or google to work out what backend systems to use in which situations.

1 Like

Hello.

Thank you for the clear explanation.
It was helpful to know that I can use other databases such as MySQL and MongoDB.

I have never heard of meta fields being used before, so I will look into it and try to build one.

Thank you very much.