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

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 :

  • + If you start looking into embedded databases, you won’t be able to make a step without tripping over some SQLite evangelist. This database engine is definitely one of the most popular, so there’s a lot of tutorials for nearly any language available, plus a huge community of users to help you out.
  • + It’s fast, robust and “just works”. Hey, even Firefox uses it.
  • – Referential integrity (i.e. foreign keys) isn’t enforced. However, you can work around this by using triggers.
  • – No ALTER TABLE command and no stored procedures.
  • – Limited support for concurrent access/multi-threading.
  • Column datatypes aren’t enforced – you can store any data of any length in any column. Whether this is a flaw or a benefit really depends on what you want to do with it.
  • #2 Firebird SQL

    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

    Scimore DB
    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 :

  • + ScimoreDB can be used both as an in-process and out-of-process engine, which results in very good concurrency support (at some speed penalty).
  • + Table level and row level locking is supported.
  • + Foreign keys Referential integrity works.
  • – C++ interface is a bit awkward and the Delphi components are apparently in limbo.
  • #4 Oracle Berkley DB

    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 :

  • This is the only item on the list that doesn’t use some form of SQL. Instead, Berkley DB stores key-value pairs. There is no query language.
  • + Thanks to the simple architecture and long history of development, Berkley DB has extremely good scalability and performance.
  • – The key-data database structure may not be suitable for your projects.
  • – Dual licensing means it’s only free if your application is also distributed as open source. If you want to use this embedded database engine in a closed-source, commercial application, you will need to pay licensing fees.
  • Related posts :

    19 Responses to “Top 4 Free Embedded Databases”

    1. […] 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. […]

    2. mariuz says:

      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

    3. White Shadow says:

      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.

    4. Paul Linehan says:

      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.

    5. Miha says:

      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.

    6. White Shadow says:

      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.

    7. gemini says:

      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.

    8. White Shadow says:

      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.

    9. The Chief Priest says:

      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.

    10. SS says:

      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.

    11. Andrew says:

      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?

    12. Tushar says:

      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

    13. Robb says:

      I do enjoy your posts, thanks!

    14. Dmitri says:

      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.

    15. David Taylor says:

      @Dmitri – Firebird supports Unicode very nicely using UTF8 (e.g. see here http://www.destructor.de/firebird/charsets.htm).

    16. Marcus says:

      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.

    17. mohas says:

      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

    18. Alex Smith says:

      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.  

    19. Paul Mc says:

      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.

    Leave a Reply