Recent

Author Topic: One of the advantages of Firebird?  (Read 15148 times)

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
One of the advantages of Firebird?
« on: May 16, 2013, 03:54:18 pm »
I notice that Firebird is quite popular among Lazarus and Delphi developers - probably due to its Borland/Interbase heritage.

I generally prefer PostgreSQL and use MySQL when it is the preferred database for a number of scripts I used. My main problem with them is that all the databases have to stored in a single location.

Is one of Firebird's advantages the fact that although the databases can be stored in any location, they can be accessed of the network as well, and that copying the database somewhere else is simply a matter of well - simply copying it?
Lazarus 3.0/FPC 3.2.2

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: One of the advantages of Firebird?
« Reply #1 on: May 16, 2013, 03:57:15 pm »
Sharing Firebird dbs over smb/windows file shares/nfs is not recommended if that is what you mean by "accessing over the network".

Yes, you can mostly just copy over the fdb file if you want to use it elsewhere.

For me the big advantages are though:
- both embedded and client/server available without code changes
- low maintenance
- good standard SQL support
- stable (probably just like postgresql). You can use various client library versions against the server without the mess you get with mysql.
« Last Edit: May 16, 2013, 03:59:54 pm by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: One of the advantages of Firebird?
« Reply #2 on: May 16, 2013, 04:43:29 pm »
The syntax for accessing a database over the LAN is
Quote
server_host/port:/path/to/database.fdb
. Does this mean that multiple databases can be accessed by the Firebird server so long as the Firebird process has read and write permissions on the location?

Sharing Firebird dbs over smb/windows file shares/nfs is not recommended if that is what you mean by "accessing over the network".

Yes, you can mostly just copy over the fdb file if you want to use it elsewhere.
<snip>
Lazarus 3.0/FPC 3.2.2

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: One of the advantages of Firebird?
« Reply #3 on: May 17, 2013, 08:04:07 am »
The syntax for accessing a database over the LAN is
Quote
server_host/port:/path/to/database.fdb
. Does this mean that multiple databases can be accessed by the Firebird server so long as the Firebird process has read and write permissions on the location?
Ok, that helps to see what you mean. LAN, WAN, internet: it doesn't matter: Firebird will happily serve your databases. Yes, multiple dbs are supported, multiple clients as well. Just like PostgreSQL or MySQL, really?!

To store db files in any location, you do have to configure FB to allow that IIRC, I *think* it limits db access to a single directory by default for security reasons.
(It's a bit hazy though because I generally put my db files in the single directory anyway)

(It seems like I'm still not getting the point of your question)
« Last Edit: May 17, 2013, 08:05:56 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: One of the advantages of Firebird?
« Reply #4 on: May 17, 2013, 08:08:07 am »

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: One of the advantages of Firebird?
« Reply #5 on: May 17, 2013, 12:24:40 pm »
To store db files in any location, you do have to configure FB to allow that IIRC, I *think* it limits db access to a single directory by default for security reasons.
(It's a bit hazy though because I generally put my db files in the single directory anyway)

No, there is no such limit. You can put your db-s anywhere on different places on the server hard discs where Firebird process has read and write access.

The best practice is to use aliases instead of real paths of database. You should edit the file "aliases.conf", which you will find in your Firebird installation folder (in Linux, you will find it under /etc/firebird/2.5/). Add aliases for each database you have on this server. Then, the client can and should access the database through its alias — server_host/port:<db_alias>.

Further, for maximum security, edit the file "firebird.conf", find the key "DatabaseAccess" and set it to "None", which means that only connecting through aliases, and not with actual path are allowed on this server.

After editing aliases.conf or firebird.conf, it might be required to restart fb service for new settings.

Then, in Lazarus, in IBConnection (ZConnection, if you use Zeos), you should set DatabaseName (Database) field to alias, not to db path.
« Last Edit: May 17, 2013, 12:28:12 pm by Zoran »

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: One of the advantages of Firebird?
« Reply #6 on: May 17, 2013, 01:13:20 pm »
To store db files in any location, you do have to configure FB to allow that IIRC, I *think* it limits db access to a single directory by default for security reasons.
(It's a bit hazy though because I generally put my db files in the single directory anyway)

No, there is no such limit. You can put your db-s anywhere on different places on the server hard discs where Firebird process has read and write access.
Yes there is; see firebird.conf:
Quote
# Database Paths/Directories
#
# DatabaseAccess may be None, Full or Restrict. If you choose Restrict,
# provide ';'-separated trees list, where database files are stored.
# Relative paths are treated relative to RootDirectory entry
# (see above). Default value 'Full' gives full access to all files
# on your site. To specify access to specific trees, enum all required
# paths (for Win32 this may be something like 'C:\DataBase;D:\Mirror',
# for unix - '/db;/mnt/mirrordb'). If you choose 'None', then only
# databases listed in aliases.conf can be attached.
#
# Note: simple quotation marks shown above should *NOT* be used when
# specifying values and directory path names. Examples:
#
# DatabaseAccess = None
# DatabaseAccess = Restrict C:\DataBase
# DatabaseAccess = Restrict C:\DataBase;D:\Mirror
# DatabaseAccess = Restrict /db
# DatabaseAccess = Restrict /db;/mnt/mirrordb
# DatabaseAccess = Full
#
# UNCONTROLLED DATABASE ACCESS MAY COMPROMISE YOUR SYSTEM!
# IT IS STRONGLY RECOMMENDED THAT THIS SETTING BE USED TO LIMIT
# DATABASE LOCATIONS!
... as I said, I don't remember what the default setting is. Judging by your reply, it's probably Full.

Further, for maximum security, edit the file "firebird.conf", find the key "DatabaseAccess" and set it to "None", which means that only connecting through aliases, and not with actual path are allowed on this server.
Seems like you *do* know that setting ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: One of the advantages of Firebird?
« Reply #7 on: May 17, 2013, 01:48:17 pm »
Yes, Full is the default, as you can read in the text you quoted: ;)
Quote
# (see above). Default value 'Full' gives full access to all files

Anyway, I don't think that this setting restricts where db's can be placed. It only restricts how the clients can connect. And they can always connect through alias to any db, regardless of this setting, no matter where it is as long as it is listed in aliases.conf.

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: One of the advantages of Firebird?
« Reply #8 on: May 17, 2013, 01:55:12 pm »
Reading - who thinks of that ;)

And yes, AFAIU, it does restrict which db can be accessed, but yes, I suppose aliases can circumvent that. Too lazy to dig up the documentation and... read ;) (This is anyway a bit off-topic)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

snorkel

  • Hero Member
  • *****
  • Posts: 817
Re: One of the advantages of Firebird?
« Reply #9 on: May 18, 2013, 02:09:17 am »
No offence to Firebird users, but I used it extensively awhile back and switched to PostgreSQL and overall PostgreSQL
is the superior RDBMS.
***Snorkel***
If I forget, I always use the latest stable 32bit version of Lazarus and FPC. At the time of this signature that is Laz 3.0RC2 and FPC 3.2.2
OS: Windows 10 64 bit

JJVillamor

  • New Member
  • *
  • Posts: 47
Re: One of the advantages of Firebird?
« Reply #10 on: May 18, 2013, 06:55:42 am »
I believe there is little argument that overall PostgreSQL is superior to Firebird. ]

But there are situations where Firebird may be preferable http://mapopa.blogspot.com/2010/10/where-firebird-is-better-than.html

exdatis

  • Hero Member
  • *****
  • Posts: 668
    • exdatis
Re: One of the advantages of Firebird?
« Reply #11 on: May 18, 2013, 06:59:41 am »
I agree, although I use both. Still, I prefer the Firebird SQL syntax...
Regards

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: One of the advantages of Firebird?
« Reply #12 on: May 18, 2013, 12:09:30 pm »
Firebird is one of my top three preferred databases. The others are PostgreSQL & SQLite.

Firebird vs PostgreSQL? PostgreSQL for heavyweight to super heavyweight (near Oracle) DB requirements. Firebird for lightweight to heavyweight. SQLite for super lightweight DB requirements.

In any case, once I need to consider multiple users, I immediately start thinking about Firebird or PostgreSQL.

Forgive the language, but I like the boxing analogy.  :D
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: One of the advantages of Firebird?
« Reply #13 on: May 18, 2013, 12:11:00 pm »
@JD: sounds like a fair analogy though ;)
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

vfclists

  • Hero Member
  • *****
  • Posts: 1013
    • HowTos Considered Harmful?
Re: One of the advantages of Firebird?
« Reply #14 on: May 18, 2013, 03:05:47 pm »
My question has been well answered :)

My main concern is that when I am developing for PostgreSQL or MySQL administrative access is required to set up the database and user management can be somewhat complicated, especially when it is a quick and dirty trial.
SQLite gives quick direct access but is not available over the network and you can easily get caught by its quirks, but it has to be admitted that it is by design and well documented.
Firebird strikes the required balance between 'copy and take it with you' and accessibility of the network.


Is one of Firebird's advantages the fact that although the databases can be stored in any location, they can be accessed of the network as well, and that copying the database somewhere else is simply a matter of well - simply copying it?
Lazarus 3.0/FPC 3.2.2

 

TinyPortal © 2005-2018