Jump to Content
Databases

AlloyDB vs. self-managed PostgreSQL: a price-performance comparison

May 10, 2024
Sridhar Ranganathan

Product Manager, Google Cloud Databases

Sheshadri Ranganath

Engineering Director, Google Cloud Databases

Try Gemini 1.5 models

Google's most advanced multimodal models in Vertex AI

Try it

PostgreSQL is an advanced open-source, relational database management system that empowers businesses with robust, reliable, and scalable database solutions. It has a rich set of features including security, availability, and performance that ensure data integrity and business continuity. With its extensive extensibility and vibrant community support, PostgreSQL offers a flexible and cost-effective alternative to proprietary database systems, making it an ideal choice for organizations seeking a versatile database foundation for their critical applications.

AlloyDB for PostgreSQL, meanwhile, is Google Cloud’s fully managed, enterprise-grade database service that adds several enhancements to the standard PostgreSQL database engine while maintaining full compatibility: AlloyDB can handle the most demanding workloads with superior performance, high availability, and scalability, outperforming standard PostgreSQL. Further, AlloyDB leverages Google's differentiated infrastructure and machine learning for automated database management, intelligent resource optimization, and accelerated analytical queries, making it an attractive choice for organizations that need a powerful and streamlined PostgreSQL-compatible solution. So, which should you choose?

https://storage.googleapis.com/gweb-cloudblog-publish/images/1st-image-blog-2x-perf-andi.max-2200x2200.png

At Google Cloud Next 24, we showcased AlloyDB provides up to 2x better price-performance than self-managed PostgreSQL and up to 4x better transactional performance on the same-sized instance. This blog dives deeper into the data behind that comparison, and explores additional value AlloyDB delivers.

Comparing performance

With AlloyDB, we made several enhancements to PostgreSQL's kernel including transactional and query processing layers and added self-managing autopilot features such as automatic memory management and adaptive vacuum management. When coupled with its intelligent distributed storage system and automated storage tiering, AlloyDB performs far more efficiently than standard PostgreSQL. 

We carried out a performance comparison evaluation to contrast the cost-effectiveness of AlloyDB with self-managed PostgreSQL running on Google Compute Engine (GCE), both in terms of total cost of ownership (TCO), as well as cost per transaction. For our evaluation, we compared AlloyDB for PostgreSQL configured with HA on 8 vCPU / 64 GB Memory with self-managed PostgreSQL 15 running on two VMs configured for HA, each with 16 vCPU / 128GB Memory: 

Description

Configuration

Type of workload

TPCC-Like (Transactional)

AlloyDB Pricing (vCPU, memory, storage)

https://cloud.google.com/alloydb/pricing

Compute Engine Pricing 

https://cloud.google.com/compute/all-pricing#general_purpose

PostgreSQL 

PostgreSQL 15 https://www.postgresql.org/download/

# of clients

256 connections

Database runs

3,200 warehouse / 347 GB database size

Type of benchmark

TPCC-like with 30% data fit in the memory

The table and chart below shows the price/performance improvement:

 

AlloyDB High Memory

Self managed PostgreSQL

AlloyDB Improvement

8 vCPU / 64GB

16 vCPU / 128GB

   

Transactions per minute (TPM)

280,614

118,928

2x transactions

Cost per 1 million transactions

$0.1593

$0.3419

2x better price/perf

https://storage.googleapis.com/gweb-cloudblog-publish/images/2nd-image-Blog-2x-perf-chart.max-1500x1500.png

Despite being configured with only 50% of self-managed compute resources, AlloyDB exhibited better TPM. With databases configured with 30% of the data cached, both performance and price-performance are up to 2x compared to self-managed standard PostgreSQL workloads. AlloyDB’s CPU utilization was close to 90%, suggesting the AlloyDB kernel is much better utilizing the available resources.

By deploying AlloyDB using the same GCE SKU (16 vCPU/128GB), we observed a 4x increase in performance. AlloyDB is engineered to scale with a larger number of vCPUs, resulting in better price-performance with a higher vCPU count. Currently, AlloyDB supports up to 128 vCPUs, which equates to 864GB of memory.

Standard PostgreSQL deployed on Compute Engine encounters resource limitations such as IOPS constraints and CPU scaling issues, hindering its ability to handle large amounts of data. Also note that this analysis does not include the manual resources required to self-manage the database, any additional inter-zone networking-related charges which can add to overall costs. 

Additional cost savings

AlloyDB compute instances in a cluster leverage the same regional colossus storage. What this means is that, when you deploy HA and add replica nodes (up to 20 at the time of publishing this blog), they all use the same storage. For example, if you have a 5TB database, and you have a HA + 4 read replicas, in a self-managed environment, the storage cost will be 6x the capacity (one primary, one standby, and 4 read nodes). With AlloyDB, you will be paying for 1 x 5TB costs.

https://storage.googleapis.com/gweb-cloudblog-publish/images/3rd-image-storage.max-2200x2200.png

Also, you don’t have to pre-provision AlloyDB’s storage capacity and allocate more capacity for IOPS. With AlloyDB’s cloud-scale architecture, the storage usage is dynamic which expands and also shrinks based on the usage. You pay only for the capacity you use.

There are no additional costs for AlloyDB cross-zone data replication for HA and for replica. With up to 25x lower read replica lag, you can scale horizontally using the same storage and with near-real time data.

Besides, AlloyDB can be a single datastore for your transactional, analytical and vector database workloads. You don’t have to provision multiple databases for these purposes which reduces additional compute, storage, networking, and ETL deployment and management aspects.

https://storage.googleapis.com/gweb-cloudblog-publish/images/4th-image-single-data-store.max-2200x2200.png

Managing PostgreSQL databases on your chosen infrastructure can offer cost advantages but comes with several challenges and hidden costs. These include capacity planning for peak workload, ongoing maintenance of hardware resources, and manual management of essential database tasks like deployment, scaling, security, high availability, backups, and disaster recovery. This can put a strain on your team and lead to higher administrative overhead and costs.

AlloyDB provides a fully managed experience that addresses these requirements and helps you run your mission-critical applications with a 99.99% uptime SLA, including maintenance.

AlloyDB comes out ahead

AlloyDB surpasses self-managed databases by offering up to 2x price-performance improvement and more cost savings with shared regional storage. Additionally, AlloyDB significantly mitigates the challenges associated with self-managed databases through automation of routine administrative tasks, on-demand vertical (read/write) and horizontal (read-only) scalability, minimal maintenance downtime, and inclusion of columnar engine & AI capabilities. With these features and benefits, AlloyDB provides a better, faster, and cheaper alternative to self-managed PostgreSQL environments.

Next steps

Posted in