FireDAC is the most complete data access layer for RAD Studio, there is no question on that. It also has some special features that puts him ahead of the majority of data access frameworks that are available out there. In this article I'd like to review some of these features that make this framework so productive, as well some resources that are tied specially for apps that will run on Windows 10.
FireDAC has a extensive list of supported databases from local files, passing to client/server and modern cloud database systems.
Below we have a (not complete) list of databases that are supported by FireDAC, native or via ODBC drivers:
IBM DB2 Server
Microsoft Access Database
Microsoft SQL Azure
Microsoft SQL Server
Microsoft SQL Server CE
Sybase Adaptive Server Everywhere
Sybase SQL Anywhere
I'm saying it's not a conclusive list just because now we have the Enterprise Connectors, which adds 170+ drives to FireDAC, allowing directly connections to virtually any application or data source:
These Enterprise Connectors are available as a add-on package for Delphi and C++ Builder, but sounds like the regular package (around 70+ drivers) will be available as part of our Enterprise/Architect editions very soon. Please, take a look on this blog post for more details: https://community.idera.com/developer-tools/b/blog/posts/gm-update.
Not only FireDAC has support for a ton of databases and applications, but also this framework was designed with multi-platform in mind. With FireDAC you can use exactly the same components and code for all platforms that are supported by RAD Studio. Of course, some drivers are limited to the platform where the database has client support for, but in general, you can use FireDAC for Win32/64, MacOS 32/64, Linux64, iOS64 (32 bit iOS is already deprecated) and Android 32/64 (64 bit Android application are now on beta and will be available with 10.3.3 in accord with our road-map: https://community.idera.com/developer-tools/b/blog/posts/august-2019-delphi-android-beta-plans-august-roadmap-update).
As a example, when targeting Windows 10, there are some databases that are available exclusively for this platform. This is the case of MS Access, to mention one. But even on a situation like this, you can easily connect this local database using the same components used for any other database, single or multi-platform. If you are interested in MS Access, this link will provide you the connection details and a sample as well: http://docwiki.embarcadero.com/RADStudio/Rio/en/Connect_to_Microsoft_Access_Database_(FireDAC)
Two outstanding features
Among the impressive list of advanced features that are part of the framework (http://docwiki.embarcadero.com/RADStudio/Rio/en/Category:FireDAC), I'd like to pick two that I really like a lot.
First is the Local SQL Engine. Let's imagine a scenario where you need to put some data together in a report, or a dashboard, and this data isn't consolidated in just one place. This is the perfect place where you can use the LocalSQL feature. You can establish a connection to each one of your data sources, than prepare datasets that brings the data you have available in each one of these data sources, and finally you can create a in-memory SELECT statement, using standard ANSI-SQL, where you will join the data from these heterogeneous datasets, and generating a single result like if the data was centralized in just one database. Isn't that a incredible feature? More about this, as well a sample, can be found here: http://docwiki.embarcadero.com/RADStudio/Rio/en/Local_SQL_(FireDAC).
Another one is the Data Type Mapping feature. For those who needs to support multiple databases platforms in the same application, this is a killer feature. The Data Type Mapping feature is available at the connection level, or dataset level, and allows you to map the physical datatype from the database to a desired logical datatype in your application. So, with this, you can adjust the differences between datatypes that exists among the distinct database platforms. At the end, you can easily have a system supporting, let's say, Oracle, MSSQL and Interbase at the same time! Here you can find more information about this powerful feature: http://docwiki.embarcadero.com/RADStudio/Rio/en/Data_Type_Mapping_(FireDAC).
BDE (and other frameworks) Migration
When talking about Delphi/C++ Builder Windows database applications that were created in the early versions of RAD Studio, there is a common element that normally appears: the BDE.
BDE is a legacy technology that was discontinued by Delphi 7 era, and per obvious reasons, has no a good support for modern versions of Windows, specially Windows 10. So, migrating from BDE is a mandatory thing for any modern application.
But no worries here! FireDAC offers a good support and tools for BDE migration. You can use the "reFind" tool to automate the process of replacing old BDE components to the FireDAC counterparts easily. This tool is based on scripts with regular expressions that will automatically perform the components migration in a very smart way. And not only BDE is support, but you can migrate also dbExpress and AnyDAC projects in the same way. Actually, as the tool is based in a script, this makes possible to create a script to migrate virtually any framework to FireDAC.
To help you to get started with your migration process, here you have some useful links:
Are you interested in knowing more about FireDAC, migration from BDE to support the most recent versions of Windows 10, or performance tips and tricks?
If so, below you have some links that may help:
- FireDAC Skill Sprints: https://www.youtube.com/playlist?list=PLwUPJvR9mZHgjJ0JtSqJ-dv2cGtWr-jtq
- FireDAC in Depth with Cary Jensen (2 hours video!): https://www.youtube.com/watch?v=wS1A3v5_l98
- FireDAC book (also from Cary Jensen): http://www.jensendatasystems.com/firedacbook/