Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
My Carrier: MTN
Accepted Solution

using PersistentStore or sqlite to cache feeds from server

Hi everyone ?,

I am retrieving feeds from my server at intervals lets say 5 mins and i want to be able to cache this feeds from the server (data interchange is json) , now i am confused will it be wiser to use the sqlite way to store this data or i use the persistentstore , my confusion is the size of the persistent vector against the size of the sqlite database and also performance and efficiency in reaad and write operations , thanks .

Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: using PersistentStore or sqlite to cache feeds from server

Some questions to assist in this decision:

a) does it need to be persistent?  In other words, does it need to survive a device restart?

b) How much data are we talking here? > 1 MB? > 10 MB? > 100 MB?

c) How active is this - is it used in every screen interaction or just once at the start?

d) Does this need to survive the user swapping their SD Card?

Developer
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
My Carrier: MTN

Re: using PersistentStore or sqlite to cache feeds from server

Hi peter , thanks for your response I am answering according to your question list above
A) Yes it has to survive a device restart
B) @ least 5mb
‘C)once I get the feeds from my server that is every 5 mins I should be able to cache the feeds
D) not really
Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: using PersistentStore or sqlite to cache feeds from server

Downloading 5 MB every 5 minutes seems like quite a lot.  But maybe I am old fashioned.

 

If you are just processing it as a sequential file, you could just stick it on the SD Card yourself,  This will be faster but much less flexible than SQLite.  . 

 

For a file of that size, I would not put it in persistent store if this was for general consumers who might have small Curve devices.  But if you are targeting this to the high end recent phones, then 5 MB is not a worry, and it would be a lot easier. 

Developer
Posts: 132
Registered: ‎10-25-2011
My Device: Tour 9630
My Carrier: MTN

Re: using PersistentStore or sqlite to cache feeds from server

Thanks peter , I am working on d db already