1

I need to store data for a native mobile app I'm writing and I was wondering: 'why do I need to bother with DB setup when I can just read/write a JSON file?. All the interactions are basic and could most likely be parsed as JSON objects rather than queried.

  • what are the advantages?
Dmitriy_I
  • 65
  • 5
  • 1
    How much data are you planning on storing? Making changes to a JSON file requires reading and re-writing the entire file, whereas (post-dBase) database files use a _paged file structure_ which allows for incremental updates without rewriting the entire file, which matters even on modern hardware once you go beyond a megabyte or so... – Dai Jun 15 '22 at 02:28

1 Answers1

1

DB are intent to work with standardized data or large data sets. If you know that there is only a few properties to read and it's not changing, JSON may be easier, but if you have a list of items, a DB can optimize the queries with index or ensure consistency through multiple tables