Top 4 Free Embedded Databases
I need an embedded database for my next project. During the last few days I’ve done a lot of virtual leg-work researching and comparing the various alternatives, trawling through documentation and forums. The results are below. Hopefully, if you’re ever in the same situation, this list will make your life a bit easier.
Of course, the list is far from comprehensive – it wasn’t really my goal to include every embedded database in existance, but rather to find those that fit the needs of the project. The focus was on speed, support for multi-threading and connectivity (what programming language interfaces are available for the DB). I also left out databases that are tied to a single language or framework (Java/.NET) – sorry about that, I know there are some good ones.
Without further ado, here are my top choices (in minimalistic list format).
#1 SQLite
Connectivity : Any programming language (almost)
Platforms : Linux, Mac OS X, OS/2, Windows (Win32 and WinCE) and embedded devices
Footprint : 300 Kb (or 180 Kb with optional features ommitted)
Model : Relational (SQL92 with some exceptions)
License : Public domain
SQLite is a software library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. SQLite is the most widely deployed SQL database engine in the world. The source code for SQLite is in the public domain. Includes both a native C library and a simple command line client for its database.
Highlights :
#2 Firebird SQL
Connectivity : .NET, C/C++, Delphi, Java, PHP, Perl, Python, VB, COBOL, etc (see also)
Platforms : Windows (Win 98 and up), Linux (tricky)
Footprint : 4-5 MB
Model : Relational (SQL92 and most of SQL99)
License : Open source (LGPL)
Firebird is a relational database offering many ANSI SQL standard features. (…) Firebird offers excellent concurrency, high performance, and powerful language support for stored procedures and triggers. It has been used in production systems, under a variety of names, since 1981.
Highlights :
- + Referential integrity is supported, which is nice when compared to SQLite.
- + Concurrency support is also decent.
- + Supports triggers and stored procedures.
- – A notably confusing and disjointed website. I had to dig around for a while to find out what I needed to know. Some sections also present outdated information.
- – No built-in full text search.
- – If you casually browse around Friebird’s site you may get the impression that the embedded version only works with .NET (they even have an entire sub-website dedicated to the .NET version). However, you can actually use it with many other languages by downloading the embedded version and using the standard Firebird APIs.
#3 ScimoreDB
Connectivity : C++, .NET, Delphi (discontinued?)
Platforms : Windows (XP, Vista, Windows Server 2000 – Windows Server 2008)
Footprint : < 4 MB
Model : Relational
License : Free for commercial and non-commercial use
(There is no quote here because almost everything on the website reads like a shallow advertisement. Nevertheless, the feature list looked attractive enough.)
Highlights :
#4 Oracle Berkley DB
Connectivity : C, C++, Java, Tcl
Platforms : *nix, Windows, Windows CE, VxWorks, S60, BREW
Footpring : 400 Kb (minimum)
Model : Key-value
License : Open source (dual-licensed)
Berkeley DB delivers the same robust data storage features as traditional, relational database systems, such as ACID transactions and recovery; locking, multiple processes and multi-threading for high concurrency; hot and cold backup; and single-master replication for high availability applications. Berkeley DB can manage databases in memory, on disk or both.
Highlights :
[…] and comparing the various alternatives, trawling through documentation and forums. The results are below. Hopefully, if you’re ever in the same situation, this list will make your life a bit easier. […]
we started to modernise the design and i proposed some new ideas to firebird-web
i will start to add the issues to the tracker
http://www.firebirdsql.org/index.php?op=devel&sub=web&id=webtools
so we can fix the old cruft that is in the way of the end user
Good idea. I really liked what I saw of Firebird (referential integrity and (hopefully) working concurrency, yay), but IMHO the current website makes it non-trivial to find out how to use it in practice. A simpler design with a unified structure would be nice.
If I’ve understood Firebird correctly, concurrency works under Linux but not
with the Windows dll.
I’m using it at the moment as a proof of concept and it’s great.
Where did you get 2MiB for Firebird?
Embedded version is 6MiB. You can also compile it yourself then you’ll have one DLL approx. 4,5MiB in size.
Hmm, I got that figure from Firebird’s site and decided I could trust it. However, it appears you are right – the precompiled Win32 embedded version is actually around 4.79 Mb (just the 4 main DLL’s without INTL and runtimes). I’ll edit the post.
the problem with firebird, is you don’t have documentation like for e.g postgres and mysql. it has some old docs for “Interbase”. if you want say sql reference for firebird, you have to buy some book from them … some Borrie person.
that’s why I moved to mysql, they have the whole technical docs on their site. The same thing applies to postgres. they have good docs at their site.
That’s a good point, but somewhat irrelevant – MySQL and Postgres don’t have a free embedded version (AFAIK). Well, MySQL kind-of has something, but it appears to be commercial.
Heck, Firebird is so easy to use that you really dont need any serious documentation. Read the source code. Thats all the documentation you need. Beside that Firebird has a large community. Ask the question and it shall be answered.
I’ve been Interbase/Firebird fan since I knew Interbase in late 96.
But is a shame that after about 8 years since Firebird was forked from IB open source and there is no official documentation on the product as MySQL and PostgreSQL.
Regards.
Oh please.
1st – firebird is easy to work with and implement. I’ve worked with Oracle, PostGre, Interbase (essentially the same thing, but diferent) and firebird is the easiest to implement, by far.
2nd – The documentation may not be free, but there is a very complete book by Helen Borrie that covers all the need-to-know things and a ton of tips to use on a daily basis. And yes, it does have the embedded info also.
3rd – Yes, the site is a bit messy, but there are at least a dozen of good sites out there and a very good and supportive newsgroup. One of Interbase/Firebird creators, Ann Harrison, answers questions on a regular basis. Helen Borrie is there daily as are the programmers of the engine.
I really thought it was the embedded engine that was being tested, not the website. You wrote 6 items about it being 2 of them rants about the site. I expected some kind of test results, implementation experiences… something more about your pratical experiences. Will this news have a follow-up?
I have thoroughly used Sqlite in the past, it is complete, but lacks speed and has bugs, I discovered that Sqlite can’t be used by even 3 Users doing long database operations at the same time. It just locks up. Now only yesterday, I finally realized and was shocked that Sql Server Compact Edition is a hidden magic tool, does all the things i dreamt of. Sql Server Compact Edition 3.5 is the best Embedded Database that you will ever find in the entire world. It is free! No bugs came ever with my handling of Sql CE.
Tushar
I do enjoy your posts, thanks!
I have enjoyed working with embedded Firebird (even despite poor documentation), which is real relational database, easy to use, and is free … until I learned that it has no support of Unicode. Major disappointment! Now I am looking for alternative, Scimore Embedded looks promising.
@Dmitri – Firebird supports Unicode very nicely using UTF8 (e.g. see here http://www.destructor.de/firebird/charsets.htm).
Nice article. I havn’t heard ScimoreDB before. After trying I can say, this is exactly what we were looking for. We started using ScimoreDB at job in an investment bank, it was just fast, safer.
Distributed version looks interesting too.
being nosql for Berkeley DB is as a negative point as being a fish for a fish, not supporting relational model is a part of what Berkeley DB is: a key value store
I have also know about Sqlite, It is free, but it lacks performance and support, It is OK for single user stuff but it can’t be used by more than one users/threads. I also need row-level locking. I am trying ITTIA DB SQL (www.ittia.com) and like it so far.
I used to use Firebird but now it just sucks. You have to change a load of settings in a text file to “make it work”. I spent 2 hours of my life and the fucking thing still would not connect. It belongs on a linux server in 1999, stay away from this.