A newer version of Platform is available.

View latest

Configuring Connections to External Data Stores

You can define reusable connections to external data stores in your members' configuration files or with the Java member API. When you have a configured connection, you can then use it in the Pipeline API, SQL mappings, and MapStores.

Quickstart Configuration

To configure a connection to the external data store, you must provide a unique identifier for the connection as well as a factory that creates the connection.

This example configuration defines connections to both a MySQL database and a H2 data store.

  • XML

  • YAML

  • Java

  <external-data-store name="my-mysql-database">
      <property name="jdbcUrl">jdbc:mysql://mysql.example.org:3306</property>
      <property name="username">my_user</property>
      <property name="password">my_password</property>
  <external-data-store name="my-other-database">
      <property name="jdbcUrl">jdbc:h2:mem:my-other-database</property>
      class-name: com.hazelcast.datastore.JdbcDataStoreFactory
        jdbcUrl: jdbc:mysql://mysql.example.org:3306
        username: my_user
        password: my_password
      shared: true
      class-name: com.hazelcast.datastore.JdbcDataStoreFactory
        jdbcUrl: jdbc:h2:mem:my-other-database
      shared: true
    new ExternalDataStoreConfig("my-mysql-database")
      .setProperty("jdbcUrl", "jdbc:mysql://mysql.example.org:3306")
      .setProperty("username", "my_user")
      .setProperty("password", "my_password")
    new ExternalDataStoreConfig("my-other-database")
      .setProperty("jdbcUrl", "jdbc:h2:mem:my-other-database")

Configuration Options for External Data Stores

The external data store has the following configuration options:

If you are using Java to configure the Mapstore, use the ExternalDataStoreConfig object.

Table 1. External data store configuration options
Option Description



name (required)

The unique identifier for the external data store.

class-name (required)

The name of a com.hazelcast.datastore.ExternalDataStoreFactory implementation that creates instances of an external data store connection.


Any configuration properties that the factory in the class-name configuration expects to receive.


Whether the factory in the class-name configuration returns reusable connections for use in different MapStores, jobs, and SQL mappings. The behaviour of this configuration depends on the implementation of the factory. The default value is true.

Pre-Built Factories

Hazelcast comes with the following pre-built factories that you can configure in the class-name configuration:

Table 2. Factories
Factory Description Properties


Connect to a data store that supports JDBC. Supported data stores include MySQL, PostgreSQL, and H2.

For available configuration properties see HikariCP configuration. This implementation is based on HikariDataSource. All properties are passed directly to HikariConfig.

If there are more JDBC connections used on a single member from a single job, they will share the same data store and connection pool.

If you use the slim distribution of Hazelcast with a built-in data store factory, make sure that you have an appropriate driver on your cluster’s classpath.

You can also add new external data stores dynamically at runtime, see dynamic configuration.

Next Steps

Use your configured connection: