Question

I need a lightweight database engine for a desktop application. The application is not data centric, although it needs some persistent data. Which one would you use MS SQL Server express edition or SQLite?

EDIT

Is SQL Server Compact edition free? If it is the case, what about SQLite vs SQL Server Compact edition to develop this kind of application?

Was it helpful?

Solution

Definitely NOT Sql Server Express. That's a server class engine. You want an in-process engine. In that regard, SQLite is fine. So is Sql Server Compact Edition. Both are free and either should be adequate for your needs.

OTHER TIPS

If you're working with C# and Visual Studio simply right-click on your project and select "Add Item..." and in the dialog select the "Local database", this will create a SQL CE (Compact Edition) database. It's got most of the functionality of SQL Express/Server as far as tables, data types, views but doesn't allow stored procs. It also works with Linq-to-SQL so it's a snap to integrate.

Go with SQL Server Compact - you get to use LINQ that way, which itself is worth the effort.

While SQLite is an option, you'll need to get an ORM layer, and the performance gain will be minimal / non-existent compared to SQL Server.

Firebird is a well known database and support the latest Microsoft framework

SQLite, especially if it's single-user. One data file and one DLL.

If its a single user system you want to look at MS SQL Server compact edition not Express (see here: http://www.microsoft.com/sqlserver/2008/en/us/compact.aspx )

Compact Edition is an embedable database similar to SQLite.

Unfortunately I can't make a recommendation either way.

What about MS SQL Server Compact?

Some love for one of the up and comers in the .NET embedded db world -- VistaDb. The license is a bit more restrictive than Sql Server Compact (free to single developers only), but its a 100% managed DB with xcopy deployment and has VS tool integration.

Be aware that if you use SQL CE along with EF, you will have to generate your own id key, because SQL CE does not support multiple query.

i.e: insert -> select key for the entity -> not good

generate and id key (GUID or something else) add it to your entity and then insert -> good

Defo SQL lite, although it has some restrictions/features that you should be aware of

if your need is data centric, what you really need is a file, if you need transaction (ACID) then your need is (rdbms) database.

Otherwise you'll have issues when up scaling.

If it's not a lot of data, and you don't need to run complicated queries (although LINQ can), why not use an XML Dataset? That way it's platform independent (could run on Linux with Mono) and doesn't require the user to install extra resource hogging software.

I use XML Datasets extensively for applications that require persistent data storage of small amounts of information. If it's only a few variables, you can also use a settings file, and it will be stored either per application or per user depending on your choices.

Think about overhead for your end users ... SQL Server Express still takes up resources, takes time to start up on a reboot and so on. For a small amount of single-user persistent data I would go with SQLite. Unless you're doing serious binding and so on you won't need an ORM between you and it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top