11-17-2011 05:34 PM
Hello,
I am developing and application for which I am fetching a JSON object from a remote server. Rather than fetching the this data everytime on demand I would like to keep a "cache" of this data as long as the application is in use( don't need it when exiting application). I am worried however about memory and performance issues as I would prefer that for every "request" for the data that a cache of it be stored for when needed( in cases such as pagination, reloading).
I'm considering using Lawnchair however I note blackberry's openDatabase and wonder which is more effecient/...
using a JSON/ DOM object storage or openDatabse SQLlite?
11-17-2011 07:45 PM
I'd probably use the SQLite option due to somewhat severe memory issue in WebWorks apps. There will be a slight performance trade-off versus the object, as it will take a little bit of time to call the database, but it's better than crashing when you run out of memory!
11-17-2011 10:44 PM
shnuffy wrote:I'd probably use the SQLite option due to somewhat severe memory issue in WebWorks apps. There will be a slight performance trade-off versus the object, as it will take a little bit of time to call the database, but it's better than crashing when you run out of memory!
Wow! that bad huh?
11-18-2011 12:14 PM
Ok here is another question that I need advice on...
The fetched data json objects are used to iterate over in order to display master/ details recrods sets.
Would it be effecient to
11-22-2011 11:54 AM
Hi icecappacino,
Lawnchair is still a viable choice and I've never heard of LocalStorage crashing the app. Plus you can use LawnChair to use SQL database in the background.
button below the post(s)11-22-2011 04:08 PM
11-22-2011 04:28 PM
Hi icecappacino,
Lawnchair by default uses localstorage (which is not present on OS5), but you could use the gears-sqlite adapter for 5.0 (this makes the most sense to me). It does require an SD card but in reality I don't believe thats a large limitation.
Plus you can always use some of the other adapters as well should an SD card not be present.
button below the post(s)11-22-2011 04:33 PM
11-23-2011 11:11 AM
The "straight" HTML5 SQLite (WebDB) on OS5 uses the SD Card. I believe this is done through the Google Gears bridge.
11-24-2011 04:45 PM
Shnuffy is correct about how it works, and yes icedcappucino, using plaing HTML5 SQL databases will be faster than lawnchair.
But lawnchair is pretty small (3.4k minified) and if thats where you feel more comfortable I wouldn't expect a HUGE performance hit. Plus its even smaller if you exclude all the unecessary adapters.
button below the post(s)