user3214545
user3214545

Reputation: 2213

Store JSON locally versus on server

I am currently developing a web application that has to deal with a lot of json data to draw various things on a map e.g Polygons and Points. I also have json data drawing charts. At the moment I have the data locally but wondering is this the best way when dealing with a lot of data?

Is it better to store it in a database on a server and request it? Or if its better to store it locally, should I be using things like local storage or something else?

I don't have any need to update any of the json, simple retrieve it.

I want to do it in a performant way so not sure which is better

Would really appreciate some advice

Upvotes: 0

Views: 710

Answers (1)

Todd
Todd

Reputation: 3103

The short answer is - there is no best way, as it depends on the purpose of your application and the data youre considering.


This depends entirely on the purpose of your application, and your examination of the cost/benefit of having data persisted on a server.

Ask yourself questions like the following:

How long do you need this data to persist?

How expensive is it for you if you lose the data?

What other options do you have at your disposal? Have you considered NoSQL solutions or cloud-based memory storage of any sort?

How much data do you plan to store?

How often will you be retrieving the data?

In exactly what format do you want to store and retrieve the data?

What options are you looking at in terms of a server for storing persisted data?

You mentioned local storage - is the data only relevant to a current user/session, or is the data relevant to yourself or other users? If the latter, then local storage may not be adequate. It is, of course, much cheaper than other options to persist the data.

If you are going to go with long term persistence, then check out PostgreSQL's latest features for JSON data types.

Upvotes: 1

Related Questions