Skip to main content
AWS Glue logo AWS Glue is a fully managed extract, transform, and load (ETL) service that makes it easy to prepare and transform data for analytics. AWS Glue automatically discovers your data and stores the associated metadata in the AWS Glue Data Catalog, making your data immediately searchable, queryable, and available for ETL operations. You can connect AWS Glue to Firebolt using the Firebolt JDBC driver to build powerful data pipelines that can extract data from various sources, transform it using Spark, and load it into your Firebolt database for high-performance analytics.

Prerequisites

Before connecting AWS Glue to Firebolt, ensure you have:
  • AWS Account – An active AWS account with appropriate permissions to create and manage AWS Glue resources.
  • Firebolt account – An active Firebolt account. If you don’t have one, you can sign up.
  • Firebolt database and engine – Access to a Firebolt database and engine. If you need to create these, see Create a database and Create an engine.
  • Firebolt service account – A service account for programmatic access with its ID and secret.
  • Appropriate permissions – Your service account must be associated with a user that has the appropriate permissions to query the database and operate the engine. Specifically, the user should have USAGE permission on the database and OPERATE permission on the engine. In short, a user should make sure that any operation they wish to perform on the Firebolt database or engine is allowed by the permissions granted to their service account.
  • IAM permissions – AWS IAM permissions to create and manage Glue jobs, connections, and access S3 buckets.

Set up the JDBC connection in AWS Glue

  1. Download the Firebolt JDBC driver JAR from GitHub.
  2. Upload the JAR file to an S3 bucket that your AWS Glue job can access.
  3. Note the S3 path (e.g., s3://your-bucket/jars/firebolt-jdbc-3.x.x.jar).

Create an ETL job with Firebolt

Read data from Firebolt

You can create an AWS Glue job that reads data from Firebolt using the JDBC driver. Below is a sample Glue script that connects to Firebolt to read data and then transforms it.

Write data to Firebolt

You can also write data back to Firebolt using the JDBC driver. Below is an example of how to write the processed data into a Firebolt table.

Configure job parameters

When creating your AWS Glue job, configure these important parameters:
  1. Job properties:
    • Type: Spark
    • Glue version: Choose the latest version (5.0 recommended)
    • Language: Python 3
  2. Advanced properties:
    • Dependent JARs path: s3://your-bucket/jars/firebolt-jdbc-3.x.x.jar
    • Job parameters (optional, can be used to pass dynamic values/creds)
  3. Security configuration: Choose appropriate IAM roles and encryption settings.
  4. Resource allocation: Configure the number of workers and worker type based on your data volume.

DMS-S3-Glue-Firebolt data pipeline

A common use case for AWS Glue with Firebolt is building a data pipeline that processes change data capture (CDC) files from AWS Database Migration Service (DMS). This section covers how to set up an automated pipeline that:
  1. AWS DMS captures changes from source databases and writes them to S3 as CSV files
  2. AWS Glue processes these files incrementally and loads them into Firebolt
  3. Firebolt provides high-performance analytics on the replicated data

Architecture overview

The pipeline handles incremental processing by tracking which files have been processed, ensuring data integrity and preventing duplicate processing.

Prerequisites for DMS integration

In addition to the general prerequisites, you’ll need:
  • AWS DMS replication instance configured to write CDC data to S3
  • S3 bucket where DMS writes the CSV files
  • Glue Data Catalog database and table to track processed files
  • EventBridge or Glue triggers to trigger the job when new files arrive

Set up the processed files tracking table

Create a Glue Data Catalog table to track which files have been processed:
  1. In the AWS Glue console, create a new database (e.g., processed_files_db)
  2. Create a table with the following schema:

DMS-Glue integration script

Here’s a complete Glue script that handles DMS CDC files:

Configure DMS job parameters

When creating your DMS-Glue job, set these job parameters:

Merge query example

Create a merge query that handles CDC operations (Insert, Update, Delete):

Data integrity strategies

To maintain data integrity at scale (50,000+ records per hour), consider these approaches:

Strategy 1: Batch processing with staging

  • Configure DMS to produce a regular number of files every 3-5 minutes
  • Process multiple files in each Glue job run
  • Use batch IDs to group related changes
  • Execute MERGE statements after all files in a batch are loaded
This approach is the one used in the provided Glue script, where files are processed in batches and a merge query is executed after loading all files.

Strategy 2: Single file processing with controlled frequency

  • Configure DMS to produce larger files (every 3+ minutes)
  • Process one file at a time to avoid concurrent job conflicts
  • Use Glue job queuing to handle multiple triggers
This could moves more work on DMS side, but it can simplify the Glue job logic and reduce the risk of concurrent processing issues.

Trigger configuration

Set up EventBridge or S3 event notifications to trigger the Glue job:

Option 1: S3 Event Notifications

This configuration uses the Glue workflow EventBridge trigger to start the Glue job whenever one or more new files are created in the specified S3 bucket.

Option 2: Scheduled triggers

Use a scheduled trigger to run the Glue job at regular intervals (e.g., every 5 minutes). This is useful if you expect DMS to produce files at a consistent rate.

Monitoring and troubleshooting

Key metrics to monitor

  • Files processed per hour: Track throughput
  • Processing latency: Time from file creation to Firebolt load
  • Error rate: Failed file processing percentage
  • Data freshness: Age of the oldest unprocessed file

Common issues

Best practices for DMS integration

  1. File size optimization: Configure DMS to produce files of 10-100MB for optimal processing
  2. Monitoring: Set up CloudWatch alarms for job failures and processing delays
  3. Schema management: Handle schema evolution gracefully with dynamic column mapping
  4. Cost optimization: Use appropriate Glue worker types and auto-scaling
  5. Data validation: Add data quality checks before and after merge operations

Additional resources