Android database storage formats appropriate for JavaScript access -


i'm developing android application, typically small database (hundreds thousand or main entries, plus similar order of magnitude in joined tables) populated user. there file associated each main entry, kept separate, , not part of question.

in current prototype, structured data stored in sqlite database in usual way, , synced between devices uploading file application folder on google drive. allows me avoid having provide user storage, hope stick to.

storing files here has happy side effect can access them via javascript code in web page using google drive api. javascript interacting remote sqlite file incredibly ugly thing attempt. (downloading database server-side , handling there option sounds not great either.) wondering if has recommendations of best practice approach here, given have web-based version of app accessing same data.

the obvious sensible idea seems be

exporting sqlite other structured format xxx (like xml, json, csv, ...) first, uploading xxx file google drive, javascript can straightforwardly interact it, , on sync reimporting xxx data sqlite.

though i'm happy hear criticisms/improvements on idea.

i'm interested in best-practice recommendations of efficient ways approach these problems. question: what file format xxx good; , have recommended methods (a) exporting , importing in java sqlite xxx, (b) interacting in preferably client-side javascript remote google drive file in format xxx? (if maintaining server-side code interact xxx substantially better practice say.)

it depends on how many clients app manage

exporting sqlite other structured format xxx (like xml, json, csv, ...) first, uploading xxx file google drive, javascript can straightforwardly interact it, , on sync reimporting xxx data sqlite.

imho, quite bad idea quite few reasons:

  1. if multiple users try change data @ same time, have tough problem managing data entries , possible conflicts
  2. providing direct access data layer bad idea since client can wipe out data

if have few users or making personal project, can stick sqlite.

kripken, developer of emscripten (the c/c++ javascript llvm compiler) has compiled sqlite library javascript make sql.js library. can find on github. there's demo page of sql.js

but if have lot of users, might want use firebase google. gives database , rest api use it. there libraries access firebase different programming languages too.

cheers!


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -