Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7603585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:41:40+00:00 2026-05-30T23:41:40+00:00

I have an app and it needs to store a few simple objects that

  • 0

I have an app and it needs to store a few simple objects that change, and it needs to be able to persist them. Should I save the data to a db like mongo and read it in on startup or should I just save to a json file?

Thanks for any tips.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:41:41+00:00Added an answer on May 30, 2026 at 11:41 pm

    Either way can work. ‘It depends’ which is best in your situation.

    Things to consider:

    • Flat files are not (or not easily) queriable.
    • You will have to manage flat files (e.g. folders, file names, etc)
    • Is it possible that there will be a collision? Are you going to read & write often?
    • If you are only persisting a few objects, is a database like mongo overkill?
    • Is something like redis a better solution?

    I’m currently working on a project that involves several data stores. MySQL, flat-files, mongo, et cetera.

    The flat files work really well for storing data that will be pulled up later. It’s suitable for data that isn’t read or written often.

    Mongo has modules like Mongoose that take away a lot of complexities. But the documentation for both Mongoose and Mongo can be a bit dry and confusing.

    Think about how the data will be used, how it will evolve, and if you need to query it. If it just needs to be pulled up at the app’s startup, then a flat file can work. If it is going to grow into larger objects then flat files can still be the solution. But if there’s a chance for additional objects in the future, then flat-files will become harder to manage, and it will be a pain to add them into a working system.

    And overall, if you want any type of querying (other than manually opening files and inspecting them) then go with Mongoose or a similar database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an app that needs to be able use either an sqlite3 datebase
I have a few data values that I need to store on my rails
I have some things in my app that I need to store, in order
I have an app that needs to open a new window (in the same
I have an app that needs to handle very large strings between a SQL
I have an app that needs to check a database table every minute. The
I have an app that needs to read a PDF file from the file
We have an app that needs to access network resources. It's written in VB.Net.
I have a console app that needs to display the state of items, but
I have a graphical app that needs to test the resolution of the display

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.