Best Practice To send Big JSON Data to Node JS

289
February 12, 2018, at 08:23 AM

Node js : I am taking a survey which have 21 question init and answer should be in written text so the Json became very big. My question is how should I send my data to the backend should I send the whole JSON or I should store it in the file and then send it what is the best practice for this ? (Front End : JQuery And Backend : NodeJS )

Answer 1

Define "very big". Cause I seriously doubt that your users will write answers that weight more then say 50Kb. Note that average kindle ebook weights ~2.5Mb with ~300 pages (https://www.quora.com/What-is-the-average-file-size-of-an-e-book). And even this size is not really big for a request.

Anyway, to improve UX it is worth considering splitting the survey into multiple pages and sending each page to the server one-by-one. For that you have to store those pages on the server side of course (possibly with timeouts in case a user decides he won't continue).

Rent Charter Buses Company
READ ALSO
How to test multivariable in one assertion

How to test multivariable in one assertion

I have two variables A and B and either have to be greater than 5

170
Evnironment set up for angular-ui-router + browser-sync + gulp in Ubuntu 16.4

Evnironment set up for angular-ui-router + browser-sync + gulp in Ubuntu 16.4

I want to setup an environment for angular-ui-routing + browser-sync + gulp

152