question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integration with RDS

See original GitHub issue

This issue collects all the requirements for RDS support in Spring Cloud AWS 3.0 (based on AWS SDK v2).

The key feature in RDS integration is support for read replicas:

  • use RDS read replicas for readOnly connections (transactions started with @Transactional(readOnly=true)

Additionally we need to support:

Both can be achieved with official drivers:

Regarding read replicas support, in addition to what has been offered in 2.x we must support:

  • ability to choose connection pool (in 2.x only Tomcat pool is supported)
  • ability to choose JDBC driver
  • Add support for passing query parameters to JDBC url #679
  • Aurora

To research:

  • should we support RDS proxy?
  • should we support Aurora Serverless?

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
virajkanwadecommented, Oct 6, 2022

For handling clusters -

can we add a flag cloud.aws.employee-db.isCluster=true

And in https://github.com/spring-attic/spring-cloud-aws/blob/e9e7b8cb158013464caa792b3e2de9cf7179678a/spring-cloud-aws-jdbc/src/main/java/org/springframework/cloud/aws/jdbc/rds/AmazonRdsReadReplicaAwareDataSourceFactoryBean.java#L73

Replace getDBInstance with getDBClusterInstance which uses this.amazonRds.describeDBClusters to get the writer instance and getReadReplicaIdentifiers to get read replica identifiers and rest of the code remains the same?

1reaction
areddy23commented, Oct 6, 2022

Hi I am assuming spring-cloud-starter-aws-jdbc is a “io.awspring.cloud” version of “spring-cloud-aws-jdbc” ( 2.x.x version)

I feel this enhancement request should be backed in to 3.x.x if not already.

Steps to recreate:

  1. Create a Primary RDS(abc) with Read Replicas in 2 diff regions us-east-1(abc-rr-1) and us-west-2(abc-rr-2). When you configure current “spring-cloud-aws-jdbc” to manage traffic to RR’s it fails the reason is as follows.

In 2.x.x the library is attempting to “createInstance” and calls describe-db-instances which results below: (using cli to replicate the issue)

Class: AmazonRdsReadReplicaAwareDataSourceFactoryBean method: createInstance

  1. “aws rds describe-db-instances --db-instance-identifier abc” Primary DB is yielding a list of RR associate with it across regions, please note it is returning DB Identifier for the RR in the same region and arn for the RR in diff region. ============== aws rds describe-db-instances --db-instance-identifier prod-pgsql

From result: “ReadReplicaDBInstanceIdentifiers”: [ “abc-rr1”, “arn:aws:rds:us-west-2:12345678910:db:abc-rr-2” ],

  1. For the above list when li to do “describe-db-instances” for each one “arn:aws:rds:us-west-2:868769925241:db:prod-pgsql-pdx-replica” it is resulting in below error which is consistent with what we are receiving from the application. ============== aws rds describe-db-instances --db-instance-identifier arn:aws:rds:us-west-2:868769925241:db:prod-pgsql-pdx-replica

An error occurred (InvalidParameterValue) when calling the DescribeDBInstances operation: The parameter Filter: db-instance-id is not a valid identifier. Identifiers must begin with a letter; must contain only ASCII letters, digits, and hyphens; and must not end with a hyphen or contain two consecutive hyphens.

Class: AmazonRdsDataSourceFactoryBean method: createDataSourceInstance -> getDbInstance

DescribeDBInstancesResult describeDBInstancesResult = this.amazonRds.describeDBInstances((new DescribeDBInstancesRequest()).withDBInstanceIdentifier(identifier)); -> This results in failure as we are doing describe-db-instances with an arn.

Potential solution: getDbInstance method should identify if aws returned an ARN and convert the describe-db-instances to be following aws rds describe-db-instances --db-instance-identifier abc-rr-2 --region us-west-2 instead of calling directly using ARN.

I am unable to open a PR as I am not sure where this module exists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Integrating an Amazon RDS for SQL Server DB instance with ...
You can transfer files between a DB instance running Amazon RDS for SQL Server and an Amazon S3 bucket. By doing this, you...
Read more >
Amazon RDS and Integrate.io
With an intuitive interface to help you set up and operate your databases, RDS is a cost-efficient solution that can resize to any...
Read more >
Amazon Relational Database Services (RDS) Integrations
Zapier lets you connect Amazon Relational Database Services (RDS) with thousands of the most popular apps, so you can automate your work and...
Read more >
Amazon RDS MySQL Integration: 3 Easy Steps - Hevo Data
Steps to Set Up Amazon RDS MySQL Integration · Step 1: Generate a New MySQL DB Instance · Step 2: Download a Standard...
Read more >
Integrating AWS S3 buckets with AWS RDS SQL Server
Use S3 integration with RDS SQL instance. Once we have applied for the IAM role in the RDS instance, we can connect to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found