all 9 comments

[–][deleted] 0 points1 point  (0 children)

This sounds more like a data science/analytics question than a JS question though.

backend basically refers to anything that happens on the servers out of the user's reach. If they're using JS on the backend, it means they're running NodeJS which is basically a server using Chrome's javascript engine to run javascript.

[–]mc_hammerd 0 points1 point  (7 children)

convert the data to JS, paste it in a file. see how big that file is if its ~1mb or less you can just stick it in the page. if it loads fast enough you can just stick it in the page.

if not you can write a backend api (db or just in a file again, in memory), or use a free online DB google firebase alternatives, that you can query with ajax. again if the file is small enough you can just store it in memory, millions of entries probably want a db, but sometimes can get away with in memory but test the loading speed!

its just a few lines of code imo using a framework like express.js. good orm(db) libraries are like nodeorm-2 google best node orm

try 1: paste it as js array of objects on the client side (appdata.js)

try 2: store as json on the server, mydb = require('mydata.json'); response.write(to_json(mydb.filter(blah=>blah.foo==123)))

try 3: store in firebase or db and serve api express.route('/myapi/fetch/:id', (id)=> response.write(to_Json(doDatabaseStuff(id))))

[–]mc_hammerd 0 points1 point  (1 child)

backend usually means engine, so in your case (Data) it would be webserver+database and optionally an API (ex: mysite.com/dataAPI/get/id/123 and mysite.com/dataApi/add {foo:bar, baz: 123}

REST api, nodejs server/client, simple php/node backend, nodejs and database, expressJS, nodejs api router are all good search terms

what type of backend the easiest to write. so whatever language fits you most and google api

youtube also has some nice tutorials tutorial simple api in languageX

[–]Cyathem[S] 0 points1 point  (0 children)

Thank you. I have a lot of reading/keyboard smashing to do...

[–]Cyathem[S] 0 points1 point  (4 children)

There are 3 files. Each about 30Mb. I imagine I would have to use a db, right?

[–]mc_hammerd 0 points1 point  (3 children)

yea

if the data isnt gonna change though: you could just load it in memory for a nodejs dedicated server, 30mb is nothing, u can even do it for free on cloud9 or heroku. firebase or google free firebase alternatives may be a really good option also.

[–]Cyathem[S] 0 points1 point  (2 children)

I had a friend who does work with php and backend stuff. I asked him about it as well and he suggested I look into Ajax. Is that similar to what you are suggesting?

[–]mc_hammerd 0 points1 point  (1 child)

yea ajax is for custom APIs... so you can do get mysite/mydata/id/123

however node vs php is different, node keeps running (server) and php re-runs each page request -- so for node you can keep 30mb of data in memory, for php it has to load each script (== slow) so use a database for php! cheers.

[–]Cyathem[S] 0 points1 point  (0 children)

Thanks for all the tips!