What is a viable local database for Windows Phone 7 right now?
I was wondering what is a viable database solution for local storage on Windows Phone 7 right now. Using search I stumbled upon these 2 threads but they are over a few months old. I was wondering if there are some new development in databases for WP7. And I didn't found any reviews about the databases mentioned in the links below.
- windows phone 7 database
- Local Sql database support for Windows phone 7
My requirements are:
- It should be free for commercial use
- Saving/updating a record should only save the actual record and not the entire database (unlike WinPhone7 DB)
- Able to fast query on a table with ~1000 records using LINQ.
- Should also work in simulator
EDIT:
Just tried Sterling using a simple test app: It looks good, but I have 2 issues.Creating 1000 records takes 30 seconds using
Then I discovered there is adb.Save(myPerson)
. Person is a simple class with 5 properties.db.SaveAsync<Person>(IList)
method. This is fine because it doesn't block the current thread anymore. BUT my question is: Is it save to calldb.Flush()
immediately and do a query on the currently saving IList? (because it takes up to 30 seconds to save the records in synchronous mode). Or do I have to wait until the BackgroundWorker has finished s开发者_开发技巧aving?Query these 1000 records with LINQ and a where clause the first time takes up to 14 sec to load into memory.
Is there a way to speed this up?
Here are some benchmark results: (Unit tests was executed on a HTC Trophy)
----------------------------- purging: 7,59 sec creating 1000 records: 0,006 sec saving 1000 records: 32,374 sec flushing 1000 records: 0,07 sec ----------------------------- //async creating 1000 records: 0,04 sec saving 1000 records: 0,004 sec flushing 1000 records: 0 sec ----------------------------- //get all keys persons list count = 1000 (0,007) ----------------------------- //get all persons with a where clause persons list with query count = 26 (14,241) ----------------------------- //update 1 property of 1 record + save persons list with query count = 26 (0,003s) db saved (0,072s)
You might want to take a look at Sterling - it should address most of your concerns and is very flexible.
http://sterling.codeplex.com/
(Full disclosure: my project)
try Siaqodb is commercial project and as difference from Sterling, not serialize objects and keep all in memory for query.Siaqodb can be queried by LINQ provider which efficiently can pull from database even only fields values without create any objects in memory, or load/construct only objects that was requested.
Perst is free for non-commercial use.
You might also want to try Ninja Database Pro. It looks like it has more features than Sterling.
http://www.kellermansoftware.com/p-43-ninja-database-pro.aspx
精彩评论