views:

3636

answers:

12

I've used SQLite before as a datastore for a C# winforms application, and it was great, however, it does possess many shortcomings.

I'm aware Microsoft have a product called SQL Server Compact Edition - does this work in the same way SQLite does, and if so, is it any good?

Are there any other alternatives?

Update

By alternatives I mean in-process data storage libraries which do not require any separate install packages or standalone executables

Update 2

Many people have been asking about the perceived shortcomings of SQLite.
I'd like to repeat that on the whole I had a great experience with it, and would strongly recommend it, but a couple of things bugged me

  1. Complete lack of type safety.
  2. You need to explicitly batch multiple sql statements into transactions or the performance is abysmal.
  3. I can't remember exactly, but from memory some particular kinds of joins and subselects just fail
  4. No support for ALTER TABLE. Ouch
+3  A: 

There is berkeley db library. http://www.oracle.com/database/berkeley-db/index.html

artificialidiot
BerkeleyDB isn't really a database. It is just a disk based fast key-value lookup mechanism.
Starkii
It is still a "in-process data storage library".
artificialidiot
+1 for berkeley db
Orion Edwards
+1  A: 

I have been really impressed with VistaDB

http://www.vistadb.net/

BobbyShaftoe
+3  A: 

SQL Server Compact can be a good choice, it's free, easy-to-use.

I like it very much since it's Linq-To-SQL Compatible...

CMS
+3  A: 

There are many alternatives, depending on the amount of data, and what sort of features you need. I've used all of these and been happy with them:

SQL Express 2005/8

MS Access

MySQL

Flat files (csv, txt)

xml files

serialize objects in xml files.

Andrew Lewis
+9  A: 

I've been well satisfied with the embedded version of Firebird.

arul
A: 

Try Oracle 10g XE. It is free. It comes with a browser based management tool that is quite intuitive.

dacracot
XE is good and powerful, but not exactly lightweight solution. Especially when considered as alternative to sqlLite
Miro A.
+3  A: 

Be careful of SQL Express - it hasn't feature-stabilized yet (I can't speak to reliable-stable). Every new version is different to some degree. At least SQLite is what it is. And so is dumb-old Microsoft Access.

le dorfier
I didn't realize that. However, if you wanted to use SQL Express, you could also use the 2005 Edition.
BobbyShaftoe
FYI: SQL Express 2008 R2 has upped the size limit to 10GB.
Garo Yeriazarian
+13  A: 

My company, Telligent, has seen success with VistaDB. We ship it with our lightweight CMS product, Graffiti. It's nice because it allows easy, XCOPY based deployment. I'm sure it would work well for Winforms as well.

Also our product works well with MySQL and SQL Server 2000-2008. That says something about the ability to easily adapt your data access code that currently uses VistaDB to a larger scale database if/when you need it.

Karthik Hariharan
I don't think there's anything wrong with mentioning your company's product if it's an actual answer to the question, which it is in this case. +1 to counteract the down-vote.
MusiGenesis
Agreed, it's a valid answer.
jcollum
Offensive? Come on. He's using his product to illustrate a real-world application of VistaDB, and he's honest enough to tell us that he works on the product.
amdfan
I certainly didn't intend for my response to come off as shameless self promotion. As others said, I just wanted to show that VistaDB is a great lightweight database that powers a successful product. Thank you all for your support.
Karthik Hariharan
Thanks for sharing this, Karthik.
Lance Fisher
Just to further update this a bit, VistaDB has 100% type safety (it is C# ONLY code, no com or interop). And yes, it does support ALTER TABLE syntax. See the Advantages of VistaDB thread here on SO for more information.
Jason Short
FYI VistaDB is being discontinued... http://infinitecodex.com/post/2010/07/07/Closing-VistaDB-Office.aspx
John JJ Curtis
+1  A: 

SQL CE desktop edition is good and fast. Databases are a single file, which is good.

Oracle Lite is also good and fast on the desktop. Databases are two files, which isn't that big a deal. Distribution is a pain in the butt, though. The installer is around 500-600 MB, even though the total size of the files you actually need on a client machine is less than 5 MB (typical Oracle). You have to do some work to figure out what DLLs you need and deploy them.

I'd go with SQL CE.

MusiGenesis
+3  A: 

Take a look to this comparison: http://dotnetperls.com/Content/SQLite-Versus-SQLCE.aspx

tanathos
+4  A: 

I highly recommend h2 database; like sqllite it is an embedded database; and it is open source. It could be run in both stand along, and server modes. It also provides an in-memory capability, which may significantly improve performance. It is written in Java; so is particularly well suited for Java programs.

Neil Rubens
A: 

How much data? For small amounts, query using LINQ and serialize using XML. For more data and more features, SQLite is pretty much the way to go to keep things small.

One possible option that I haven't tried yet: http://sharphsql.codeplex.com/

Axl