I'm building a single page application which will run on your average tablet, so resources aren't too extensive.
I'm thinking about initially retrieving all the data needed for the application and storing it in TaffyDb--local javascript database--and querying locally, rather than contacting the server every time a user elicits an event handler.
I was wondering which one would be better in terms of speed/memory. All data stored on TaffyDb locally, or retrieving the pertinent information each time it is needed. The data is simple JSON objects, 10 at the most.
I saw an estimation that each HTTP request costs around 40,000 machine instructions to execute. On mobiles it is even pricier I think.
But I'd rather focus on another aspect - there are four types of mobile applications:
Each case requires its own strategy. For example #3 will definitely require local DB and some synchronization means. For #2 it is enough to have some local caching with simple 15 minutes (or so) expiration time.
It seems that you tend to choose #3. You need to think about client/server synchronization then. This can be quite non-trivial on some data architectures.