I described in a previous post some of the work we’ve done with FirebirdSQL and now it is time to get to work. FirebirdSQL is a relational database that runs on Linux, Windows and many different Unix platforms. It was originally developed in 1981 and has existed under various names and incarnations since that time. Before being released as open source, it was a commercial product published by Borland as InterBase. On the FirebirdSQL (http://www.firebirdsql.org) website you will still find many references to InterBase and even some links into the existing InterBase community. As Firebird moves forward, it seems to be moving further away from its InterBase history so you will have to be sure that any freely available tools you choose specifically support the Firebird release you will be using.
The first decision you will need to make is which version of the product do you want to use. The download page lists three different versions: Firebird 1.0.3, Firebird 1.5.4, and Firebird 2.0.1. When we did our first project with Firebird, version 2.0 was still in beta release so we choose version 1.5.4. Our next project will probably be in version 2.0 assuming that it continues to be a stable release. The platform you are working on may also have an impact on which version you choose to download. From version 1.5 forward, you will also be given a choice to install either the Classic or the Superserver architecture. It is probably a good idea to read the technical notes to get an idea of the pros and cons of each architecture before you install.
The most important thing to note is this: The Classic Architecture allows programs to open a database file directly and spawns a seperate task per user connection. While this may affect scalability, there are some cases where this might be useful and/or faster. The Super Server provides a server process and all SQL requests are handled via the server using a socket. This version uses multiple lightweight threads to process all requests.
So far, we’ve used only the Super Server architecture and if scalability is the most important concern you have, you should choose this option when installing the program. We find the Super Server to be incredibly fast and it uses very little memory. On the production server we currently have in place, we have seen that with an average of between 50 and 100 connections, the server uses between 100Mb and 150Mb of memory consistently.
When you select a version, click on the link and you’ll be transferred to SourceForge where you can download in the installation program. The .exe for Version 2.0 is about 4.1Mb and includes all of the code necessary for either Classic or Super Server Architecture. Once the download is complete you can either install the program on your local computer or any computer you want to designate as the “firebird server”. For testing purposes, you may want to install the program on your local computer, just remember that the ODBC connection requires a server name as part of the connection string and if the server is on your local computer this name MUST be ‘localhost’.
Start the install process for either 1.5 or 2.0 versions and you’ll find that they are very similar with the first step on both being to select a language. Version 1.5 includes Dutch, English, French, and Portuguese. Version 2.0 includes all of these plus Bosnian, Italian, and Spanish. Accept the agreement and read any installation notes, yeah, right :). Select a destination path where you want the program to be installed. Notice that in Version 1.5, the server uses 1.4Mb of space and in Version 2.0, it uses 2.0Mb of space.
The next screen will ask you to select the components that you will need. My personal recommendation is to select the Super Server Binary and all the developer and server components. Once you select all of the additional components the disk usages jumps to a whopping 9.2Mb for Version 1.5 and 14.7Mb for Version 2.0.
Give the system a name for the Start Menu and then you will be asked to set several individual options, such as
- Use The Guardian to control the server: The Guardian is a separate software utility that runs in parallel to the Firebird Server and is designed to restart the Firebird server if it ever fails. If you install the Firebird server as a service it may not be necessary to install the Guardian, however, I’ve installed it anyway and it only uses about 3Mb of memory and very few resources. If memory is a premium on your server, you may consider installing Firebird as a service and then leaving this off.
- Run Firebird as an Application or Server: This is a choice that is strictly up to the developer and is probably more of a development type choice. I can’t imagine a production server where you didn’t run the database server as a service, but I have installed Firebird as an application on my development laptop. This one is your call.
- Start Firebird automatically everytime you boot: Again, this is a developer call, but as in the previous setting, I can’t imagine a production server where you wouldn’t want this to happen automatically.
- Copy Firebird Client Library to <system> directory: Not defaulted, but might be useful if you were using the client driver rather than ODBC which is what we expect to use with FoxPro.
- Generate client library as GDS32.DLL for legacy app support: Defaulted to do so, haven’t needed the GDS32.DLL version because I don’t have any legacy apps, but leave it checked just in case you need it later I guess.
- Install Control Panel Applet?: Defaulted, but it does install a cute little applet in the Control Panel that you can open and quickly start and stop the Firebird server as well as change some of these setup apps even after the server is installed.
You’ll be given a screen to verify your choices and then you can click ‘Install’ and the files are installed to their respective locations. The last choice is to start the Firebird server. If you confirm this, the server will start and any user on your network and/or yourself can begin accessing Firebird database files.
That’s it. The server is installed and is operating. Check it with the Control Panel app to verify it is running, but other than that, you are off and running. There is a firebird.conf file that has some additional settings that you can customize if you choose, but basically you can build a complete SQL app right now and get it working with no other setup. Simply Amazing!
Next up for FoxPro programmers, we’ll talk about installing and using a tool to create, manage and edit databases and we’ll create a test database to play with in later discussions. After that we’ll discuss installing the ODBC drivers and create a DSN and a DSN-Less connection to the database we create.