Windows Phone 7 released in March supports data access in the following ways: XML, isolated storage [independent storage], and cloud [cloud storage]. Windows Phone 7 does not have local database APIs available. Windows 7 phone local data storage Community already has several solutions, window phone MVP Lin Yongjian blog on Windows Phone 7 local database selection list SQLite, siaqodb and other databases. The rapid repository introduced here is a document database (nosql) developed based on Windows Phone 7 independent storage. The advantage of document databases over relational databases is that you do not need to create a schema, tables, stored procedures, and other relational database objects. You only need to define your object according to your needs and save it to the database. You can operate the database in the way of LINQ.
Rapid repository is an open-source project based on the Apache 2.0 protocol and has released version 1.0. Interested readers can download it from http://rapidrepository.codeplex.com. Support for view/index models will be added in the next version to improve query performance and transaction support. The author's blog has a series of tutorials:
- Introduction: introduces the principles and features of databases.
- Install rapid Repository: Use the Windows Phone 7 SDK and reference rapidrepository in your project. DLL, your root object implements the irapidentity interface, and your repository inherits the generic class rapidrepository <>.
- Create, read, update, and delete operations: rapidrepository already contains a series of methods to help complete database operations. It fully supports data query using LINQ.
- Greedy loading: all data is loaded to the cache when the background process is started, and all queries are carried out in the cache, which is very fast, if the cached data has not been fully loaded, the queried data is deserialized directly from the independent storage. You can also set the object to not use the cache, so that the data queried each time is deserialized from the independent storage.
The original article was published on infoq: Windows 7 phone document database rapid repository officially released