Skip to content

Amazon Redshift

Amazon Redshift is a fully managed, petabyte-scale data warehouse service in the cloud. It allows users to run complex queries and analyses on large datasets quickly and cost-effectively. Redshift is built to handle large-scale data warehousing and business intelligence workloads, providing a fast and scalable platform for analytics. When integrated with Martini Runtime, Redshift’s powerful data warehouse capabilities can be utilized to manage, query, and process large datasets efficiently within a unified execution environment.

Configuring Amazon Redshift

To configure Martini Runtime to connect to Amazon Redshift, you need to set up a JDBC connection that allows seamless interaction between the system and Redshift. This configuration will ensure that Martini Runtime can communicate with your Redshift cluster, execute queries, and retrieve data from your data warehouse for analytics and processing tasks. Here's a simple guide to adding a new database connection:

Configuration Guide

Via API Explorer: Database connections can be configured using the Martini API Explorer, a user-friendly interface for interacting with the system's APIs. Follow these steps to configure Redshift database connections through the API Explorer:

  1. Access the API Explorer: Open a web browser and navigate to [HOST]:8080/api-explorer/ to access the API Explorer.

  2. Navigate to the Database Tag: Locate and click on the database tag within the API Explorer to explore the database configuration and operation endpoints.

  3. Configure Connection Pool: Use the esbapi/databases endpoint under the database tag to configure and save a new database connection pool.

  4. Use POST to Save a Connection Pool: Use the POST method at /esbapi/databases to save the connection pool. Here is an example of a minimum JSON payload to define a Redshift connection:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
     {
         "name": "[name]",
         "autoStart": true,
         "status": "STARTED",
         "type": "jdbc",
         "url": "jdbc:redshift://[HOST]:[PORT]/[DATABASE]",
         "xa": false,
         "driverClassName": "com.amazon.redshift.jdbc.Driver",
         "username": "[username]",
         "password": "[password]",
         "acquireIncrement": 1,
         "acquisitionInterval": 1,
         "acquisitionTimeout": 30,
         "allowLocalTransactions": true,
         "autoCommit": true,
         "applyTransactionTimeout": false,
         "automaticEnlistingEnabled": true,
         "deferConnectionRelease": false,
         "enableJdbc4ConnectionTest": false,
         "ignoreRecoveryFailures": false,
         "isolationLevel": "READ_COMMITTED",
         "maxIdleTime": 60,
         "minPoolSize": 0,
         "maxPoolSize": 5,
         "preparedStatementCacheSize": 0,
         "shareTransactionConnections": false,
         "twoPcOrderingPosition": 0,
         "useTmJoin": true,
         "loginTimeout": 0
     }
    

    • url: Replace [HOST], [PORT], and [DATABASE] with your Redshift cluster endpoint, port (default 5439), and database name.
    • driverClassName: Specifies the JDBC driver class for Redshift.
    • username: Provide your Redshift username.
    • password: Provide the corresponding password.

Via File System: Alternatively, database connections can be configured directly in the file system by editing the <name>.dbxml file located in the /<martini-home>/conf/db-pool/ directory. This method is helpful in environments where API access is restricted or during initial setup.

Follow these steps to modify Redshift database connections directly through the file system:

  1. Locate the Configuration File: Navigate to the /<martini-home>/conf/db-pool/ directory on your server and find the <name>.dbxml file that corresponds to your Redshift configuration.

  2. Edit the Database Connections: Open the <name>.dbxml file in a text editor and modify the Redshift connection properties.

  3. Save and Restart: After editing the file, save the changes and restart the Martini Runtime instance. This will ensure that the updated configuration is applied across all components of the application.

Here is an example of the minimum dbXML configuration for Amazon Redshift:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
    <database>
        <name>[name]</name>
        <autoStart>true</autoStart>
        <type>jdbc</type>
        <url>jdbc:redshift://[HOST]:[PORT]/[DATABASE]</url>
        <xa>false</xa>
        <driverClassName>com.amazon.redshift.jdbc.Driver</driverClassName>
        <username>[username]</username>
        <password>[encrypted_password]</password>
        <acquireIncrement>1</acquireIncrement>
        <acquisitionInterval>1</acquisitionInterval>
        <acquisitionTimeout>30</acquisitionTimeout>
        <allowLocalTransactions>true</allowLocalTransactions>
        <autoCommit>true</autoCommit>
        <applyTransactionTimeout>false</applyTransactionTimeout>
        <automaticEnlistingEnabled>true</automaticEnlistingEnabled>
        <deferConnectionRelease>false</deferConnectionRelease>
        <enableJdbc4ConnectionTest>false</enableJdbc4ConnectionTest>
        <ignoreRecoveryFailures>false</ignoreRecoveryFailures>
        <isolationLevel>READ_COMMITTED</isolationLevel>
        <maxIdleTime>60</maxIdleTime>
        <minPoolSize>0</minPoolSize>
        <maxPoolSize>5</maxPoolSize>
        <preparedStatementCacheSize>0</preparedStatementCacheSize>
        <shareTransactionConnections>false</shareTransactionConnections>
        <twoPcOrderingPosition>0</twoPcOrderingPosition>
        <useTmJoin>true</useTmJoin>
        <loginTimeout>0</loginTimeout>
    </database>

Configuring Amazon Redshift in Martini Designer

  1. In the Martini Designer's Navigator view, click on the Database icon. It will show you the available database connections and queries.
  2. Right-click on Connections, and you will see the option to add a new database connection.
  3. Specify a name for the connection and select the database type as JDBC.
  4. Fill in the required database connection details (host, port, database, username, password).
  5. Save the changes to establish the connection.

Connection Properties

For more details on constructing a JDBC connection URL for Amazon Redshift, refer to the official Redshift documentation: JDBC Connection URL Reference.

Database Properties

These properties are used to control various aspects of the database behavior. For detailed information on configuring JDBC properties for Redshift, refer to the Configuring JDBC on Martini Server Runtime Documentation.