How do I store JSON data on a disk?

后端 未结 4 1329
日久生厌
日久生厌 2021-02-08 08:25

I am totally new to JSON and I might need to use it in the future so I did some reading bout it. There\'s lots of questions regarding JSON on SO. I found heaps of articles using

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-08 09:21

    JSON is an interchange format. You can store it in a file or a DB if you want, just like any other format, though whether that's a good idea depends on exactly what you're doing.

    You say "So far my source csv file is 235KB in size with about 700lines (nodes/leaves)". Are you considering switching from CSV to JSON? (You don't really say.) You also say "The number is going to grow let's say every week by 5-10". Neither CSV or JSON are really optimal for large files that will have incremental changes applied, except with CSV you can append data efficiently. If appending is all you're doing you could stick with CSV, but if you need to do other modifications, I'd probably decompose the data into a DB so that updates could be made efficiently.

    Actually, the amount of data you're talking about is pretty small, and with such a small number of updates per week, you probably don't need to worry about efficiency. Do whatever you want. :-)

提交回复
热议问题