Search code examples
delphifirebirdc++builder32bit-64bitfiredac

C++ Builder 32-bit app connecting to 64-bit Firebird database


We are currently using 32-bit application written in C++ Builder that access 32-bit Firebird server. As a database connection layer we are using Firedac library. We are planning migration to 64-bit version of database machine for some of our clients who are using large databases (> 1e7 records, file size ~ 3GB) because of performance reasons. I want to know what additional steps will this transition require beside uninstalling 32-bit version of Firebird and installing 64-bit version on server side. I am not interested in performance tweaks these I have found elsewhere.

Do I have to recompile my application ? Will this require changes in my application ? Can a 64-bit database be accessed from 32-bit program ?

Do I have to upgrade binary format of database files so they can be used by 64-bit Firebird server or can I use them out-of-the-box ?


Solution

  • Applications communicate with the database through the wire protocol of Firebird, this means that a 32 bit application can talk to a 64 bit Firebird without problems (and vice versa). The only exception is if you use Firebird embedded, as that is just a library in your application.

    So no: you don't need to recompile your application.

    As to your second question (which should have been a separate question): it depends.

    If you are using the ODS (On Disk Structure) of Firebird 2.0 (iirc) or earlier (ODS 11.0 or older), then you must backup and restore the database, as the ODS was different for 32 bit and 64 bit.

    If you are using the ODS of Firebird 2.1 or higher (ODS 11.1 for Firebird 2.1, 11.2 for Firebird 2.5, 12 for Firebird 3) and you are migrating between the same version, then you don't need to backup and restore, as the ODS is the same.

    However if you are migrating between point releases, then you should check the release notes. For example, there have been some problems in older versions of Firebird 2.5 that require backup and restore (or at least index rebuilds) to fix problems.

    If you are migrating from 2.1 (ODS 11.1) to 2.5 (ODS 11.2) then you should backup and restore to upgrade the database ODS so you can use all features of the new version.

    If you are migrating from any older Firebird version (ODS 11.2 or earlier) to Firebird 3.0 (ODS 12), then you must backup and restore to upgrade the ODS (as Firebird 3.0 does not support older ODS versions).

    You can check the ODS version with the gstat -h <your database>.