Automatically Integrate Apache Ignite with RDBMS

Ignite provides support for integrating with a variety of persistence stores. It allows you to connect to the database, import schemas, configure indexed types, and automatically generate all the required XML OR-mapping configuration and Java domain model POJOs that you can easily download and copy into your project.

Ignite can integrate with any relational database (RDBMS) that supports a JDBC driver - Oracle, PostgreSQL, Microsoft SQL Server, and MySQL.

RDBMS Integration Wizard

Ignite supports automatic RDBMS integration via Ignite Web Console which is an interactive configuration wizard, management and monitoring tool that allows you to:

  • Create and download various configurations for your Ignite cluster.
  • Automatically construct Ignite's SQL metadata from any RDBMS schemas.
  • Execute SQL queries over your in-memory caches.
  • View query execution plans, in-memory schemas and streaming charts.
 

Click on the image to view full size.

Ignite Web Console is an innovative tool that offers plenty of rich functionalities to manage the Ignite cluster and is not limited to features mentioned above.

Example

Here is an example of automatically generated Person class, as well as Java and XML configurations, imported from a MySQL PERSON table via Ignite Web Console.

                            <bean class="org.apache.ignite.configuration.IgniteConfiguration">
                                ...
                                <property name="cacheStoreFactory">
                                    <bean class="org.apache.ignite.cache.store.jdbc.CacheJdbcPojoStoreFactory">
                                        <property name="dataSourceBean" value="dsMySQL"/>
                                        <property name="dialect">
                                            <bean class="org.apache.ignite.cache.store.jdbc.dialect.MySQLDialect"/>
                                        </property>
                                        <property name="types">
                                            <list>
                                                <bean class="org.apache.ignite.cache.store.jdbc.JdbcType">
                                                    <property name="cacheName" value="PersonCache"/>
                                                    <property name="keyType" value="java.lang.Integer"/>
                                                    <property name="valueType" value="com.apache.ignite.myexample.model.Person"/>
                                                    <property name="databaseSchema" value="test"/>
                                                    <property name="databaseTable" value="person"/>

                                                    <property name="keyFields">
                                                        <list>
                                                            ...
                                                        </list>
                                                    </property>

                                                    <property name="valueFields">
                                                        <list>
                                                            ...
                                                        </list>
                                                    </property>
                                                </bean>
                                            </list>
                                        </property>
                                    </bean>
                                </property>
                                ...
                            </bean>
                        
                        /**
                         * This configuration was generated by GridGain Web Console (10/26/2016 11:12)
                         */
                        public class ClientConfigurationFactory {
                            private static final Properties props = new Properties();

                            static {
                                try (InputStream in = IgniteConfiguration.class.getClassLoader().getResourceAsStream("secret.properties")) {
                                    props.load(in);
                                }
                                catch (Exception ignored) {
                                    // No-op.
                                }
                            }

                            /** Helper class for datasource creation. */
                            public static class DataSources {
                                public static final MysqlDataSource INSTANCE_dsMySQL = createdsMySQL();

                                private static MysqlDataSource createdsMySQL() {
                                    MysqlDataSource dataSource = new MysqlDataSource();

                                    dataSource.setURL(props.getProperty("dsMySQL.jdbc.url"));
                                    dataSource.setUser(props.getProperty("dsMySQL.jdbc.username"));
                                    dataSource.setPassword(props.getProperty("dsMySQL.jdbc.password"));

                                    return dataSource;
                                }
                            }
                            ...
                        }
                        
                            /**
                             * Person definition.
                             *
                             * This POJO was generated by GridGain Web Console (10/26/2016 11:12)
                             */
                            public class Person implements Serializable {
                                /** */
                                private static final long serialVersionUID = 0L;

                                /** Value for id. */
                                private int id;

                                /** Value for orgid. */
                                private Integer orgid;

                                /** Value for name. */
                                private String name;

                                /** Value for salary. */
                                private Integer salary;

                                ...
                            }
                        

Hosted Management
Visit our Manage page to learn more about the projects that intend to make user experience with Ignite easier.

Get started with Ignite Web Console