logical replication

Tech Optimizer
July 17, 2025
Amazon Web Services (AWS) has launched pgactive, an open-source extension for PostgreSQL that enables active-active replication, allowing databases to stream data asynchronously between instances. Announced in June 2025, pgactive was previously proprietary within AWS's Relational Database Service (RDS) and first appeared in late 2023. The extension supports conflict resolution and bidirectional data syncing, enhancing resiliency for high-availability applications. It is available under the Apache 2.0 license, encouraging community contributions and customization. Pgactive's architecture includes logical replication slots and customizable conflict handlers, essential for fault-tolerant systems. The open-source model promotes transparency and peer review, with potential integrations discussed in developer communities. The initiative aims to transform enterprise database replication and empower developers to innovate without vendor lock-in.
Tech Optimizer
June 21, 2025
The Amazon Aurora PostgreSQL-Compatible Edition supports managed blue/green deployments to minimize downtime and risks during updates. This deployment strategy involves creating a staging environment (green) that mirrors the production database (blue) through logical replication. The blue environment represents the current production database, while the green environment incorporates updates without changing the application endpoint. After validating changes, the green environment can be promoted to production. In case of issues post-upgrade, a rollback plan is essential, as the managed blue/green deployment feature does not provide built-in rollback functionality. A manual rollback cluster can be established using self-managed logical replication to maintain synchronization with the new version after a switchover. Before the switchover, two clusters exist: the blue cluster (production) and the green cluster (staging). After the switchover, three clusters are present: the old blue cluster (original production), the new blue cluster (updated production), and the blue prime (rollback) cluster (a clone of the old blue cluster). To implement the solution, prerequisites include a cluster parameter group for the new version database with logical replication enabled and familiarity with the Aurora cloning feature. The process involves creating a blue/green deployment, stopping traffic on the blue cluster, performing the switchover, deleting the blue/green deployment, cloning the old blue cluster to create the blue prime cluster, and establishing logical replication from the new blue cluster to the blue prime cluster. Limitations of the managed blue/green deployment include the inability to replicate certain DDL operations and the need to handle endpoint changes manually if a rollback is required. Setting up the rollback cluster incurs additional downtime. To roll back to the blue prime cluster, application traffic must be ceased, the application or DNS records updated, the subscription on the blue prime cluster dropped, and sequence values manually updated if necessary. This process is not automatic and requires careful planning and testing. In production, it is advisable to retain the new blue prime cluster until all applications have transitioned successfully, and the old blue cluster can be backed up for compliance before deletion. For testing purposes, all clusters should be deleted to avoid additional charges.
Tech Optimizer
May 21, 2025
Upgrading to Graviton4-based R8g instances with Aurora PostgreSQL-Compatible 17.4 in an Aurora I/O-Optimized cluster configuration results in significant performance improvements. The new instances provide up to 1.7 times higher write throughput, 1.38 times better price-performance, and reduce commit latency by up to 46% on r8g.16xlarge instances and 38% on r8g.2xlarge instances compared to Graviton2-based R6g instances. The Amazon Aurora PostgreSQL-Compatible Edition now supports AWS Graviton4-based R8g instances and PostgreSQL 17.4, which introduces performance enhancements for I/O-Optimized configurations, optimizing write operations and batch processing. R8g instances offer up to 192 vCPUs and 1.5 TB of memory, supporting larger configurations and providing up to 50 Gbps of network bandwidth. PostgreSQL 17 includes vacuum improvements, eliminates the need to drop logical replication slots during upgrades, and expands SQL/JSON standards. Aurora PostgreSQL-Compatible separates compute from storage, enabling independent scaling and maintaining six-way replication for durability, while processing changes as log records to reduce I/O operations. Performance benchmarks using HammerDB show improvements in throughput and commit latency across various workloads. For small workloads on 2xlarge instance size, throughput increased by 50.25% and commit latency improved by 33.87%. For medium workloads on 16xlarge instance size, throughput increased by 30% and commit latency improved by 17.44%. The most significant performance benefits arise from combining hardware upgrades from Graviton2 to Graviton4 with database engine upgrades from PostgreSQL 15.10 to 17.4. For small workloads, throughput increased by 70% and commit latency improved by 38.71%. For medium workloads, throughput increased by 70% and commit latency improved by 46.67%. Cost efficiency is also enhanced, with a 38% improvement in price performance and a 61.26% improvement in price-performance ratio when comparing Graviton2 and Graviton4 instances. Reserved Instances for Graviton4-based R8g instances offer additional cost-optimization opportunities.
Tech Optimizer
April 24, 2025
TencentDB for PostgreSQL has introduced robust security measures including data encryption, Virtual Private Cloud (VPC) isolation, and process monitoring for compliance with international standards. PostgreSQL 17.0 features enhanced logical replication with slot failover, performance optimizations such as batch I/O page read/write and improved Write-Ahead Logging, and operational enhancements like incremental backups and a transaction timeout parameter. Tencent has developed features for resource management, including fine-grained multi-tenant resource management with CPU resource isolation and process-level monitoring, as well as SQL throttling. Cold/hot data separation solutions include the 'cos_fdw' plugin for accessing cold data and the 'starocks_fdw' plugin for integrating with the StarRocks analytics engine. Security auditing has been improved with an Express Edition for basic needs and an Advanced Edition for broader audit coverage. These enhancements aim to balance performance and cost, maximize resource efficiency, and strengthen compliance.
Tech Optimizer
April 21, 2025
The AWS Database Migration Service (AWS DMS) provides a managed solution for migrating and replicating databases to AWS, supporting both homogeneous and heterogeneous migrations. It allows seamless data migration from PostgreSQL databases to any supported target and vice versa. Open-source PostgreSQL regularly releases new versions, and Amazon RDS aims to support these within five months. Upgrading PostgreSQL instances is essential for security and compliance. Minor version upgrades focus on security and bug fixes without adding new functionalities, while major upgrades can change system tables and data formats. AWS DMS tasks require careful management during PostgreSQL upgrades. For minor upgrades, ongoing DMS tasks should be stopped and then resumed post-upgrade. For major upgrades, replication slots must be dropped before the upgrade, which will invalidate ongoing DMS tasks. After the upgrade, a new CDC-only task should be created to resume data migration. Minor version upgrades of the target PostgreSQL database do not affect AWS DMS CDC tasks, but major upgrades require stopping the DMS task, performing the upgrade, and ensuring compatibility with the replication instance before resuming the task.
Tech Optimizer
March 18, 2025
pgactive enables rolling major version upgrades for Amazon RDS for PostgreSQL, allowing for a smoother transition with reduced impact on applications. Amazon RDS supports both minor and major version upgrades, with minor upgrades being backward-compatible and major upgrades introducing non-backward-compatible features. Downtime during minor upgrades can be minimized using Amazon RDS Proxy or PgBouncer. For major upgrades, a blue/green deployment option is available, which involves provisioning a new DB instance and validating the upgrade. The pgactive extension allows for active-active replication, enabling all nodes to handle read and write operations simultaneously. It includes features like conflict detection and resolution. Key benefits of using pgactive for database upgrades include multi-tenant support, minimal downtime, and seamless rollback capabilities. To perform a major version upgrade using pgactive, the process involves setting up source and target databases, configuring pgactive parameters, and verifying data replication. Specific commands are provided for creating and modifying databases, setting up user mappings, and initializing the replication group. Limitations of pgactive include handling sequences, materialized views, DDL replication, existing logical replication, and tables without primary keys. Monitoring replication lag is crucial for diagnosing potential issues, and alerts should be set up for active status and pending WAL files. In case of a rollback, the application can be pointed back to the old primary database. After the upgrade, resources should be cleaned up to avoid incurring charges.
Tech Optimizer
February 27, 2025
Standard support for Amazon Aurora PostgreSQL-Compatible Edition and Amazon RDS for PostgreSQL version 12 will end on February 28, 2025. The final update for PostgreSQL 12, version 12.22, was released on November 21, 2024. PostgreSQL follows an annual major version release cycle, supporting each version for five years post-release. Upgrading to newer major versions requires careful planning and testing to ensure application compatibility. New features in higher PostgreSQL versions include performance improvements, enhanced security, and new functionalities. Aurora PostgreSQL now supports AWS Graviton4 instances, which provide up to 40% performance improvement over Graviton3 instances. Recommended upgrades include moving to PostgreSQL 16 or newer, with options for in-place upgrades, blue/green deployments, and out-of-place upgrades. Amazon RDS Extended Support allows continued operation on a major version beyond the standard support end date, available at an additional cost. Extended Support for Aurora PostgreSQL 12.x and Amazon RDS for PostgreSQL 12.x will incur charges starting March 1, 2025, and will cease upon upgrading.
Tech Optimizer
February 21, 2025
September's CommitFest for version 18 has seen a wealth of accepted patches and new features, including: - Conflict detection and logging in logical replication - Removal of the constant 10000000000 in the planner to improve sequential scan cost assessment - Enhanced memory management and usage monitoring for temporary tuple storage - Asynchronous operations support in pg_upgrade for multiple databases - Speed improvements for Hash Joins - Faster text value processing in JSON - Optimized numeric-type multiplication and division - Introduction of ANALYZE ONLY and VACUUM ONLY commands - Improved checkpointer statistics - Normalization of SET commands in pg_stat_statements - Reporting of remote connection status in postgres_fdw_get_connections - Ignoring format conversion errors in file_fdw - New function has_largeobject_privilege - Functions crc32 and crc32c added - Client-server protocol updates to report search_path changes - Support for named prepared statements in psql - Integrity verification for tar backups in pg_verifybackup
Search