Simple Example / Best Practice for InMemory + Isolated Storage

Apr 11, 2011 at 6:02 PM

Hi - I'm just trying out the newest build and I was wondering where, if there is one, I can find the best example for you recommended approach of having both a persisted Isolated Storage DB and then use an in-memory cached version.

I plan to store a compressed local persisted version on the client's machines but then use the In Memory Cache version while active.

I want to do something along the lines of:

Start Application -> LoadMemoryDB with items I know I'll need from PersistedDB

-> Some sort of check that no lookup code lists etc. have changed on the serverDb

           -> Update LocalPersistedDb, update MemoryDb()

LoadBOAbc() -> GetDataFromMemoryDb -> Not there -> getDataFromPersistedDb -> Not there -> getDataFromServer() -> UpdateMemoryDb() -> return data

UseData -> Save -> UpdateMemory -> BackGroundThread ->UpdateServer() -> UpdateLocalPeristedDb()

If a large BO then Flush from Memory Cache

So really my questions are around the best way to manage the two active DB's (drivers???) at the same time and keep them in sync etc.  I don't suppose that is a magic flag to 'keep in sync' ?