views:

442

answers:

8

i have a desktop application that talks soap to a server. the communication is very slow so i want to download a lot of the data up front and query from my local database. i wan this local data to persist after the application shuts down so what is the best way for doing this . . . are there any good products / examples to do this . . there are about 25 tables that i am caching.

+12  A: 

SQLite is perfect for this. A couple years ago I wrote a "smart client" application where I maintained a local cache so that users could still use the application offline. I used SQLite and had no problems, it is very small, persists quickly, and most modern ORMs support it. (I was using NHibernate)

http://www.sqlite.org/

James Avery
SubSonic supports it too.
flipdoubt
+1  A: 

The H2 database might also meet your needs. Microsoft offers a compact edition of SQL Server: SQL Server Mobile Edition. If SQL Server and TSQL is your thing, this might be a good choice.

Todd Stout
I have been successfully using H2 in .Net via IKVM. The H2 docs have a brief section on this in the Advanced section.
Todd Stout
A: 

Consider using Firebird, I believe they have a ADO.NET extension too.

Arcdigital
+1  A: 

You could always use an Access DB, usually pretty simple to ingereate with in .NET app and doesn't require any server to be installed or configured on the client.

schooner
A: 

I would consider SQL Server Express or even SQL Server Compact Edition, which operates on individual database files, like Access does. Despite this, it's still SQL Server.

John Saunders
I would stay away from SQL Server Express since setup and deployment is still a nightmare. SQL Server Compact Edition is a good choice as well though.
James Avery
Nightmare is in the eye of the beholder. And are you talking about 2008? I just installed SQL Server 2008 Enterprise Edition with all the pieces, in about five minutes of user interaction (plus about half hour of waiting for it to finish). That was the _Enterprise_ Edition. I expect a shorter install for Express. And that's without a response file to do it without prompting.
John Saunders
The question is about using a local database, so you would have to require your customers to install SQL Server Express. You can include it in your installer but it adds alot to the size, and there are issues about if another application has already installed SQL Server Express or if the user already has SQL Server installed (like you do)
James Avery
I'm a fan of SQL Server, but SQL Server Compact has some rather severe limitations regarding basic T-SQL support. There are enough restrictions that I do not think I could use it for an off-line data store for my standalone desktop apps that could later sync up with a central server. Yes, you can use it for this, but only if you limit your T-SQL to a tiny subset of the norm.
Todd Stout
@James: I'd suggest the installer install a dedicated instance of Express, with an instance name based on the name of the application being installed.
John Saunders
+2  A: 

Berkeley DB is a good, standalone DB. You should also consider ESENT, which is built into windows. Here's a write-up by Ayende.

Ryan Emerle
A: 

You could also consider Apache Derby, which is used in Sun's Glassfish Java EE server.

Jim Ferrans
A: 

Take a look at siaqodb - http://siaqodb.com. Is very fast and simple to use, you can persist objects with one line of code and retrieve back via LINQ

sqo