简体   繁体   中英

What would be the best way to store JSON files for use within a React application?

I have a python script that fetches data twice a day from a server of mine. The script returns around 40 JSON files containing various data. The files aren't particularly big and the combined size of all the files is around 250KB.

Alongside my script I am developing a dashboard in React that renders the data from each file into a table, allowing me a visual representation of the data.

I have been looking at what would be the best way to store these files, something that allows me to upload and fetch them twice a day.

Someone mentioned to me about using MongoDB to store the files, but after some research I feel like Mongo is better at storing the contents of the file rather than the file itself. I tried to develop a solution but I couldn't figure out how it could be done when each object is stored as a document with no clear way (to me) which document came from which file.

Other options I have considered are:

  • Storing the files on the server that is hosting my React project and rendering them locally as I am doing now during development
  • Storing the files using a provider such as AWS/Firebase
  • Storing them in a different database (I see SQL now support the storing of JSON files)

Are there any other solutions that you think would work best for this scenario? If so, why?

Hello ,
Check about use of FTP server.
We have clients that send us data every 10 min via FTP that is inside XML files, then I have NodeJS back-end which read these files.
You can use it for your scenario with JSON files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM