Windows Store apps and the database question
With traditional desktop apps the requirement for onboard data, roaming data, data synchronization, etc. has been answered long ago. For Windows Store apps developers, at times, wonder about what path to take when it comes to storing data locally.
- Do I roll my own ?
- Do I leverage Isolated Storage ?
- Do I use the Roaming Folder?, etc.
You can certainly write your own! but there is always the question of time/effort vs. return. – Unless that is what you set out to solve to begin with. Isolated Storage could play a role with a do it yourself approach.
Roaming Folders is something some developers have looked into as a mechanism that ‘could’ be used as a building block. The ApplicationDAta.RoadmingFolder can do thing like syncing between devices. Unfortunately there are some limitations with things like size.
Luckily, we have SQLite which offers primitives to do basic database processing on the device. This article goes into some detail about it building a Windows Store app with SQLite.
So how do we go about things like data synchronization?
From an application architecture point of view your application will work best if instead of relying on local storage (roaming or not) the solution relies on a cloud solution. Azure is designed precisely for this type of situations. Particularly the Mobile Services. This MSDN blog post explores adding cloud to apps with Azure Mobile Services.
The cloud solution has a absolute dependency on network availability so for scenarios where you want to address this in the app you may be back to square one for having to account for synchronization from within your app. For this scenario you can still rely on SQLite locally and ensure time stamping of the records so you can sync them later when the cloud service is back accessible from the device.
How have you address data requirement for your apps? Comment below.
THE TOOLS DEPARTMENT
free/trial tools for developers
- Think blue sky with Azure free trial
- Freedom of Expression with Visual Studio Express 2012
- Tools and SDKs from the Windows Developer Center
- A 30-day Windows App Adventure