views:

4876

answers:

24

I am creating a desktop app in Delphi and plan to use an embedded database. I've started the project using SQlite3 with the DISQLite3 library. It works but documentation seems a bit light. I recently found Firebird (yes I've been out of Windows for a while) and it seems to have some compelling features and support.

What are some pros and cons of each embedded db? Size is important as well as support and resources. What have you used and why?

+25  A: 

I'm using Firebird 2.1 Embedded and I'm quite happy with it.I like the fact that the database size is practically unlimited (tested with > 4 GB databases and it works) and that the database file is compatible with the Firebird Server so I can use standard tools for database management and inspection. Distribution consists of dropping few files in your exe folder.

Simultaneous access from multiple programs is not supported but simultaneous access from multiple threads is (as long as you ensure that only one 'connect' operation is in progress at any given moment).

gabr
Embarcadero has just announced that RAD Studio 2010 will include native Firebird support. So I now agree with Gabr that this seems like the way to go
lkessler
+12  A: 

I have used SQlite3 for a lot of projects (but from C/C++ and Objective-C). It's extremely small -- no dependencies whatsoever -- database is in a single file.

It's the db of choice for Mac developers because it's directly supported by CoreData and on the iPhone -- so there is a big user base (not to mention all of the other users).

Lou Franco
A: 

I have used ScimoreDB. It has its quirks as they give it royalty free and it has its quirks in data types and with some installation issues. This was on a C# project.

+6  A: 

I've used DBISAM on a number of projects. It is completely embedded without even a need for an external DLL. Unlike the others you listed it is commercial. A lot of great features though and very well documented and supported. The have a successor to it that I haven't tried yet though.

Jim McKeeth
Another vote for DBISAM and (even better) ElevateDB.
Bruce McGee
Solid product. Good documentation and support.
Thad
Upvote the answer if you also like DBISAM
Jim McKeeth
Both DBISAM and ElevateDB are solid products.
stukelly
+6  A: 

Firebird embedded is our #1 choice because with no code changes, a single user Delphi app with embedded database can be migrated to a multi-user server based deployment without sacrificing any of the high end features (such as stored procedures, triggers, views, etc.). And its a TRUE free database and doesn't GPL your code in the process.

+2  A: 

As for size, nothing beats SQLite.

when you refer about lack of documentation, i guess it's doc for DISQLite3. The SQLite docs are quite complete

Javier
Yes, you are correct. The docs for SQLite are very good. I've found them wanting for DISQLite3.
Darrel
+2  A: 

I am partial to Component Ace's Absolute DB. Although a commercial product ($), it is solid, easy to use, small footprint and well documented. If you are looking for a huge multi-user application, this is not the way to go, but if your multi-user needs are light (or non-existent) this is a solid option.

lgallion
I agree - as a product it is a good replacement for BDE - although I did have to modify a few SQL queries to get them to work.Link: http://componentace.com/bde_replacement_database_delphi_absolute_database.htm
devstopfix
+4  A: 

I use Sybase's Advantage Database Server, but I'm also the R&D Manager, so this post is biased. :)

We have native Delphi TTable and TQuery components for both WIN32 VCL and VCL.NET. Direct table access in addition to SQL support makes Advantage unique among many of the other Delphi offerings. Advantage supports large tables (only limited by the number of records, 2 billion) and has a free local engine, which is nice for development PCs and for small customer sites that don't require client/server functionality. Switch to client/server with a single connection property, no other changes.

We have a ton of clients so accessing the data outside of Delphi is also very easy (.NET data provider, ODBC, OLE DB, PHP, Perl, JDBC, etc).

Main Product Web Site: http://www.advantagedatabase.com Developer's Web Site: http://devzone.advantagedatabase.com

Jeremy Mullin
+2  A: 

The problem with (embedded) firebird is, that the database cannot reside on a network drive. Also, it is difficult to have a database on a read only drive (CD/DVD).

For some hacks around these limitations see the Delphi Wiki: http://delphi.wikia.com/wiki/Firebird_tipps

A database file in a network drive is nonsense. Instead, put the database SERVER there and expect some (skyrocket) performance gains.About read-only databases, Firebird can handle it without problems: just use "GFIX -mode read_only" (and set the readonly attribute of database file in filesystem).
F.D.Castel
We are talking about an embedded database here, so a server doesn't make sense at all. But putting the database on a network drive (while still accessing it only from one application) does.
dummzeuch
Starting with 2.5 database file can reside on network drive.
Andrei K.
+9  A: 

I've been using SQLite (via DISQLite3) in FeedDemon for several months, and I highly recommend it - it has been extremely fast and stable. As Javier said, the docs for the library may be thin, but the docs for SQLite itself are very good.

Nick Bradbury
+2  A: 

I'm using SQL Server Express and the ADO components. Works great. You can run the SQL Server Express install with commandline to hide the complexities from the users. You can also distribute a database that you load by filename. There are millions of SQL server users so solutions to any problems are easily found in the intertubes :-)

Tom
Not exactly embedded, since the database requires DLL's to be registered into the registry. Still it is a good solution and one that I also use as it also scales easily to enterprise level SQL Server.
skamradt
+2  A: 

Take a look at NexusDB. Have used very successfully in the past.

Craig
+1  A: 

I did a websearch to find a fast database package for my Delphi Application. I wanted it to be completely contained in the executable with no external DLLs or libraries required. I originally found Accuracer by AidAim. They had posted how fast their database was and even gave comparisons with other similar packages to “prove” their point.

I wanted to believe their claims but I thought I’d search the web a bit more to find timings of other packages. I was very surprised to find a post at the Delphi discussion forums where a person asked what database to use, and there were 14 different suggestions. One of the responders had done his own timing comparisons and had found Accuracer to be quite slow compared to several others, which Accuracer had (conveniently) left out of their own comparison page.

The post, plus additional followup web research by me, led me to lean toward DISQLite3, a product based on the Open Source SQLite program, but with enhancements to work in Delphi very quickly, with very small overhead, and with command-based calls - which I like. It is actively under development and will soon have an official Delphi 2009 version, although apparently the current version will work under D2009.

Addenum: DISQLite3 Version 2.0.0, released Nov 17, supports D2009.

lkessler
A: 

If embedded is an absolute must, look at DBISAM.

+2  A: 

NexusDB offers the full range from embedded, to full client/server / remote. Also SQL2003 compliant, I believe. I'm using it on a few projects, and am very pleased so far, and the fact that it can work in such a wide range of "scales" is a big plus (not having to learn another DB for scaled-up apps, etc).

Jamo
+1  A: 

kbMemTable is a good candidate. Runs in memory, fast, multi-threadding. Used to be free.

Components4Developers

Gerard
A: 

I have used DBISAM and kbMemTable on different occasions.

What I like about DBISAM is that it has great features, and is usually very reliable. I have used it in large databases, full-text search, read-only mode, CGIs and many other situations.

It is fairly large compared to kbMemTable or SQLite based components, though. And you can't have a single file per database (or even table) - depending on the situation, that is a major disadvantage.

kbMemTable is tiny and it's great for small amounts of data. Since it runs in memory, it has to be a small amount of data, of course.

One other option I've taken on a couple of my desktop apps is dumping the data directly from/to my object hierarchy using TWriter/TReader. This is by far that smallest option, and is absurdly fast compared to using a database. The data files are tiny, too.

It has all kinds of drawbacks, though - you have to code versioning in if you might want to ever add/change fields, unless it's in-memory it is even more complicated, no multi-user support at all, etc.

stg
+3  A: 

It really depends what you need. For single-user applications, Firebird Embedded or SQLite are probably best choices (and price is right). On the other end, if you need support for large number of multiple users, you should probably use regular Firebird instead of Embedded version (server is simple to install so you won't have much problems here).

And if you need something in between, for a moderate multi-user application, one of flat databases would be better. I found that ComponentAce's Absolute Database better choice for my needs than DBISAM, NexusDB or VistaDB.

It leaves relatively small footprint (no DLLs), it's a single-file db (a must for me), supports Unicode, BLOB compression, crypting, and technical limits seem impressing for a flat database. Moreover, support was good in few occasions when I needed it.

For cons, I have noticed it doesn't support nested transactions, but other than that, I had no problems.

vrad
+7  A: 

Let's see, quick comparison:

SQLite:

  • dynamic typing in the database
  • cross-platform files
  • runs on Windows, Linux, Mac, etc.
  • public domain
  • supports transactions
  • relies on file system security, does not include own security

Firebird embedded:

  • strong typing in the database
    • not all SQL datatypes are supported
  • cross-platform files
    • Firebird embedded only runs on Windows
    • Files from Firebird embedded are in the same format as the full server version
    • Files from Firebird embedded can be copied to a non-Windows server for use
  • available under a modified MPL ("what's ours is ours and must remain free, what's yours is yours and you don't have to release it")
  • supports transactions, triggers, etc.

MySQL embedded:

  • support for SQL features depends on file format
  • (IIRC) cross-platform files
  • GPL unless you pay royalties
  • runs on Windows, Linux, Mac
  • incredibly popular with the open source crowd

Even embedded databases have their strengths and weaknesses. You'll need to weigh those strengths and weaknesses against what you're doing to decide.

Max Lybbert
A: 

Firebird embedded is our #1 choice as well. And the suite Unified Interbase v2.0 with it. A great and stable solution!

Matthias Hryniszak
A: 

Firebird all the way. Does pretty well everything and so far version 2.1 is very solid.

A: 

FireBird offers the opportunity to scale up to multi-users sometime down the line, or if you need concurrency (if your application goes multi-threaded).

SQLite is quite unrivaled if you only need single-user access, no other database comes close to it on any aspect, be it performance, convenience, SQL support or stability.

Eric Grange
SQLite: There seem to be problems with concurrent access from multiple threads, though - see http://stackoverflow.com/questions/700709.
mghie
A: 

Firebird is really awsome and has a small footprint so you can use embedded and it can be scaled upward for many users and does unicode faily well I use devart components with delphi 2009 and FIB plus for delphi 6/7 (their version for 2009 and unicode is not ready yet too bad)

A: 

Hmmm, no one has recommended the BDE - I wonder why that is ;-)

BlackFishSQL is another possibility, although I haven't tested in depth as yet.

Alister
Nobody recommended the BDE because it is not an embedded database. Of course there is the added problem that it is no longer maintained.
dummzeuch