And we are back! This is a new entry from the series about Interbase for .NET developers. Doing a recap, the first post “Introducing InterBase for .NET – A Super-Secure Embedded Data Warehouse For .NET Users” can be found here, the second post “Getting Started With InterBase For .NET – Install, Configure And Secure Your Data in Minutes” is available through this link, and the third post from this series “Your first .NET/Interbase App – How to connect .NET and the Interbase secure data store” is available right here.
Today let’s dive in one of the most impactful Interbase features: Interbase Embedded!
Table of Contents
Warming Up
In the previous post we’ve created a .NET App that connects to a remote Interbase instance and execute some actions. The idea here is to convert this app from a client/server model to use the so called embedded model.
So, just in case you haven’t done this yet, please, go back to the previous post and construct the sample described there as this would be our start point.
Interbase Embedded
An embedded database system is a database management system (DBMS) which is tightly integrated with an application software; it is “embedded in the application”.
This is the definition of what an “embedded” database is. And doing a quick search around you’ll find a lot of platforms that claims being an embedded database, but actually they are not. Not in the strict sense of what a database should be.
Few of them are really databases, meaning they implement the main aspects of a DBMS system. But Interbase is the only one where you’ll find all the features from a standard database server also available when using it as a embedded database.
This means you can work in a embedded system in the exactly same way from a traditional client/server solution. With Interbase embedded you can use the exactly same standard SQL syntax, you can use transactions and multi-transactions, you can leverage user control and security and data encryption as well, to mention few options.
Additionally, the Interbase metadata (the database artifacts definition) is 100% compatible among the tradicional Server, Desktop and Embedded editions, doesn’t matter in which platform you are deploying!
Converting from IB Server to IB Embedded
Considering Interbase is 100% compatible between the server and embedded model, as well between the supported platforms, there is almost zero changes in terms of the development process and the database creation as well. Actually, you can create the database on Windows, for example, than deploy it to another platform with zero changes, it’s just compatible. So, considering our last sample, all that we need to change is the Interbase connection string to reflect which database engine we want to use.
As you can see, moving from the Server connection (named as IBServer) to the Embedded model (named as IBToGo) is basically a matter of changing few parameters:
- The data source property will be always setted as “local”
- The database is now located at the same folder from the application executable
- The server type is now “1”, which means Embedded, instead of “0” that denotes the Server movel
And basically that is all we need!
Testing the App
Let’s do a quick review in the app source code and also see it in action using the embedded version of Interbase: