views:

713

answers:

4

What is the difference between SQL CE and SQLite? In what situation would i choose one over the other?

A: 

They are two competing database engines.

SQL Server Compact is from Microsoft, and is a stripped-down version of SQL Server.

SQLite is an open-source, in-process database engine.

SLaks
SQL Server Compact also runs in-process.
Matthew Flaschen
A: 

Comparison here - seems SQLite is smaller, faster and cross platform but SQL CE is easier to integrate into .Net using the visual studio design tools

Martin Beckett
Where did "easier to integrate into .Net" come from? There is a ADO.NET provider for SQLite available.
Ignacio Vazquez-Abrams
-1 for easier to integrate into .NET. The SQLite .NET wrapper is wonderful and allows you to very easily write custom functions in .NET and since it runs in-process you can do really neat things like call out to your .NET app from a query.
Sam
I've used System.Data.SQLite, and it Just Works.
Matthew Flaschen
You can write pretty much the same code - but I thought you could just drag and drop links between SQL-CE and .Net languages in VS?- sorry i'm a C++ / SQLITE user
Martin Beckett
@Sam: he said it was easier to integrate , but didnt say that sqllite was hard.
Karim
+1  A: 

SQLite is wonderful. The entire database engine is encapsulated into a single DLL, has great SQL support, and is super fast. There are a few .NET wrappers but the best one is here.

http://sqlite.phxsoftware.com/

This provides very good .NET integration including the ability to very easily write custom functions (both scalar and aggregate) within .NET. Also since SQLite runs in-process you can call out to your .NET application directly from a query--not recommended for most situations, but occasionally is very helpful.

Also since SQLite is a single dll distributed with your application, you update it as you would your own application and never have to worry about a user having a different version installed or missing an update.

It also requires zero maintenance. You can optionally run a VACUUM once in a while depending on your usage pattern, but you can also turn on AUTOVACUUM.

Additionally since the database files are stored as just one file, it's very easy to copy databases and read in their data for debugging/testing.

Sam
+2  A: 

As said above SQLite is wonderful!

Its fast lightwieght and ultra reliable.

There are a couple of constraints. It does not scale to mega-size as the whole database is contained in a single file and you are restricted to the largest file/filesystem your OS will support, even so this is good for a at least a terabyte on most OSes. The other constaint is locking; sqlite knows only one locking mode which is to lock the entire database, its OK for a multiuser system where most people are only reading the database but as soon as you get several users trying to update the DB at one time you will hit deadlocks and timeouts. These restrictions stem from SQLites roots as a database to be implemented on small embedded systems and no other database I know of scales down so well.

James Anderson