Streamlining AlloyDB Development with Spring Boot, Quarkus, Micronaut, AlloyDB Express, and AlloyDB Omni
(this is Part 3 of a Java tour of Google Cloud Databases series. See Part 1: Introduction and Part 2: AlloyDB Core Connectivity & IAM Auth)
In Part 2, we wired up passwordless IAM connectivity to AlloyDB using the AlloyDB Java Connector across plain JDBC, Spring Boot, Quarkus, and Micronaut.
Getting SELECT ‘Connection Successful!’ to print on startup is a great milestone, but real-world Java development starts after the connection pool is initialized. Once your framework is connected, two practical questions immediately come up:
- How do we write clean, idiomatic data-access code against AlloyDB in Spring Boot (or Quarkus and Micronaut)?
- Where should our AlloyDB databases live across our development, CI/CD, and production environments? And how do AlloyDB Express and AlloyDB Omni enhance the developer experience and the architect’s palette of choices?
Let’s tackle both.
Idiomatic Data Access in Spring Boot, Quarkus, and Micronaut
Since we already configured spring.datasource.* (and its Quarkus and Micronaut equivalents) in Part 2, our application code doesn’t need a single line of cloud-specific connection boilerplate. We can focus purely on domain modeling, SQL, and transaction boundaries.
Building the Repository & REST Layer in Spring Boot (JdbcClient)
For relational workloads on AlloyDB where you want full control over PostgreSQL-specific SQL features (like RETURNING, JSONB operators, Common Table Expressions, or vector distance queries) without the overhead of a stateful ORM session, Spring Boot fluent JdbcClient paired with Java record types is hard to beat.
Here is a production-style FilmRepository operating on the film table from our DVD Rental database:
https://medium.com/media/89dbe2184bcc3f4819005b26b3e87938/href
Exposing this repository through a Spring Boot REST controller is straightforward:
https://medium.com/media/278fe960abe2315f7db623e0148194dd/href
How the Same Data Layer Looks in Quarkus and Micronaut
Because the AlloyDB Java Connector sits transparently underneath the DataSource we configured in Part 2, Quarkus and Micronaut developers use their native data abstractions in the exact same way:
Micronaut generates the JDBC query implementation at compile time via annotation processing, without runtime reflection and thus really fast startup. Make sure to add io.micronaut.data:micronaut-data-jdbc to <dependencies> and register io.micronaut.data:micronaut-data-processor inside maven-compiler-plugin’s <annotationProcessorPaths> in pom.xml (otherwise Micronaut cannot generate the repository bean and throws NoSuchBeanException at runtime):
<!-- In pom.xml <dependencies> -->
<dependency>
<groupId>io.micronaut.data</groupId>
<artifactId>micronaut-data-jdbc</artifactId>
</dependency>
<!-- In pom.xml <build><plugins> under maven-compiler-plugin -->
<annotationProcessorPaths combine.children="append">
<path>
<groupId>io.micronaut.data</groupId>
<artifactId>micronaut-data-processor</artifactId>
<version>${micronaut.data.version}</version>
</path>
</annotationProcessorPaths>
https://medium.com/media/24161a2012708c73018dbd7617faae54/href
Quarkus developers can inject AgroalDataSource directly or add io.quarkus:quarkus-hibernate-orm-panache to pom.xml and use Panache active records/repositories on top of the AlloyDB connection pool:
https://medium.com/media/34f114bdd6218a4602024fa7bc4be977/href
Note: if your dvdrental rating column uses the PostgreSQL custom enum mpaa_rating rather than VARCHAR, make sure to annotate rating with @JdbcTypeCode(SqlTypes.NAMED_ENUM) in Hibernate 6. Also, if running Quarkus 3.18 on JDK 25, you’ll need to add -Dnet.bytebuddy.experimental=true to .mvn/jvm.config).

Until recently, Java developers who wanted to prototype or run integration tests against AlloyDB-specific features (like ScaNN vector indexes, the Columnar Engine, or AlloyDB AI) without paying for an always-on production cloud cluster turned to local container environments. Google Cloud now provides two distinct solutions tailored for different deployment needs and developer workflows: AlloyDB Express and AlloyDB Omni.
AlloyDB Express: Cloud Inner-Loop & Rapid Prototyping
AlloyDB Express is a new offering (November 2026) is built for rapid cloud prototyping, on-demand CI/CD environments, and AI coding agents, and removes the typical setup friction of managed database clusters in Google Cloud:
- You (or your AI coding agent via MCP) can spin up an AlloyDB Express PostgreSQL 18 database in under two seconds via gcloud, Cloud Console, REST API, or via Terraform. In my case, in europe-west2, my cluster creation completed in 0.27 seconds and the 1-vCPU primary instance reached READY state in 0.78 seconds. That’s 1.05 seconds total database provisioning time, compare that to booting a local container!
- After 15 minutes of inactivity, AlloyDB Express automatically pauses compute (scaling to zero means $0.00 while paused!) and wakes up transparently within seconds when your app sends its next query. Combined with 50 free Compute Units per month, every developer can afford their own isolated cloud database.
- An AlloyDB Express instance runs inside Google Cloud with true IAM Database Authentication, Private Service Connect (PSC), and built-in AI / Gemini SQL functions (ai.if, ai.rank, ai.generate).
- You can also upgrade your AlloyDB Express cluster to a full AlloyDB cluster by adding High Availability (HA), Read Pools, and continuous backups without changing your data, IAM users, or Java alloydbInstanceName connection string (do you need to bump the infra to 2 vCPUs).

Note: during Public Preview, AlloyDB Express is available only in a select set of regions: us-west1, europe-west2, asia-east1, asia-east2, asia-northeast1, asia-southeast1, and australia-southeast1.
Notice that Express instances use –enable-public-dns (which provides a public DNS endpoint like *.a.europe-west2.alloydb.s.cloud.goog.) rather than–assign-inbound-public-ip, and connecting via the AlloyDB Java Connector (alloydbIpType=PUBLIC) works out of the box without needing–authorized-external-networks IP allowlisting:
# 1. Create the AlloyDB Express cluster (~0.27s)
gcloud beta alloydb clusters create my-express-cluster \
--region=europe-west2 \
--password=MySecurePassword123! \
--enable-express \
--project=my-gcp-project
# 2. Create the 1-vCPU zonal primary instance with Public DNS & IAM auth (~0.78s)
gcloud beta alloydb instances create my-express-primary \
--cluster=my-express-cluster \
--region=europe-west2 \
--instance-type=PRIMARY \
--cpu-count=1 \
--enable-public-dns \
--database-flags=alloydb.iam_authentication=on \
--project=my-gcp-project
Structuring Spring Profiles for AlloyDB Express vs. Production
AlloyDB Express uses the exact same alloydb-jdbc-connector and IAM authentication as a full AlloyDB cluster, so switching between an Express sandbox and production is just a Spring profile toggle away (mvn spring-boot:run -Dspring-boot.run.profiles=express, where the Spring Boot 4.0 context starts in 0.40s), with one important pool setting (minimum-idle=0) so your local app doesn’t block scale-to-zero!
# src/main/resources/application-express.properties
spring.datasource.url=jdbc:postgresql:///dvdrental?socketFactory=com.google.cloud.alloydb.SocketFactory&alloydbInstanceName=${ALLOYDB_EXPRESS_URI}&alloydbEnableIAMAuth=true&alloydbIpType=PUBLIC
spring.datasource.username=${ALLOYDB_IAM_USER}
# Let HikariCP drop to 0 connections when idle so AlloyDB Express can auto-pause after 15m!
spring.datasource.hikari.minimum-idle=0
spring.datasource.hikari.maximum-pool-size=5
spring.datasource.hikari.idle-timeout=300000
spring.datasource.hikari.connection-timeout=30000
AlloyDB Omni — Hybrid Production & Integration Testing
AlloyDB Omni is Google Cloud’s downloadable database designed to run production workloads outside Google Cloud. If regulations require strict on-premises data residency, or if your Java application runs on a factory floor, retail edge site, Red Hat OpenShift cluster, or another cloud provider (AWS or Azure), AlloyDB Omni offers :
- The exact same AlloyDB query planner, Columnar Engine for real-time HTAP analytics, ScaNN vector index, and AlloyDB AI query capabilities as cloud AlloyDB.
- Deploy HA clusters with automated failover, backups, and read replicas on Kubernetes or OpenShift using the certified AlloyDB Omni Kubernetes Operator.
- Standard PostgreSQL JDBC Connectivity (application-omni.properties) Because AlloyDB Omni runs on your own network rather than behind the Google Cloud AlloyDB Admin API, your Java application connects using standard org.postgresql:postgresql and HikariCP over TLS (no SocketFactory required):
# src/main/resources/application-omni.properties (On-Prem / K8s / Multi-Cloud AlloyDB Omni)
# Set OMNI_SSLMODE=prefer or disable when connecting to a local unencrypted Docker container
spring.datasource.url=jdbc:postgresql://${OMNI_HOST:localhost}:${OMNI_PORT:5432}/dvdrental?sslmode=${OMNI_SSLMODE:require}
spring.datasource.username=${OMNI_DB_USER:postgres}
spring.datasource.password=${OMNI_DB_PASSWORD}
This means FilmRepository and FilmController remain 100% identical across application-express.properties, application-prod.properties, and application-omni.properties!

Since AlloyDB Omni is distributed as a standard OCI container image (google/alloydbomni), you can run fast and offline JUnit integration tests that exercise AlloyDB-specific features (e.g. Columnar Engine), something that would fail on a stock postgres:17 image.
Using Spring Boot's @ServiceConnection and Testcontainers (managed as Testcontainers 2.x in Spring Boot 4.0+), you can spin up an ephemeral google/alloydbomni container during mvn test with zero manual DynamicPropertySource wiring:
<!-- Test dependencies in pom.xml -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-testcontainers</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
Here’s a complete integration test that boots AlloyDB Omni, initializes the schema, tests FilmRepository RETURNING, and verifies that the AlloyDB Columnar Engine is active inside the container:
https://medium.com/media/ab289c29618bb74bd6a861302e9eda75/href
Make sure to check out the full AlloyDB Omni in Containers documentation.
As you can see, you can build idiomatic Java data access layers across Spring Boot, Quarkus, and Micronaut, while leveraging AlloyDB Express for fast cloud prototyping and AlloyDB Omni for hybrid deployments and integration testing.
In Part 4, we will complete our AlloyDB deep dive by looking at Performance Tuning and Monitoring for Java Developers, covering how to size HikariCP pools, avoid common @Transactional traps, trace slow SQL queries from the JVM into AlloyDB Query Insights, and more.
Streamlining AlloyDB Development with Spring Boot, Quarkus, Micronaut, AlloyDB Express, and AlloyDB… was originally published in Google Cloud – Community on Medium, where people are continuing the conversation by highlighting and responding to this story.
Source Credit: https://medium.com/google-cloud/streamlining-alloydb-development-with-spring-boot-quarkus-micronaut-alloydb-express-and-alloydb-af298980f1be?source=rss—-e52cf94d98af—4
