Explore Evaluation Guide

Data Querying & Management

Which Query Languages Does Mendix Support?

Mendix offers a number of ways to specify the data you want to retrieve:

  • Mendix Studio Pro offers visual ways to specify your query needs via an expression editor
  • To retrieve specific objects or a set of related objects, you can use XPath expressions (see XPath below)
  • For reporting needs where the aggregation and joining of multiple entities into a single result set is important, Mendix offers OQL queries (see OQL below)
  • A Java API is available if you want to use SQL queries on the application database (see SQL below)
  • For data sharing with other applications or data analytics tools, Mendix offers out-of-the-box support for OData on entities in your domain model (see OData below)

How Can I Optimize My Queries?

The Mendix Platform provides a lot of optimization out of the box. For example, when retrieving data for your pages through XPath, Mendix will automatically retrieve all the related information used on the page in one go. A concept called schemas is used for this. A schema tells the data retrieval component to not only retrieve a specific set of objects from the database, but to include specific associated entities in the result as well.

Besides optimized queries, Mendix also optimizes to avoid the need to query. This is done, for example, in the web client where objects are cached and reused through multiple pages. Another optimization made in the Mendix Runtime uses knowledge of the page structure to determine if objects need to be sent from the Runtime to the client at all.

In addition to these out-of-the-box optimizations, there are a number of steps you can take to optimize your queries:

  • Retrieve only what you need, and make sure you do not include attributes or objects in your query that you do not need
  • Ensure that you have indexes on the following:
    • Columns that are regularly searched or filtered on
    • Columns that are used for sorting

In some cases—especially when you have a large number of objects—it can be helpful to use database-specific indexes. You can create these through the JDBC API, as described above in SQL.

How Can I Migrate Data from My Existing Database?

You may want to use existing data from old non-Mendix applications in your new Mendix application. If you need a one-time migration into your Mendix app, you have the options described below.

How Can I Use My Existing SQL Database in Mendix?

You can use the Database Connector to run SQL actions on any database you are using. To learn more about using an existing SQL database in Mendix, see the section How Does Mendix Support Direct Access to an External SQL Database? in External Data.

What APIs Does Mendix Offer to Extend Data Storage Behavior?

The Mendix Runtime provides Java APIs that enable extending the data storage behavior. Mendix ensures that anybody on your team can use these extensions by enabling you to provide them through normal microflow activities. For more info on this extensibility feature of Mendix, see the section What Kind of APIs Does Mendix Expose? in Openness (API & SDK).

Regarding data storage extensibility, the main Java APIs provide the following functionality:

How Can I Control the Connection Pooling?

You can configure the number of concurrent database connections per runtime to the database using the custom setting ConnectionPoolingMaxActive.

For other relevant pooling settings, see Customization in the Mendix Studio Pro Guide.