We need an Embedded Database for .NET applications - Jon Galloway

We need an Embedded Database for .NET applications

No, I'm not talking about Jet / Access. Microsoft and the general development community are moving away from it; plus, the MDAC redistributable is kinda big.

No, I'm not talking about MSDE or SQL Server Express (even though the MDF file connections are cool). Both require huge installs. Worse, they're really installing a database server on the end user's computer. That's not appropriate for a small, freeware utility - if I started intalling a freeware app and it wanted to install a 40MB database server that would run on startup, I'd cancel the intall.

I've been working with SQLite to moderate success. I'm evalutating SharpHSQL now. WATYF and Rick Strahl list some of the options out there along with their problems - none of them are really there. They shouldn't be necessary anyhow - a solid development framework like .NET should include a basic, embedable DB. Heck, it has support for IrDA End Points, how about a lightweight database?

And - No, no, no, a thousand times no: XML is definitely not what I'm talking about. .NET pushes it, but it's a terrible data storage format.

Published Friday, July 08, 2005 5:20 AM by Jon Galloway
Filed under:

Comments

# re: We need an Embeded Database for .NET applications

Check BerkeleyDB (http://www.sleepycat.com/) there are several wrappers around the net for using it with c#

Friday, July 08, 2005 2:58 AM by Ohad Israeli

# re: We need an Embeded Database for .NET applications

Perhaps MS Access

Friday, July 08, 2005 3:10 AM by Kannan

# re: We need an Embeded Database for .NET applications

Friday, July 08, 2005 4:12 AM by Michel

# re: We need an Embeded Database for .NET applications

I'll second Firebird as an embedded DB or even as a regular replacement DB.

SQLite is very nice though I do admit.

Friday, July 08, 2005 7:27 AM by Chris Martin

# re: We need an Embeded Database for .NET applications

VistaDB maybe.

Friday, July 08, 2005 8:02 AM by Paul Wilson

# re: We need an Embeded Database for .NET applications

Have you looked at running SqlCE on your Windows platform? I believe it works on CE devices as well as tablet pcs. I have been told it runs on all windows platforms, but it only is licensed on the CE and tablet pcs.

Wally

Friday, July 08, 2005 8:35 AM by Wallym

# re: We need an Embeded Database for .NET applications

SQLIMDB from Quilogic is pretty good but purely IMDB. Check www.quilogic.cc

Friday, July 08, 2005 10:46 AM by Scott Prugh

# re: We need an Embeded Database for .NET applications

Friday, July 08, 2005 11:20 AM by firebird

# re: We need an Embeded Database for .NET applications

I would offer db4o http://www.db4o.com/ for embedded database. It is very easy to use though I did not evaluated more throughly. I only used it to make a homework for my master programme.

Monday, July 11, 2005 12:08 PM by Atilla Ozgur

# re: We need an Embeded Database for .NET applications

Man... here I am on my continuing search for an embedded database, and I run across a page that links to the chronicle of my continuing search for an embedded database. :o)

Well, I've tried everything that everyone above has mentioned (all had some kind of shortcoming, be it major or minor)... but I'm in a different position than I was when I wrote the post that was linked to.

When I originally wrote that, I had been working with embedded DB's for all of about three and a half seconds, so I made a few false assumptions. One of those assumptions was that it was possible to use an embedded db and have more than one process connect to it. This goes against the inherent nature of the embedded db (duh :op)... so I gave up on that requirement. I now would just like to have a thread-safe db with a .NET provider that is available in a .NET source code, so I can put it right in my app (the latter is just preference, though... I'm willing to accept anything at this point :op).


Firebird WILL work... I actually used it as a test backend for a bit, but it requires two DLLs (the .NET provider and the engine dll) and it's larger than the other options (FB's 2MB vs others' ~250KB). Those aren’t show stoppers, though, and if none of my other options pan out, then I may go back to it.

SQLite still won't work because it's utterly non-thread safe (despite what they say) and it also requires two dlls (which isn't a big deal, but still I'm trying to find a way around that).

VistaDB costs money..... 'nuff said. :oP

db4o is an object db.... I need one to handle SQL. It also has some weird quirks like storing BLOBs outside of the database in individual files (whuh???) and since most of my objects are stored using binary serialization, I'd have a heck of a lot of extra files.

BerkeleyDB does not have a .NET provider. The Berkely XML DB does (available from a third party) but who the heck wants to use XML for data storage? :OP


So... after all that, you're probably thinking that there will be some good news, right? ......well there isn't. There is some POTENTIALLY good news, though. :o)


I've been using SharpHSQL for the last month-ish while doing improvements to my app, so at the moment, it is a functioning backend db. It is very thread safe (tested it every way from Sunday in that respect), it has a .NET provider, and it is entirely written in C#... and to top it all off, it's really small (~200KB or so compiled). So here's where you'd be asking yourself, "So what's the problem??" Well... the problem is, it's still a little buggy. The bug I mentioned in the linked post has been fixed... the .NET provider now works when storing binary data types, but other problems still exist. One of which is committing transactions. If I execute a series of SQL commands and then kill the app, the last command (or two.. or whatever) that was run is not maintained... even if I use BEGIN TRAN and COMMIT after each statement... which leads to data consistency issues (such as objects stored in the db that the user can't see because only half of the transaction "survived" the app kill). The other issue is corruption of the db that happens when killing the app. Sometimes, not always (very flaky), after killing the app, you can't open the db again... something about corruption of a cfg file. So that's a big problem... Windows locks up and the user has to force a restart, and when they get back, the backend of my app is entirely corrupted (*yeesh*). It has a couple annoyances as well that I had to get around. It uses a number of db files, one of which is a transaction log file which is a plain text file!! So you can see every single transaction being done on the database, including login... so don't bother using SharpHSQL if you need a secured backend... the user can open the log file using Notepad and see what the passwords are. :oP Anyway... the point of saying all this is... the guy keeping it up has been responsive so far in fixing every bug that I've found (which has been nice), but he's kinda stalled on this app termination issue. If he can get that bit worked out, I'd be perfectly willing to use SharpHSQL because it meets all my primary requirements and has shown good performance in the general use it's been getting over the last number of weeks.

The other potential DB (that I just stumbled on) is called Minosse (http://www.codeproject.com/cs/database/minosse.asp). It looks like an ambitious project, and it appears to meet my requirements, but it's still in its infancy (and I’m not even sure if it's still being maintained). In addition, I haven't even downloaded it yet to see if it's thread-safe... so basically, consider this a beta recommendation.



Anyway... as always... if anyone knows of any other options out there... I'm all ears.


WATYF

Thursday, July 14, 2005 3:16 PM by WATYF

# re: We need an Embeded Database for .NET applications

Well the hits just keep on coming...

I tried Minosse.... couldn't even get it to create a database... using their own sample code... *ack*

And to top it all off, I just found out that firebird's embedded version can't be run on a network drive (which my app is sometimes run from)... so there goes my fall-back option.


*sigh*


Doesn't anyone make a database that doesn't have some kind of critical flaw?



WATYF

Monday, July 18, 2005 4:08 PM by WATYF

# I hava a DLL for file operation. It is very simple and fast !

It is a file operation. Fast and stable, I used it on my system(C & Java). It is simple ,not depends on other DLL. Open the file and you can INSERT, UPDATE, DELETE a (key,value) pair.
It is really small. not more than 100K.
If you want to try, you can give a email to me : forest_luo@21cn.com

Thursday, July 21, 2005 3:55 AM by Forest Luo

# re: We need an Embedded Database for .NET applications

Just take a look at http://www.daffodildb.com this might solve your problem though its a java DB but given an ODBC driver to interact with MS Platforms

Friday, July 22, 2005 8:56 AM by Marty

# re: db4o

db4o http://www.db4o.com">http://www.db4o.com does not force you to store blobs in external files, this is only an option, to allow you to keep your main database file smaller, if you like to do that. You can also store byte arrays in the main file, just like any other object.

Using binary serialization to store objects, as you are planning to do, is not a good idea. Your system will break if you modify classes. db4o takes care of this problem for you by updating it's internal schema automatically, whenever you modify your classes, you do not even have to run any reorganisation on existing database files.
--
Carl Rosenberger
Chief Software Architect
db4objects Inc.
http://www.db4o.com">http://www.db4o.com

Saturday, July 23, 2005 9:56 AM by Carl Rosenberger

# re: We need an Embedded Database for .NET applications

I see what you're saying, but that's not how I'm applying it. I'm using binary serialization to dynamically store objects. It enumerates the properties of the controls on the object and adds each one to a serializable object, then serializes that object to a BLOB in a table. The opposite happens when the object is restored. I can change the class (in this case, forms) as much as I like, and it will adapt.

This is really a hack way to do it, though. Partly, because I *am* a hack :op, and also, because it's basically an evolution of how the objects were originally persisted, and since I didn't feel like rewriting the entire app persistence, I kind just piggy-backed the original method (binary serialization) onto a database and made it dynamic. So I'm not recommending it as an ideal method, but it works well for me.

Thanks for the info on db4o (I see you're associated with the project, so sorry for the slight misinformation)... That was just something I had read on your site (or elsewhere... can't remember), but I hadn't really run into that issue myself. My main problem with db4o was that it wasn't SQL based. If I just needed object persistence, then I may have gone that route... but I store other data (variable and otherwise) in the DB as well.



It looks like I'm going with SharpHSQL, btw. I put up a post on my blog (http://www.musicalnerdery.com/index.php?option=com_content&task=view&id=24&Itemid=9) explaining the latest developement. It looks like that's my best bet so far.



WATYF

Monday, July 25, 2005 11:56 AM by WATYF

# re: We need an Embedded Database for .NET applications

Stay clear of Vista. I've used the "stable" version and it bombs out after a while. We purchased it and we developed a sweet disconnected app- then right before launch Vista started to crap out. For the last month I've had no help from their support. So now our app is over a month behind schedule and I look like crap because of Vista - I would recommend keeping clear of that pile.

Wednesday, July 19, 2006 1:24 PM by Dave Gorman

# re: We need an Embedded Database for .NET applications

Too bad MS Access won't work.

Using OleDb I can connect to it but it doesn't seem to know SQL very well at all.

I can execute statements in the MS Access query builder just fine. The same statements through OleDb are crashing.

How close is Firebird's SQL to MySQL?

Thursday, July 20, 2006 1:58 PM by Marl Atkins

# re: We need an Embedded Database for .NET applications

Please take a look at Perst for .NET.  It is an embedded database that is thread-safe and supports multiple processes, and has a simple SQL interface.

Tuesday, July 25, 2006 11:20 AM by Steven Graves

# re: We need an Embedded Database for .NET applications

Has anyone thought about going back to using ini files?

They were good on Windows 3.1

Thursday, September 21, 2006 8:44 PM by David Brown

# re: We need an Embedded Database for .NET applications

This is a C# wrapper for Berkley embedded db:

Berkeley DB for .NET

http://sourceforge.net/projects/libdb-dotnet

Tuesday, April 03, 2007 9:19 AM by alceausu

# re: We need an Embedded Database for .NET applications

This is long lingered problem I have not solved yet. After month of frustrating struggling with various things (Firebird, db4o, ...) I'v return to Ms Jet! I always have new problems with it! Strange mathematical behavior; crash; compacting; ... puffff!

I wonder why this is so?!!

Is anyone developing a real world application that needs an embedded DB??? Sure! But I mean why this problem is not going to be solved?

Sunday, August 12, 2007 4:05 AM by Kaveh Shahbazian

# re: We need an Embedded Database for .NET applications

I created a .NET Windows application that required an embedded database. After seeing this blog I decided to try Firebird embedded.

YES!! It's real light weight, uses standard ANSI SQL (more or less) and so far it's plenty quick enough.

I found a couple small drawbacks - it's difficult to get unique for a combination of a lot of fields.

The newer version claims to solve that but I can't find drivers for .NET.

Overall, I'm real happy with it and have settled on it as the final database for this .NET 2.0 app.

Wednesday, August 22, 2007 12:14 PM by Florida Web Design, Inc.

# re: We need an Embedded Database for .NET applications

Has anyone considered porting Java DB (AKA Apache Derby (AKA Cloudscape)) to C#? I have not found bad anything about it (only good things), and I would imagine porting Java DB to C# would be rather easy. It also has the backing of 3 major parties: IBM, Apache and Novell, so i think it should be stable.

I did found an article on how to have ADO.NET interface with Java DB (Cloudscape) but the process seemed a little involved. And I would rather have my Applications to be completely .NET

Wednesday, September 05, 2007 6:09 PM by Jono

# re: We need an Embedded Database for .NET applications

MySql Embedded. Full feature. Free and open if your end product is. Optionally OEM license if your product is commercial.

Friday, November 02, 2007 8:23 AM by Fred

# re: We need an Embedded Database for .NET applications

difference between *.fdb and *.gdb in firebird

Sunday, December 30, 2007 11:28 PM by duy tan

# re: We need an Embedded Database for .NET applications

firebird 2.0 rulez

test with 5 processes (main thread + 4 background workers) accessing it.

www.youtube.com/watch

:)

Thursday, January 17, 2008 11:00 AM by daniel sovino

# re: We need an Embedded Database for .NET applications

Did you try scimoredb?. I too am in a dilemma and am planning to use scimore. I think we have to create a perfect DAL

Tuesday, January 22, 2008 1:49 PM by Azad

# re: We need an Embedded Database for .NET applications

I managed to get the java H2 database running in C# using IKVM.Net.

It converted the .Jar file into a .Net Dll file and ran perfectly.

Even .Net  triggers and .Net User defined functions worked in the database.

Since IKVM converts java bytecode into MSIL there should be only a small performance hit, if any.

Tuesday, February 19, 2008 12:34 PM by Jono

# re: We need an Embedded Database for .NET applications

SQL Server compact edition seems to be a good choice ? Only 2Mb footprint and can even be synchronized with a back end using the new Synch libraries and ADO.NET

Saturday, March 29, 2008 9:13 AM by SK

# re: We need an Embedded Database for .NET applications

I Created a Ado.Net wrapper for H2 and called it H2Sharp check it out:

http://h2sharp.googlecode.com/

it uses IKVM.Net.

Sunday, May 11, 2008 7:45 PM by Jono

# re: We need an Embedded Database for .NET applications

www.codeproject.com/.../EmbeddedFirebird.aspx

they have .net specific plugins so you can just drop the db right into your code, no problem.

Monday, May 26, 2008 8:41 PM by Mark

# We need an Embedded Database for .NET applications - Jon Galloway « Mortovski’s Notes

Pingback from  We need an Embedded Database for .NET applications - Jon Galloway « Mortovski’s Notes

# re: We need an Embedded Database for .NET applications

I was wondering what the original postie finally used and how did it go.

Monday, June 16, 2008 8:07 AM by Appliedeye

# re: We need an Embedded Database for .NET applications

scimore is very good and free, and have the .net conector www.scimore.com/.../index.html

Tuesday, June 17, 2008 12:38 PM by Patricio León

# re: We need an Embedded Database for .NET applications

Has anyone tried Embedded MySQL?

Monday, July 07, 2008 6:48 PM by Bala

# re: We need an Embedded Database for .NET applications

I am looking for an embedded database that can store about 5 million rows. Luckily the table that stores the 5 mil rows can be read only.

I was planning to use two embedded databases. one for the large data set and one for everything else. Has anyone tried any of the databases mentioned here with such a large dataset?

Thursday, July 24, 2008 3:14 PM by Bala

# re: We need an Embedded Database for .NET applications

www.elevatesoft.com

'nuff said

Wednesday, August 13, 2008 5:17 PM by Ding Birdy

# re: We need an Embedded Database for .NET applications

Depends on whether you need SQL like database or object database.

I have tried out most of object database in the last a few days, and found Perst to fit my need best.

Db4o is nice, but their Client/Server mode can not supports read/write from different application.

Thursday, August 27, 2009 10:56 AM by guoqizheng

# re: We need an Embedded Database for .NET applications

SQL Server Compact Edition!

- 1.8 meg

- No install needed (simply copy the DLLs with your app)

- Full TransactSQL support

- Single database file

- Runs in-process with your app (no service)

- GUI support right in Visual Studio

- Can sync with a real database server

- Very very cool and stable!

Thursday, October 29, 2009 5:42 PM by John Hamm

# re: We need an Embedded Database for .NET applications

Try Scimore embded database

Monday, November 09, 2009 1:59 AM by Bapi

# re: We need an Embedded Database for .NET applications

You can try just  siaqodb ( http://siaqodb.com ). It has most of feature you want for .NET: Native LINQ query engine, SiaqodbManager- tool that you can run LINQ queries over DB from outside, etc

Wednesday, December 09, 2009 5:31 PM by sqo

# re: We need an Embedded Database for .NET applications

Try EffiProz Database http://www.EffiProz.com,

EffiProz is a database written entirely in C#.  comprehensive SQL support including Stored Procedures, Triggers and Functions. Ideal for embed in .Net applications. Support Silverlight 3 and .Net compact framework as well

Include Visual Studio ad-in, ADO.Net provider, Entity Framework provider, etc.

Sunday, January 17, 2010 4:10 AM by anatali

# re: We need an Embedded Database for .NET applications

why MySQL don't support embedded database for dot net environement ??

MySQL was a very good databases !!!

if someone has found a solution for this, please tell us !!

Tuesday, April 06, 2010 9:50 AM by bobdoss2

# re: We need an Embedded Database for .NET applications

STSdb is a small footprint, embedded object database system designed for mission critical and real-time applications. It provides intuitive use, blazing performance and brand new database techniques.

- Fully embedded .NET database

- Blazing performance  

- Transaction support (ACID); instant commit & rollback

- Unlimited records per table; Unlimited tables per database

- Vertical data compression; custom compression

- Scheme hierarchy

- Snapshots

- Composite keys; custom keys

- Based on internal file System

- ...

Tuesday, June 08, 2010 8:49 AM by a.todorov

# re: We need an Embedded Database for .NET applications

There a line by line port of sqlite to c# worth investigating code.google.com/.../csharp-sqlite

Wednesday, June 30, 2010 11:36 PM by Emmanuel

# re: We need an Embedded Database for .NET applications

Hello Everyone,

I am considering to use MS-Access as a client/server and I would like to know what are the risk involve to using this database in a client/server or 3-tier architecture since this database was created as a personal database?

Sunday, September 19, 2010 3:47 PM by Ghislain

# re: We need an Embedded Database for .NET applications

scimore is very good and stable, but their ADO.NET driver cannot be used with Net 4.0 and VS 2010

Wednesday, May 18, 2011 3:57 AM by Uwe

# re: We need an Embedded Database for .NET applications

cheap <a href="www.authentic-guccipurses.com/">gucci authentic bags</a>   for promotion code  

Wednesday, December 05, 2012 9:23 PM by UseskSon

# re: We need an Embedded Database for .NET applications

Hi there, I really want to tell you, you're wrong. Your own article doesn't make sense at all.

Saturday, February 23, 2013 3:53 AM by pljamkuf@gmail.com

# re: We need an Embedded Database for .NET applications

Hurrah! It is also fastidious post on the topic of JavaScript, I am truly keen of learning JavaScript. thanks admin

Saturday, February 23, 2013 3:58 AM by jbbcrj@gmail.com

# re: We need an Embedded Database for .NET applications

Wow! this cartoon type YouTube video I have viewed when I was in primary level and at this time I am in academy and seeing that over again here.

Monday, March 25, 2013 8:25 PM by ukhfmjcyq@gmail.com

Leave a Comment

(required) 
(required) 
(optional)
(required)