One of the advantages of Firebird? lazarus / 16-Databases ---------------------------------------------------------------------- vfclists · 2013-05-16 13:54 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? ---------------------------------------------------------------------- BigChimp · 2013-05-16 13:57 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. ---------------------------------------------------------------------- vfclists · 2013-05-16 14:43 The syntax for accessing a database over the LAN is Quoteserver_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? Quote from: BigChimp on May 16, 2013, 03:57:15 pmSharing 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. ---------------------------------------------------------------------- BigChimp · 2013-05-17 06:04 Quote from: vfclists on May 16, 2013, 04:43:29 pmThe syntax for accessing a database over the LAN is Quoteserver_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) ---------------------------------------------------------------------- exdatis · 2013-05-17 06:08 http://www.firebirdfaq.org/faq53/ Regards ---------------------------------------------------------------------- Zoran · 2013-05-17 10:24 Quote from: BigChimp on May 17, 2013, 08:04:07 amTo 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:. 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. ---------------------------------------------------------------------- BigChimp · 2013-05-17 11:13 Quote from: Zoran on May 17, 2013, 12:24:40 pmQuote from: BigChimp on May 17, 2013, 08:04:07 amTo 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. Quote from: Zoran on May 17, 2013, 12:24:40 pmFurther, 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 ---------------------------------------------------------------------- Zoran · 2013-05-17 11:48 Yes, Full is the default, as you can read in the text you quoted: Quote from: BigChimp on May 17, 2013, 01:13:20 pmQuote# (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 · 2013-05-17 11:55 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) ---------------------------------------------------------------------- snorkel · 2013-05-18 00:09 No offence to Firebird users, but I used it extensively awhile back and switched to PostgreSQL and overall PostgreSQL is the superior RDBMS. ---------------------------------------------------------------------- JJVillamor · 2013-05-18 04:55 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 · 2013-05-18 04:59 I agree, although I use both. Still, I prefer the Firebird SQL syntax... Regards ---------------------------------------------------------------------- JD · 2013-05-18 10:09 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. ---------------------------------------------------------------------- BigChimp · 2013-05-18 10:11 @JD: sounds like a fair analogy though ---------------------------------------------------------------------- vfclists · 2013-05-18 13:05 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. Quote from: vfclists on May 16, 2013, 03:54:18 pmIs 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? ---------------------------------------------------------------------- JD · 2013-05-18 15:16 Quote from: vfclists on May 18, 2013, 03:05:47 pmMy 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. For such "quick & dirty trials", you can write a simple interface that you can use to set up the database and manage users. That is what I've done and with that I find that in the long run, I can even hand over such responsibilities to people that are not database administrators. The interface keeps your database access password hidden from the users but lets them manage users and perform basic database administration such as backup, restore, sweep etc. JD ---------------------------------------------------------------------- BigChimp · 2013-05-20 05:45 A bit OT: LibreOffice want to replace HSQLDB with Firebird embedded in their base component: https://bugs.freedesktop.org/show_bug.cgi?id=51780 ... which would make it easier for "normal" people to deal with Firebird DBs (Of course, when/if this happens is up for grabs, but there is some back-and-forth on the firebird-devel list) ---------------------------------------------------------------------- snorkel · 2013-05-20 16:12 you know if postgresql is not running you can copy the data files around just like you can with firebird, it's not a single file but you can just copy them. You can also use Rsync or something like that, the key is the postmaster has to be stopped. I wrote a inno setup script that would "embed" postgres into my install, so doing stuff like that is possible. ---------------------------------------------------------------------- JD · 2013-05-20 18:59 Quote from: BigChimp on May 20, 2013, 07:45:51 amA bit OT: LibreOffice want to replace HSQLDB with Firebird embedded in their base component: https://bugs.freedesktop.org/show_bug.cgi?id=51780 ... which would make it easier for "normal" people to deal with Firebird DBs (Of course, when/if this happens is up for grabs, but there is some back-and-forth on the firebird-devel list) That is wonderful. It reduces the Java dependence little by little. Looking forward to a Java-free LibreOffice.