user3293835
user3293835

Reputation: 899

Are there any Database solutions for Windows Runtime other than SQLite?

I have around 1000 - 5000 records and want to save them in a database for a fast access.

I used SQLite in Windows Phone Runtime, but it is VERY slow, only 2-3 inserts in a second.

I'm wondering if there even exists any other database solutions faster than SQLite?

Upvotes: 0

Views: 261

Answers (1)

Fred
Fred

Reputation: 3362

I think the answer is - in short - no.

Microsoft has dropped the good old LINQ to SQL when they introduced Windows Store apps. That feature remains available only for Silverlight apps.

So far SQLite is the only way to go (imo). But I see lots of space for optimization here. If you only manage to insert 2-3 records in 1 second the bottleneck should not be SQLite. If have written apps that use SQLite and push 10-20 records into the DB within a heartbeat.

I don't know much about your code but judging from your speed issues you must have some really complicated mappings. If code optimization doesn't help you should try to loose some atomicity and combine some nested objects for the sake of a quicker query.

Speed could also depend on the wrapper you're using. SQlite-WinRT (https://www.nuget.org/packages/Sqlite-Winrt/) is more plain SQL whereas SQLite-Net (https://github.com/praeclarum/sqlite-net) maps your objects.

You could, of course, always write your own storage. Write a JSON file per entity to the roaming settings and you can save an object and all its nested entities in parallel. If it's only writing with not much reading in between you shouldn't run into concurrency issues. JSON.Net (http://james.newtonking.com/json) is quite fast and will serialize your objects in no time.

Last but no least: you could go for a solution that saves you some insert queries: Serialize your objects to json and put them in one single table. I'd benchmark that solution before actually using it as it's not very beautiful.

But: You might want to show us your code first before pulling out the big guns..

Upvotes: 1

Related Questions