Which embedded database to use in a Delphi application?
Asked Answered
V

29

40

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?

Vertigo answered 21/10, 2008 at 17:16 Comment(0)
F
15

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.

Flirt answered 21/10, 2008 at 20:48 Comment(2)
See #6071112 about statically linked SQLite3 engine: that is, no external DLL, all is embedded into your EXE. I've used SQLite3 database using more than 4 GB of data, without any performance issue (if some indexs are properly created, of course).Cetology
sqlite is no multiuser database. That says it all.Moving
W
38

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).

Wenger answered 21/10, 2008 at 17:27 Comment(2)
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 goAbbie
Starting with Firebird 2.5 embedded exclusive access is no longer required. Multiple applications can access a local database at the same time.Allembracing
K
19

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).

Knavish answered 21/10, 2008 at 17:41 Comment(1)
Developing Delphi applications with SQLite and AnyDAC: da-soft.com/blogs/…Arytenoid
F
15

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.

Flirt answered 21/10, 2008 at 20:48 Comment(2)
See #6071112 about statically linked SQLite3 engine: that is, no external DLL, all is embedded into your EXE. I've used SQLite3 database using more than 4 GB of data, without any performance issue (if some indexs are properly created, of course).Cetology
sqlite is no multiuser database. That says it all.Moving
K
13

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.

Kotta answered 21/10, 2008 at 17:16 Comment(0)
H
13

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.

Holo answered 21/10, 2008 at 17:45 Comment(3)
Solid product. Good documentation and support.Degrease
Both DBISAM and ElevateDB are solid products.Dexter
I use DBISAM in hundreds of customers. Rock solid product, no trouble. It is so good that I am using it as a webserver option instead of others sql options.Moradabad
M
8

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.

Martino answered 21/10, 2008 at 17:51 Comment(0)
B
6

Strongly recommend to use AnyDAC when working with Databases and Delphi - then you can choose to target FB or SQLite seamlessingly.

My preference would be for FB for embedded apps. Tom

Bannerol answered 28/2, 2011 at 11:40 Comment(0)
S
5

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

Scutage answered 21/10, 2008 at 19:1 Comment(0)
U
5

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.

Unchaste answered 17/11, 2008 at 9:14 Comment(0)
P
3

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

Pericranium answered 21/10, 2008 at 17:53 Comment(1)
Yes, you are correct. The docs for SQLite are very good. I've found them wanting for DISQLite3.Vertigo
K
2

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

Kruger answered 21/10, 2008 at 20:44 Comment(2)
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).Glanti
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.Yalonda
A
2

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

Autograph answered 21/10, 2008 at 22:27 Comment(0)
G
2

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).

Gaw answered 29/10, 2008 at 9:12 Comment(0)
M
2

Look at this embedded database comparison: http://sql-db.cz.cc/, it can be helpful. Most of abovementioned products are presented there: Advantage, DBISAM, Firebird, MS SQL Server, and much more: Accuracer, Apollo, ElevateDB, NexusDB, TurboDB.

Makebelieve answered 10/3, 2011 at 14:33 Comment(2)
Good comparison, but too bad they left out SQLite and DISQLite3Abbie
Link looks to be dead. Found what looks to be the same content here: delphi.xcjc.net/viewthread.php?tid=45734Langobard
G
1

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.

Goodrow answered 21/10, 2008 at 18:28 Comment(1)
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: componentace.com/…Febri
T
1

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 :-)

Tesler answered 21/10, 2008 at 22:24 Comment(2)
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.Skidmore
I had to downvote, not because I don't agree, but because this question is referring to an embedded database server, and SQL is far from embedded. However SQL Server is an excellent solution, and I in fact use it all the time.Steapsin
A
1

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.

Abbie answered 21/10, 2008 at 23:48 Comment(0)
H
1

I know MS access is a comparatively crap db (and expect to be shot down in flames here), but if only small data is needed it may have advantages if ms office is used anyway. For me it was a way to store program data with more flexibility than csv files which is a common approach for scientific code.

You can create an access db from delphi code without having ms office installed using ado & odbc driver (might be necesary to have an initial .accdb file without tables to copy from then populate, I can't remember this detail. not sure licensing situation doing this.

The .accdb extension can be changed to something else & the file password protected (to a limited degree) so its not immediately obvious to users its access if that's desired. I know a few commercial developers do this method & copied it myself. Found it easier to setup than sqlite, but maybe because I'd already used ado & access in the past.

Hun answered 13/9, 2014 at 18:51 Comment(0)
S
0

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.

Skipp answered 21/10, 2008 at 17:44 Comment(0)
T
0

If embedded is an absolute must, look at DBISAM.

Toxic answered 23/10, 2008 at 0:13 Comment(0)
D
0

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

Components4Developers

Dishpan answered 5/11, 2008 at 0:27 Comment(0)
V
0

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.

Virgenvirgie answered 9/11, 2008 at 22:46 Comment(0)
F
0

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

Fasta answered 30/12, 2008 at 21:2 Comment(1)
+1 Thanks for the link to UIB components. I have been looking for an active open source connection solution, and this looks great.Kourtneykovac
Q
0

I have a database that I have to record 5 field data for every 20 sec for 10 days.. 3 field are integer , 1 field is double ( time ) and 1 field is string[5].

I am still using Delphi6 srv2 because of my components. Newer delphi versions are terrible at components that I have to spend thousands of dollars of money to rebuild my component library. Therefor delphi 6 is still best for real commertial applications that never version of delphis give many problems. At many points such as USB or comport readings so on... they release newer ones before previous versions never sit on market.

I have setup a code with Delphi6 what appends 43200 records at a table for test because I will deploy the table in application while it has 43200 records. I will shown all the data on DBChart.

Test result is below databases filled the tables by insert command with 43200 records

Dbisam = 34 sec,
ElevateDb = 11 sec,
AbsoluteDB = 45 sec,
SQLlite = 32 Minute,
Firebird = 12 min,
MSSQL12 localDB = 28 Minute,
Easy table = 8 minute,
BDE = Blocked ,

I havent tested oracle , blackfish , sysbase, nexsusDb etc.. but it seems they will also very slow. I have connected with DBChart and only elevateDb and absoluteDB has loaded 43200 records on DBchart in exceptable time such as 7~10 secs. Other all taken minutes. So slower databases always needs coding tricks to succeed in some real jobs..

I have tested their search speed as well by locate command that unfortunatly the server based databases are always slower in.

MSSQL and SQLLite3 are extremely difficult to manage in to delphi that they made me very tired.

These are my test results
At the end I decided to use AbsoluteDB, Dbisam and Elevate. I have thrown the rest off the PC .

Elevate software doesnt support recno function that requires extra codes at runtime to manage. This makes the database slower Other bug is with Elevate software is autoinc fields. There is no way to reset it . Therefore I have not chosen the Elevat software even it is the fastest database. They say many good functions but how many of them we use it in fact . They just left the most important functions not supported but fixed many many unnecessary functions. and it seems since 8 years there is no any advantage either.

If you want to see with your own eye pls just try and see..

I am thinking between two now absolute DB or DBisam4

Quigley answered 27/10, 2015 at 18:59 Comment(1)
"MSSQL and SQLLite3 are extremely difficult to manage in to delphi " Actually, they are both easy to manage, but Delphi is not the right tool for that. Use Sql Server Management Studio and one of the Sqlite managing utilities (there is one which is an add-on for Firefox).Abiosis
T
-1

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

Titi answered 14/2, 2009 at 12:4 Comment(0)
G
-1

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.

Glebe answered 15/4, 2009 at 5:29 Comment(1)
SQLite: There seem to be problems with concurrent access from multiple threads, though - see stackoverflow.com/questions/700709.Righthanded
E
-1

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)

Elwell answered 15/4, 2009 at 8:49 Comment(0)
L
-1

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.

Lilliamlillian answered 4/5, 2009 at 0:0 Comment(2)
Nobody recommended the BDE because it is not an embedded database. Of course there is the added problem that it is no longer maintained.Yalonda
BlackFish SQL, the database installed with recent versions of Delphi, is not part of Delphi XE... and it seems Embarcadero pulled the plug on it blog.marcocantu.com/blog/blackfish_sql_replacement.htmlCortese
M
-1

when it comes to embedded databases the first question is : is it multiuser ? Actually,who needs a database that does not allow multiple connections (read&write) to it ? I have tried (intensly) all mentioned databases and found only one that actually functions the way it should. And that is Accuracer. The only pity with accuracer is that its a three man band and chronic lack of proper support. It also is mainly static in development as we have seen no real features in years.Not surprising since only one person actually develops it. It seems they are living on old fame. Users praise reflect that (usually 10 years old comments). For a single user experience I would recommend Absolute Database. As for major players I would recommend SQL Server from Microsoft. Oracle has become a bloatware and is slowly dying out.

ps what is nice in accuracer is that their embedded database functions just like full blown server. It locks only current record if its in use while the rest functions normally. Nice database. Pity only it is stagnant.

Moving answered 4/10, 2016 at 15:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.