In some cases, the solution needs to work with organizations who want to keep the Database separately from Mendix or want to use the existing database.
First, it is possible to build a Mendix application and to bring your own database. But the question is how your Mendix application can work seamlessly with your existing database tables & data. The solution(s) we are discussing and elaborating here is not applicable in case the existing application is being developed with a Microservices or Service Oriented Architecture, with this architecture mostly the database operations are handled using APIs.
There are ways Mendix can work with existing database tables, but how? Each of our problem statements is different, but it can be broadly classified and sectioned into a few questions that we need to answer and identify the right approach for our problem statement(s)
1. How do we want to provide access to the database?
2. Are we going to share this database with other applications?
3. Are we migrating the application, which uses your current database, to Mendix?
4. Do you want to migrate Mendix database but a different database like MSSQL to Postgres using Mendix?
Below are the tools and techniques to choose from
1. Database Replication
2. Database Connector
3. Mendix Modeller Configuration
4. Database as a Web Service – REST, OData, SOAP
5. Mendix Platform SDK (Programmatic solution)
We at Indium Software put together our knowledge and experience with the simple matrix to choose the right option at given point in time based on the problem the customer faces.
You can use the Database Replication module to import data from existing databases into your Mendix application. You have the ability to specify the mapping for each table, column, and relationship to your Mendix domain model. Even complex mappings involving multiple table joins can be achieved. The configuration can be done either in the client or using Java.
The data is updated in both systems thanks to scheduled synchronization between your application and a database used by another application.
Typical use case, during the phases of migration of the application. We do not recommend keeping two copies of the same data. This will cause the data to be inconsistent. So, choose wisely.
|Database Supported||Type||Category||Sub Category||Company||Support||Link|
|Mendix Guide||Module||Addons||Connectors||Mendix||Platform||DB Connectors|
GitHub Link: https://github.com/mendix/database-connector
The Database Connector allows for a quick connection to external DBs (databases), offering you the freedom to choose from a wide range of databases and SQL dialects. This enables you to integrate your external data directly into your Mendix application without any limitations.
The connector supports below functionality to execute queries at your databases:
These are the prerequisites for using this connector:
These settings can be configured as follows:
Web Services provide a solution to the interoperability issue by enabling different applications to connect their data. With Web Services, you can transfer data between diverse applications and platforms. To allow Mendix to use an existing database, you can expose the required functionality as a Service, making it easily accessible by Mendix.
Mendix supports the most widely used web service standards, including SOAP, REST, and OData. However, creating a wrapper for an existing database to connect with Mendix may require additional effort. The recent trend towards Service-Oriented Architecture or Microservices promotes API-based connectivity, which is effortless and efficient in Mendix.
On the other hand, if the database is not being utilized by any other applications, it is recommended to use the Data Connector or Data Replication to fully leverage the capabilities of Mendix.
There are few advantages when using Database as a web service when it is exposed as OData. Mendix provides a premium service called Data Hub.
The Mendix Data Hub Catalog is a comprehensive and open metadata repository that is based on industry standards, allowing developers and business experts to find and explore data resources within their interconnected ecosystem.
Data Hub Connectors enable organizations to integrate their data sources with Data Hub, thereby enhancing the catalog and making the data available to developers. Connecting to data from Mendix applications, Siemens Teamcenter, SAP, and numerous other commonly used enterprise data sources can be done with ease.
With Mendix Data Hub you find all data that is available across your Company’s software landscape and use it in your Mendix projects.
Share Data between Mendix Apps – Use and edit Data Assets from one Mendix app in another.
Connect to Non-Mendix Apps – Build an OData wrapper around your non-Mendix App to connect.
Integrated in Studio (Pro) – Use the Data Hub Panel in Studio Pro to search and use for Data Assets.
Search – Finding Connectable Data Sources
Users can find shared datasets by searching the Data Hub Catalog
Register – Sharing Datasets
To make the data from your apps accessible to others, you can publish the datasets as an OData service and register it in Data Hub. In a Mendix application, the datasets correspond to the Entity sets for a specified Entity
Consume – Using Registered Datasets
Assets that have been registered in the Data Hub Catalog can be utilized in the Mendix Studio Pro for app development. These external data sources are displayed in the domain model as external entities, which can be combined with local entities.
Curate – Maintaining Registered Assets
To make sure the right people find your service, you can edit app owners, add tags and descriptions, and toggle discoverability.
By Uma Raj
By Uma Raj
By Abishek Balakumar