AlloyDB is more accessible now than ever with AlloyDB Express. Express can allow you to try out your prototype with a real SQL database at almost no cost and simultaneously allow for scaling that database as time goes on. In this blog, we will start with a simple generated app, which we will then feed seamlessly feed to AlloyDB Express (actually the other way around) getting a bit more professional with our side projects.
Intro
AlloyDB needs an introduction (don’t go “This needs no introduction” for most things, it doesn’t work).
So to describe AlloyDB properly, lets start with normal SQL servers: a normal Postgres (or any SQL really) is build with a separation between the server and the database. Meaning that you configure a database server and then the database. Compute and storage are also directly coupled, resulting in a need for greater maintenance.
AlloyDB couples compute and storage (and their respective costs) together and allows these factors to scale together in a cluster form. There’s also a lot of stuff in the background to reduce lag, optimize size and such and such. But that’s more for a deepdive.
AlloyDB Express is basically how you kickstart and prototype AlloyDB. It’s the smallest version and is essentially free for 50 compute hours and 2 GB of disk a month (good amount to start out for beginners and testers).
Today we’re going to make a DB Cluster using AlloyDB Express and then use the connection settings to connect to an application in AI Studio where we will build this app afterwards. This means we make the cluster first, and then prompt to prototype the app second.
Scenario
Let’s say you have an app idea, something simple. Here we will use an app for a POS system for a flower shop (this can be literally anything, do whatever you want). If you’re prototyping this app, you think about how to fit the database later, right? Well, lets agree to disagree there. And since this is my blog, you’re about to read that disagreement.
We will create an AlloyDB cluster, we will acquire the credentials. Then we will build the app in AI Studio and feed it the credentials and the AlloyDB docs, focusing and allowing it to use those things in order to have the database part taken care of. It wont be perfect, but we’re just trying to show how it works.
Provision a Cluster
In the Google Cloud console, search of AlloyDB in your search bar, activate the APIs if needed, and then you’ll reach this page:
At the AlloyDB choce, hit “Create cluster” for AlloyDB Express, you’ll reach a configuration menu, set your own password and change regions if you’d like (you will also see the free tier pricing there, very helpful):
Remember, Public DNS is how the DB will be connected to your site, so if that is not enabled, do so.
Prompt AI Studio
Go to aistudio.google.com (You’ve probably heard about it by now)
Here’s what I prompted AI Studio (can be more complex if you’d like, but we’re not going to burden ourselves with details here):
Build a POS system for a flowershop. Use AlloyDB Express as the database. the cluster name provisioned is cluster_name_here in the project your_project_here with the password password_here in the region region_here
I actually made a mistake here, I should have also fed it the AlloyDB documentation as a URL to drive it, but lets see how it works.
Some time later….
Final result
Okay … not as simple as I’d imagined, but it guides you to finishing your connection!
The final result in the UI:
And here’s what a quick cheeky check in the AlloyDB Studio reveals:
So we’re golden! Though note that the AI created this entire schema, so maybe all of it is not necessary. Regardless, we’ve backtracked from the app to the database. Something I used to make interns do as a starter project. Great success!
Conclusion
Having a DB connection is nice, having a free one for experimentation is great, mess around with it, piggyback your app (or apps off of it), even the AI will appreciate your grounded approach. Remember to clean up your AlloyDB clusters afterwards.





