lundi 23 décembre 2019

What are the Pitfalls of Using Static JSON Files for Frontend Data?

Let's say I have some data, members. Each member has a name:string, birthYear:number, favoriteBook:string, and an id:number.

I make a JSON file that includes all the members along with each member's data. The JSON file would be deployed along with the HTML, CSS, and JS of the site. The scripts would include and parse the json, then display in HTML. If I wanted to make changes to the data, I would update the JSON and redeploy using cache controls to assure users receive the latest data.

What pitfalls would arise from using a static JSON file that I parse and display, instead of a traditional REST API?

Off the back my concern would be scale, but if I don't intend to have too much data, would this be a problem? In that case, what would be my limitations?




Aucun commentaire:

Enregistrer un commentaire