GridGain Developers Hub

RDBMS Integration

Overview

Web Console allows you to configure all the cluster properties and import a schema from an existing database. Web Console will connect to the specified database and generate all the required OR-mapping configuration (XML and pure Java) and Java domain model POJOs.

How It Works

Web Agent should be started near your RDBMS. This application collects the database schema metadata and sends it to Web Console.

importing schema

Database Schema Import

Open Web Console hosted by GridGain in a web browser and sign in or install your own instance of Web Console.

1. Create Cluster Configuration

Create a cluster configuration on the Configuration screen. Refer to the Creating Cluster Configuration page for details.

2. Configure SQL Scheme

On the Configuration page, click on the Import from Database button located on the top right corner of the screen.

import from db

If the Web Agent is not running, Web Console will display a dialog box prompting you to download the Web Agent and start it. The Web agent should be started on the computer that has access to the RDBMS from which the schema will be imported.

run web agent prompt

After the Web Agent is started and connected to the Web server, you will see a step-by-step wizard to import the schema from the database. Note that you may need to copy the JDBC driver for your database to the "jdbc-drivers" folder of Web Agent. You can change the path to the jdbc driver by setting the driver-folder property in the Web Agent configuration.

  1. Configure connection to the database.

    db connection configuration
  2. Select schemas to load the tables from.

    select schema
  3. Select tables to import as domain model and configure mapping between the tables and caches. By default, each table will be imported to a separate partitioned cache.

    select tables
  4. Specify import options and select the cluster that will be associated with the generated caches.

    import options
  5. After importing the schema, go to the AdvancedSQL Schema tab to view the schema and configure other properties.

    edit config

4. Download the Project

Click on the Save and Download button to download your project. The project will contain the following:

  • Spring XML configuration files for the cluster and caches.

  • Java code for the cluster and caches configuration.

  • Java code for server and client nodes.

  • Java code for loading data from the underlying RDBMS.

  • Java code for POJOs.

  • pom.xml with the project description.

project structure

Loading Data

The project generated by Web Console contains a variety of ready-to-use artifacts as described above.

To load the data from the underlying RDBMS, follow these steps:

  • Locate the secret.properties file in the project downloaded from the Web Console, and set the JDBC driver related parameters, such as JDBC URL, name, and password, to the values you used when importing the schema.

  • Start a server node using either the ServerNodeSpringStartup or ServerNodeCodeStartup file.

  • Initiate data preloading from the database into the caches using the LoadCaches startup file.