Skip to content

GoogleCloudPlatform/alloydb-java-connector

AlloyDB Java Connector

CI Maven

NOTE: The Connector is currently in public preview and may contain breaking changes.

The AlloyDB Java Connector is a Java library for connecting securely to your AlloyDB instances. Using a Connector provides the following benefits:

  • IAM Authorization: The Connector uses IAM to ensure only principals with valid permissions are allowed to connect.
  • Improved Security: The Connector uses TLS 1.3 encryption and identity verification between the client connector and the server-side proxy, independent of the database protocol.
  • Convenience: The Connector removes the requirement to use and distribute SSL certificates.

Usage

This library provides a socket factory for use with the JDBC Postgres Driver. At a high level, you will need to:

  1. Configure IAM permissions
  2. Add the Connector and Postgres driver as dependencies
  3. Configure a connection pool that configures the driver to use the Connector as a socket factory

For information on configuring a connection, see the documentation.

Configuring IAM permissions

The Java Connector uses Application Default Credentials (ADC). For information on how to configure Application Default Credentials, see the documentation.

In addition, the associated IAM principal must have the IAM role "Cloud AlloyDB Client" (i.e., roles/alloydb.client). See the docs on AlloyDB IAM permissions for more information.

Debug Logging

The Java Connector supports optional debug logging to help diagnose problems with the background certificate refresh. To enable it, add the following to the file /src/main/resources/application.yml:

logging.level.root=DEBUG

Support policy

Major version lifecycle

This project uses semantic versioning, and uses the following lifecycle regarding support for a major version:

Active - Active versions get all new features and security fixes (that would not otherwise introduce a breaking change). New major versions are guaranteed to be "active" for a minimum of 1 year.

Deprecated - Deprecated versions continue to receive security and critical bug fixes, but do not receive new features. Deprecated versions will be supported for 1 year.

Unsupported - Any major version that has been deprecated for >=1 year is considered unsupported.

Supported JDK versions

We test and support at minimum, any publicly supported LTS JDK version. Changes in supported versions will be considered a minor change, and will be listed in the release notes.

Release cadence

This project aims for a minimum monthly release cadence. If no new features or fixes have been added, a new PATCH version with the latest dependencies is released.

Versioning

This library follows Semantic Versioning.

Contributing

Contributions to this library are always welcome and highly encouraged.

See CONTRIBUTING for more information how to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.

License

Apache 2.0 - See LICENSE for more information.

Notice

Java is a registered trademark of Oracle and/or its affiliates.