Ad

Is It Better To Embed A CSV File Or Connect To MongoDB In Webapp?

- 1 answer

I am building a Shopify App and need access to about 290 records that are in a .csv file. The merchant will use these to look up standard product codes and map an item id to their shopify product.

I am still learning and wanted to know if it was better to store this data in a database like MongoDB and access it from within the webapp or should I load it and use it on the fly through a library or .csv import parser.

Any direction on the best way to solve this would be appreciated.

Ad

Answer

If the data present on the CSV stay the same it's ok to use it as it is, but if you plan to add new records or modify some of them it will be best to use a database instead.

The best usage of a database is for serving dynamic content (a.k.a content that will be modified often).

You will need to choose based on your case at the moment, if it's static data - static csv file will do, if it's dynamic data - database.

Ad
source: stackoverflow.com
Ad