Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,15 @@ Visit [Support for RDS MultiAZ](./docs/using-the-jdbc-driver/SupportForRDSMultiA

### Using the AWS Advanced JDBC Wrapper with Amazon Aurora Global Databases

As of version [3.0.0](https://github.com/aws/aws-advanced-jdbc-wrapper/releases/tag/3.0.0) the driver supports in-region `failover` and
As of version [3.0.0](https://github.com/aws/aws-advanced-jdbc-wrapper/releases/tag/3.0.0), the driver supports in-region `failover` and
cross-region `planned failover` and `switchover` of [Amazon Aurora Global Databases](https://aws.amazon.com/ru/rds/aurora/global-database/).
A [Global Writer Endpoint](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-connecting.html)
is also recognized and can be handled to minimize potential stale DNS issues.
Please check [failover plugin](./docs/using-the-jdbc-driver/using-plugins/UsingTheFailoverPlugin.md), [failover2 plugin](./docs/using-the-jdbc-driver/using-plugins/UsingTheFailover2Plugin.md) and
[Aurora Initial Connection Strategy plugin](./docs/using-the-jdbc-driver/using-plugins/UsingTheAuroraInitialConnectionStrategyPlugin.md) for more information.

For detailed configuration instructions, see [Aurora Global Databases](./docs/using-the-jdbc-driver/GlobalDatabases.md).

### Plain Amazon RDS databases

The AWS Advanced JDBC Wrapper also provides limited functionality for RDS provided databases that are not Aurora, see the compatability matrix for details.
Expand Down
1 change: 1 addition & 0 deletions docs/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [Getting Started](./GettingStarted.md)
- [Using the AWS Advanced JDBC Wrapper](./using-the-jdbc-driver/UsingTheJdbcDriver.md)
- [Data Sources](./using-the-jdbc-driver/DataSource.md)
- [Aurora Global Databases](./using-the-jdbc-driver/GlobalDatabases.md)
- [Logging](./using-the-jdbc-driver/UsingTheJdbcDriver.md#logging)
- [Telemetry](./using-the-jdbc-driver/Telemetry.md)
- [JDBC Wrapper Parameters](./using-the-jdbc-driver/UsingTheJdbcDriver.md#aws-advanced-jdbc-wrapper-parameters)
Expand Down
2 changes: 2 additions & 0 deletions docs/using-the-jdbc-driver/CompatibilityDatabaseTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This document is part of the [Compatibility Guide](./Compatibility.md) and expla

For example, the `limitless` plugin is incompatible with [Aurora Global Database](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html) because it's built on different architectural principles than [Limitless Database](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/limitless-architecture.html). Aurora Global Database doesn't use transaction routers and doesn't provide the transaction routers' metadata. This lack of required metadata makes it incompatible with the `limitless` plugin.

For Aurora Global Database configuration details, see [Aurora Global Databases](./GlobalDatabases.md).


| Plugin codes / Database types | [Aurora Global Database](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html) <br>(MySQL and PG) | [Aurora Cluster](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/Aurora.Overview.html) <br>(MySQL and PG) | [RDS Multi-AZ DB Cluster deployment (3 instances)](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) <br>(MySQL and PG) |
|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down
130 changes: 130 additions & 0 deletions docs/using-the-jdbc-driver/GlobalDatabases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# Aurora Global Databases

> **Since version:** 3.0.0

The AWS Advanced JDBC Wrapper provides comprehensive support for [Amazon Aurora Global Databases](https://aws.amazon.com/rds/aurora/global-database/), including both in-region and cross-region failover capabilities.

## Overview

Aurora Global Database is a feature that allows a single Aurora database to span multiple AWS regions. It provides fast replication across regions with minimal impact on database performance, enabling disaster recovery and serving read traffic from multiple regions.

The AWS Advanced JDBC Wrapper supports:
- In-region failover
- Cross-region planned failover and switchover
- Global Writer Endpoint recognition
- Stale DNS handling

## Configuration

The following instructions are recommended by AWS Service Teams for Aurora Global Database connections. This configuration provides writer connections with support for both in-region and cross-region failover.

### Writer Connections

**Connection String:**
Use the global cluster endpoint:
```
<global-db-name>.global-<XYZ>.global.rds.amazonaws.com
```

**Configuration Parameters:**

| Parameter | Value | Notes |
|-----------|-------|-------|
| `clusterId` | `1` | See [clusterId parameter documentation](./using-plugins/UsingTheFailover2Plugin.md#failover-plugin-v2-configuration-parameters) |
| `wrapperDialect` | `global-aurora-mysql` or `global-aurora-pg` | |
| `wrapperPlugins` | `initialConnection,failover2,efm2` | Without connection pooling |
| | `auroraConnectionTracker,initialConnection,failover2,efm2` | With connection pooling |
| `globalClusterInstanceHostPatterns` | `?.XYZ1.us-east-2.rds.amazonaws.com,?.XYZ2.us-west-2.rds.amazonaws.com` | See [documentation](./using-plugins/UsingTheFailover2Plugin.md) |

> **Note:** Add additional plugins according to the [compatibility guide](./CompatibilityCrossPlugins.md).

### Reader Connections

**Connection String:**
Use the cluster reader endpoint:
```
<cluster-name>.cluster-ro-<XYZ>.<region>.rds.amazonaws.com
```

**Configuration Parameters:**

| Parameter | Value | Notes |
|-----------|-------|-------|
| `clusterId` | `1` | Use the same value as writer connections |
| `wrapperDialect` | `global-aurora-mysql` or `global-aurora-pg` | |
| `wrapperPlugins` | `initialConnection,failover2,efm2` | Without connection pooling |
| | `auroraConnectionTracker,initialConnection,failover2,efm2` | With connection pooling |
| `globalClusterInstanceHostPatterns` | Same as writer configuration | |
| `failoverMode` | `strict-reader` or `reader-or-writer` | Depending on system requirements |

> **Note:** Add additional plugins according to the [compatibility guide](./CompatibilityCrossPlugins.md).

## Example Configuration

### Java Code Example

```java
import java.sql.Connection;
import java.sql.DriverManager;
import java.util.Properties;

public class GlobalDatabaseExample {
public static void main(String[] args) throws Exception {
// Writer connection
String writerUrl = "jdbc:aws-wrapper:mysql://my-global-db.global-xyz.global.rds.amazonaws.com:3306/mydb";
Properties writerProps = new Properties();
writerProps.setProperty("user", "username");
writerProps.setProperty("password", "password");
writerProps.setProperty("clusterId", "1");
writerProps.setProperty("wrapperDialect", "global-aurora-mysql");
writerProps.setProperty("wrapperPlugins", "initialConnection,failover2,efm2");
writerProps.setProperty("globalClusterInstanceHostPatterns",
"?.cluster-abc123.us-east-1.rds.amazonaws.com,?.cluster-def456.us-west-2.rds.amazonaws.com");

Connection writerConn = DriverManager.getConnection(writerUrl, writerProps);

// Reader connection
String readerUrl = "jdbc:aws-wrapper:mysql://my-cluster.cluster-ro-xyz.us-east-1.rds.amazonaws.com:3306/mydb";
Properties readerProps = new Properties();
readerProps.setProperty("user", "username");
readerProps.setProperty("password", "password");
readerProps.setProperty("clusterId", "1");
readerProps.setProperty("wrapperDialect", "global-aurora-mysql");
readerProps.setProperty("wrapperPlugins", "initialConnection,failover2,efm2");
readerProps.setProperty("globalClusterInstanceHostPatterns",
"?.cluster-abc123.us-east-1.rds.amazonaws.com,?.cluster-def456.us-west-2.rds.amazonaws.com");
readerProps.setProperty("failoverMode", "strict-reader");

Connection readerConn = DriverManager.getConnection(readerUrl, readerProps);
}
}
```

## Important Considerations

### Plugin Selection
- **Connection Pooling**: Include `auroraConnectionTracker` plugin when using connection pooling

### Global Cluster Instance Host Patterns
The `globalClusterInstanceHostPatterns` parameter is **required** for Aurora Global Databases. It should contain:
- Comma-separated list of host patterns for each region
- Different cluster identifiers for each region (e.g., `XYZ1`, `XYZ2`)
- Proper region specification for custom domains: `[us-east-1]?.custom.com`

### Failover Behavior
- **In-region failover**: Automatic failover within the same region
- **Cross-region failover**: Planned failover to a different region
- **DNS handling**: The `initialConnection` plugin helps mitigate stale DNS issues

## Compatibility

For detailed compatibility information, see:
- [Database Types Compatibility](./CompatibilityDatabaseTypes.md)
- [Endpoint Types Compatibility](./CompatibilityEndpoints.md)
- [Cross-Plugin Compatibility](./CompatibilityCrossPlugins.md)

## Related Documentation

- [Failover Plugin v2](./using-plugins/UsingTheFailover2Plugin.md)
- [Aurora Initial Connection Strategy Plugin](./using-plugins/UsingTheAuroraInitialConnectionStrategyPlugin.md)
- [Database Dialects](./DatabaseDialects.md)
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ This plugin also helps retrieve connections more reliably. When a user connects

When using Aurora Global Database, the user has an option to use an [Aurora Global Writer Endpoint](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database-connecting.html). The Global Writer Endpoint makes a user application configuration easier. However, similar to the cluster writer endpoint mentioned above, it can also be affected by DNS updates. The Aurora Initial Connection Strategy Plugin recognizes an Aurora Global Writer Endpoint and substitutes it with the current writer endpoint.

For detailed Aurora Global Database configuration, see [Aurora Global Databases](../GlobalDatabases.md).

Verify plugin compatibility within your driver configuration using the [compatibility guide](../Compatibility.md).

## Plugin Availability
Expand Down
Loading