Skip to content

DynamoDB

Amazon DynamoDB is a fully managed NoSQL database service that delivers fast, predictable performance with seamless scalability. Supporting both document and key-value data models, DynamoDB is ideal for applications requiring low-latency data access at any scale. When integrated with Martini Runtime, DynamoDB’s capabilities are enhanced, enabling organizations to handle large-scale data operations efficiently, ensuring high performance for real-time analytics and data processing.


Configuring DynamoDB with Martini Runtime

Configuring DynamoDB involves integrating its scalable NoSQL database with Martini Runtime to streamline data processing and analytics workflows. Below are the available methods to set up a database connection with Martini Runtime.


1. Via API Explorer

The Martini API Explorer provides an interactive interface for configuring DynamoDB connections.

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

  2. Locate the Database Tag: Find and click on the database tag to access database-related API endpoints.

  3. Save a Connection Pool: Use the POST /esbapi/databases endpoint to configure a DynamoDB connection pool. Example JSON payload:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    {
        "name": "[name]", // Replace with the connection pool name
        "autoStart": false,
        "type": "dynamodb",
        "endpoint": "[dynamodb-endpoint]", // Replace with your DynamoDB endpoint URL
        "authenticationProvider": "AUTO",
        "connectionSettings": {
            "maxConcurrency": 3,
            "maxPendingConnectionAcquires": 32,
            "connectionTimeToLive": 20000,
            "readTimeout": 20000,
            "writeTimeout": 20000,
            "connectionTimeout": 20000,
            "connectionAcquisitionTimeout": 20000,
            "connectionMaxIdleTime": 20000,
            "useIdleConnectionReaper": true
        }
    }
    
    Note: Ensure you replace all placeholders (e.g., [name], [dynamodb-endpoint]) with actual values to avoid misconfigurations.


2. Via File System

Alternatively, configure DynamoDB connections by editing configuration files directly.

  1. Locate the Configuration File: Navigate to the /<martini-home>/conf/db-pool/ directory and find the relevant <name>.dbxml file.

  2. Edit the Configuration: Update the file with the required connection details. Example:

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    <database>
        <name>[name]</name> <!-- Replace with the connection pool name -->
        <autoStart>false</autoStart>
        <type>dynamodb</type>
        <endpoint>[dynamodb-endpoint]</endpoint> <!-- Replace with your DynamoDB endpoint URL -->
        <authenticationProvider>AUTO</authenticationProvider>
        <connectionSettings>
            <maxConcurrency>3</maxConcurrency>
            <maxPendingConnectionAcquires>32</maxPendingConnectionAcquires>
            <connectionTimeToLive>20000</connectionTimeToLive>
            <readTimeout>20000</readTimeout>
            <writeTimeout>20000</writeTimeout>
            <connectionTimeout>20000</connectionTimeout>
            <connectionAcquisitionTimeout>20000</connectionAcquisitionTimeout>
            <connectionMaxIdleTime>20000</connectionMaxIdleTime>
            <useIdleConnectionReaper>true</useIdleConnectionReaper>
        </connectionSettings>
    </database>
    
    Note: Ensure you replace all placeholders (e.g., [name], [dynamodb-endpoint]) with actual values. Maintain the XML structure to avoid configuration errors.

  3. Save and Restart: Save the file and restart Martini Runtime to apply the changes. Restarting ensures all services recognize the updated configurations.

Key Elements of the Configuration: - <name>: Specifies the name of the database connection pool. - <endpoint>: The DynamoDB endpoint URL for your AWS region. - <connectionSettings>: Defines connection limits, timeouts, and reaper settings to optimize performance.

Note: Ensure all XML elements are correctly nested and syntactically valid to avoid runtime issues.


3. Via Martini Designer

Martini Designer provides a graphical interface to easily set up and manage DynamoDB connections.

  1. Open Martini Designer: Launch Martini Designer and navigate to the Database section in the Navigator view.

  2. Add a New Connection: Right-click on Connections and select Add New Connection.

  3. Specify Connection Details:

  4. Name: Enter a unique name for the connection (e.g., MyDynamoDBConnection).
  5. Endpoint: Provide the DynamoDB endpoint URL (e.g., https://dynamodb.us-west-2.amazonaws.com).
  6. Authentication Provider: Select one of the following authentication methods:

    • Auto: Automatically detects available credentials.
    • Static: Enter the AWS Access Key ID and Secret Access Key.
    • Anonymous: No authentication required.
    • System Property: Use system properties to provide credentials.
    • Environment Variable: Provide credentials from environment variables.
    • Credential Profile: Use a specific AWS credential profile stored locally.
    • ECS Container Credential: Use ECS task role credentials.
    • EC2 Instance Profile: Use credentials from an EC2 instance profile.
  7. Test the Connection: Click the Test Connection button to verify that the configuration is correct. Fix any issues reported during the test.

  8. Save the Connection: After a successful connection test, save the connection to finalize the setup.


Connection Properties

These properties control various aspects of DynamoDB connections, such as authentication, timeouts, and concurrency. For more details, refer to the AWS SDK for DynamoDB.


Database Properties

DynamoDB database properties include table configurations, indexing, and access controls. Consult the AWS DynamoDB documentation for in-depth information.