- Published on
What is AlloyDB?
- Robin De Neef
During Google I/O 2022, Google announced AlloyDB for PostgreSQL. Promising a fully managed solution with superior query execution time. Is this the new holy grail of database solutions?
Google released AlloyDB as a fully managed, PostgreSQL—compatible database.
Its name is derived from an Alloy, where you combine 2 metals to create something stronger. In this casing, leveraging open-source PostgreSQL by combining it with the power of Google Cloud.
What are the advantages of using AlloyDB?
Less management work compared to CloudSQL
When your database is at capacity and you can’t store more data and your queries become slow, you’ll have to start investigating your server to pinpoint the problem. Out of storage? Bad indexes?
With AlloyDB all this work could be saved, AlloyDB will take care of backups, patching and replication for you. You won’t have to worry about running out of storage thanks to automatic capacity management. It has also built-in features to improve your database performance like adaptive indexing and vacuum management.
AlloyDB puts your queries in ludicrous mode. GCP has written its own storage engine for PostgreSQL and infused it with the power of the cloud. The result? Transactional queries run up to 4 times faster than a traditional PostgreSQL Database. Read connections can also scale horizontally with read pools.
As if that’s not impressive enough, AlloyDB boasts an impressive improvement of up to 100X faster analytical queries. It achieves this thanks to its columnar engine. The columnar has a column store to make it easier to execute SELECT, JOIN and SCAN queries.
It also has a query planner and execution engine to support the column store in queries. If that alone was not enough, the columnar engine has an automatic mode where it populates the column store automatically based on AI recommendations it makes from your queries.
Talking about AI. It’s not only used to elevate AlloyDB to the next level. You can also use the power of AI to elevate your workloads from within AlloyDB thanks to a built-in VertexAI integration. This integration allows you to call machine learning models from within your queries and transactions, allowing you to use those predictions without writing a single line of application code.
As I side note, I did most of my calculations for Europe West, which is slightly pricier than the US regions. Having said that pricing is a bit more on the expensive side. Spinning up a cluster with just the smallest possible primary node will cost you around 200-250 USD a month, depending on your region.
After that, it’s all in 200-250 USD increments. Want to upgrade your primary node to the next possible machine type? 200-250 USD extra. Want to spin up the smallest read pool node? 200-250 USD extra.
I made the comparison with Postgres for CloudSQL in the same region and the price increase was between 80-90% depending on if your workload is more compute or storage heavy. However, if you’d run CloudSQL in High Availability, it’s more expensive than AlloyDB while AlloyDB supports High Availability at the same price point as its standard pricing.
You can check out the pricing page for more information. Good to know is that during the preview period, AlloyDB is free of charge for up to 15,000 USD in compute (equivalent to at least 125 vCPUs and 1,000 GBs of RAM in us-central1) and 650 USD in storage (equivalent to at least 2 TB in us-central1)
How does AlloyDB compare to other databases
While I love all the new features that come by default in AlloyDB. The higher price point doesn’t particularly make it the go-to option for any PostgreSQL database. The entry point is still PostgreSQL for CloudSQL.
However, AlloyDB positions itself as a great next step. If you are processing vast amounts of data or your queries are becoming slower and slower even after hours spend on optimization. AlloyDB might be the better option. In the demo, they gave the example of running expensive geospatial queries with PostGIS, they might execute a lot faster on AlloyDB.
In the bigger cloud landscape, AlloyDB’s closest competitor is AWS Aurora. One thing to note here is that Aurora can run both in provisioned and serverless mode. AlloyDB has no serverless option. They do make it up by still being 2 times faster than AWS Aurora according to GCP’s Benchmarks