What is a good choice of database for a small .NET application?

MongodbSqliteVistadbEloqueraDatabase

Mongodb Problem Overview


I'm developing a small application with C# in .NET and I want to have a small light weight database which does not use much resources.

Could you please list some of the best known light weight database softwares.

Mongodb Solutions


Solution 1 - Mongodb

14/06/2016 Yep... still getting upvotes :-/


17/03/2014 I'm still receiving upvotes for this, be mindful of the date this was originally answered. Though the main three items listed are still entirely viable, the list will tend towards becoming stale. There are further database technologies available that are not listed.


You have a couple of immediately recognisable and free options:

The SQL Server Compact download comes with the ADO.NET provider that you will need to reference in code. The SQLite download might not have it so here is a link:

http://sqlite.phxsoftware.com/

All three use SQL, though likely with a few limitations / quirks. Management Studio works with Compact and LocalDB, whereas with SQLite you will need another UI tool such as SQLite Administrator:

http://sqliteadmin.orbmu2k.de/

There are NoSQL alternatives, such as:

Personally I would avoid using MS Access in the face of other free options. You cannot go wrong with LocalDB, Compact, or SQLite. They are all lovely small databases that run relatively quickly in little RAM - personal preference as to the religious aspects about liking a Microsoft product I suppose :-)

I use Sterling for Windows Phone programming as it is built to use Isolated Storage. I have only seen articles on RavenDb, but I can tell you that it is a JSON based document storage framework.

Not to confuse the situation (go with SQLite, SQL Server Express LocalDB, or SQL Server Compact Edition), but there are other embedded / local databases out there, some are relational others are object-oriented:

Not all of these are free. SQL / LINQ / in-proc support differs across them all. This list is just for curiosity.

There is now also Karvonite, however the code gallery link is broken. When it's live again I'll be looking into this one for WP7 development.

Solution 2 - Mongodb

I'd recommend http://www.sqlite.org/">SQLite</a>;. We are using it for almost all of the apps we develop where I work.

It's small and compact. It does require a DLL to be in the app directory, but you don't have to have other software installed like Access or SQL Server. Also, as stated by danielkza below, "SQLite is public domain, so you don't have to worry at all about licensing." That can really make a big difference.

You can use https://system.data.sqlite.org">System.Data.SQLite</a> or http://code.google.com/p/csharp-sqlite/">csharp-sqlite</a> to access it in a C# app using the same methods as that of SQL or OleDB.

You will also need an application to edit/manage the database. The best one in my opinion is http://sqlitestudio.one.pl/index.rvt?act=download">SQLite Studio. Here are a couple more:
http://sqliteadmin.orbmu2k.de/">SQLite Admin
http://osenxpsuite.net/?xp=3">SQLite 2009 Pro (bottom of the page)
Update - 7/25/11 - https://stackoverflow.com/questions/1507506/what-are-good-open-source-gui-sqlite-database-managers">More SQLite apps (question here on SO)

Here's more on SQLite:
http://en.wikipedia.org/wiki/SQLite">SQLite on Wikipedia
http://www.sqlite.org/famous.html">Companies that use SQLite

Custom Functions: As an addition, if you are looking in the http://www.sqlite.org/lang_corefunc.html">SQLite Core Functions and don't see one you like, you can create your own custom functions. Here are a couple of examples:
https://stackoverflow.com/questions/172735/create-use-user-defined-functions-in-system-data-sqlite">From SO
http://www.ivankristianto.com/software-development/visual-studio-net/howto-make-user-defined-function-in-sqlite-ado-net-with-csharp/957/">Anoter example

Solution 3 - Mongodb

Firebird embedded can be a good choice

> The embedded version is an amazing variation of the server. It is a > fully featured Firebird server packed in just a few files. It is very > easy to deploy, since there is no need to install the server.

There is some very good dot net drivers

Solution 4 - Mongodb

SQL Server Compact if you want to use the official microsoft solution. This has the advantage of being able to use replication with SQL server if you need that sort of thing.

SQLite if you want to somthing very simple small and free. This is what android uses for it's internal databases so it is very well supported and there are very good .NET bindings available.

One distinct advantage of SQLite is that it is cross-platform. So if you wanted to port your application to Mono.NET then you wouldn't have any modifications to make to the database implementation.

I do not like MS Access for this solution but a lot of people have included it in their answer. It is limited due to the proprietary format and platform dependence. It does have it's advantages though. You can manipulate data easily if you have a copy of MS Access, you can build queries graphically and create macros. You can easily integrate it with the rest of MS Office.

Out of all these SQLite would be my recommendation due to it being so compact, well documented and supported by a growing army of fellow developers regardless of platform.

EDIT

I realized that there is another option that everybody here forgot to mention

So long as you don't need relational tables you could use CSV file read as a dataset via ADO.NET. (More of a lulz suggestion than anything else but would be suitable in some cases and doesn't require additional libraries for a MS deployment.

Solution 5 - Mongodb

If you are building a project with .NET 4.0.2 or greater and want embedded database support, consider SQL Server Express LocalDB.

It's a relatively new addition to the Express family that features a smaller installation footprint and reduced management overhead (when compared to other editions of Express), yet it maintains the programmability aspects of SQL Server. That is, unlike Compact Edition, LocalDB does not require the installation of a separate ADO.NET provider to communicate with SQL.

See the following for more details:

SQL Express v LocalDB v SQL Compact Edition (MSDN Blogs)
SQL LocalDB vs SQL Server CE (Stack Overflow)

Solution 6 - Mongodb

Solution 7 - Mongodb

You could use Sql Server Express Edition as its free and is equally powerful until and unless you want functionality like mirroring etc. Have a look at this.

Solution 8 - Mongodb

I've used db4o with success.
File based, large community, simple to use.

http://www.db4o.com/

Licensing Details

> Free General Public License db4o is licensed under the GPL by default. > > The GPL license is ideal if you plan to use db4o in house or you plan > to develop and distribute your own derivative work as free software > under the GPL as well. > > Commercial License A commercial license is required if you want to > embed db4o in a commercial non-GPL product. Commercial licensees gain > access to premium services and support.

Solution 9 - Mongodb

An alternative that hasn't been mentioned if you don't require it to be a free database is VistaDB. It's all managed code, provides tons of features for an embedded database, and offers pretty good performance. A pretty good bridge between SQL CE and SQL Server Express since the majority of your VistaDB stored procedures will run without modification in SQL Server Express. I've been pretty pleased with customer service at this point as well. I've been using it at work. No services to start. An empty DB is around 1MB and the DLL is pretty lightweight too. Has ADO.NET providers and such things. I liked it a good bit.

VistaDB

Solution 10 - Mongodb

SQL server Compact Edition best as it is free and Light in Size and integrates Well

Solution 11 - Mongodb

SQL Server Express or MS Access

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionePezhmanView Question on Stackoverflow
Solution 1 - MongodbAdam HouldsworthView Answer on Stackoverflow
Solution 2 - MongodbMike WebbView Answer on Stackoverflow
Solution 3 - MongodbHugues Van LandeghemView Answer on Stackoverflow
Solution 4 - MongodbMoogView Answer on Stackoverflow
Solution 5 - MongodbRobert MooneyView Answer on Stackoverflow
Solution 6 - MongodbnWorxView Answer on Stackoverflow
Solution 7 - MongodbFIre PandaView Answer on Stackoverflow
Solution 8 - MongodbJeremy GrayView Answer on Stackoverflow
Solution 9 - MongodbRigView Answer on Stackoverflow
Solution 10 - MongodbpanindraView Answer on Stackoverflow
Solution 11 - MongodbBarry KayeView Answer on Stackoverflow