The AWS service RDS (Relational Database Service) offers the option of running database engines such as Oracle, MySQL, MS SQL and PostgreSQL on cloud infrastructure. However, Aurora is another engine that offers PostgreSQL compatibility in addition to MySQL.
If applications are to be operated with PostgreSQL in the cloud, the question often arises as to which variant should be selected - RDS PostgreSQL or Aurora for PostgreSQL. Both variants promise full compatibility with PostgreSQL, so it makes no difference to the application itself which of the two solutions is connected. However, the architecture of the two variants differs fundamentally, so that the question often arises in projects as to which solution is more suitable.
Similarities between RDS PostgreSQL and Aurora PostgreSQL
Both RDS PostgreSQL and Aurora are operated within the AWS RDS service and share the basic capabilities of this service. Both variants are "fully managed" - AWS takes care of the operation and maintenance of the infrastructure. They offer the option of MultiAZ, i.e. operation in several data centers in a region to ensure a high level of reliability. In addition, solutions for failover and recovery, scaling and automated backups are offered. Both solutions are capable of using so-called read replicas. Here, the database is operated in parallel on several servers and data changes are synchronized from the primary instance to the other instances. This mechanism makes it possible, for example, to separate write operations from complex data queries.
Differences between PostgreSQL and Aurora PostgreSQL
PostgreSQL was not developed with a focus on cloud technologies, but has proven itself over many years. PostgreSQL uses block storage to store the data. The data is divided into individual blocks, assigned addresses and stored. Hard disks and the AWS Elastic Block Storage (EBS), which is used as persistent storage in RDS PostgreSQL, work with this principle. If several replicas are used, PostgreSQL synchronizes the data via a streaming mechanism. This means that a certain amount of the computing power of the database instances is required for this synchronization. In addition, there are delays during synchronization, which can fluctuate depending on the CPU load (the so-called replication lag).

Aurora is a database solution developed by AWS and relies on the possibilities of the cloud. In contrast to PostgreSQL, a distributed storage solution is used. It is not the database that synchronizes the data, but the storage itself that performs this task. A network of SSDs is used here, which are combined to form a virtual memory. This guarantees that the same result is always delivered after a write operation during the subsequent read of the data (read-after-write consistency). Synchronization at database level is therefore not necessary and data changes are available to all instances at the same time.

The differences between the two storage solutions affect various aspects of database operation:
- Synchronization: As already described, data is synchronized via streams with PostgreSQL, but via the distributed memory with Aurora. In the case of Aurora, this has no impact on the performance of the database and data is kept at the same level on all instances.
- Crash Recovery: When operating a productive system, it is extremely important how quickly the system is available again after a failure. PostgreSQL creates so-called checkpoints at certain intervals (5 minutes by default) for this purpose. Changes between the checkpoints are saved in so-called transaction logs. In the event of a failure, the last checkpoint is restored and the changes from the transaction log are imported again. As these are input/output intensive operations, the performance of the database is reduced during this time.
With Aurora, crash recovery does not take place in the database itself but with the help of parallel threads in the storage solution. This has no impact on the performance of the database, meaning that it is usually fully available again more quickly. - storage technology: PostgreSQL uses Elastic Block Storage on SSDs. Scaling is automatically possible up to 64 TiB. Aurora also uses SSDs, but relies on distributed storage. Aurora can automatically scale up to 128 TiB.
- Backups: Backups are created at defined time windows. If a solution with only one database instance is used, the creation of the backup affects the performance of the database. With Aurora, the distributed storage itself is backed up incrementally. The data is stored for a defined retention period. The incremental backup allows the data to be restored to a specific time stamp.
- Instance sizes: PostgreSQL offers a selection of General Puropse and memory-optimized instances. The number of different instance sizes is higher than with Aurora.
- Costs: The costs for PostgreSQL are made up of the instance size and the EBS volume. There are no additional costs for Read Replicas.
The costs for Aurora are based on the instance size and the current use of the database. There are also additional costs for read replicas. The costs for Aurora are generally 20 percent higher than those of PostgreSQL for comparable workloads.
In addition to these differences, Aurora offers other features that PostgreSQL does not have in this form. These include the fast cloning of databases and Aurora Serverless, i.e. the automatic scaling of databases based on the needs of the application, so that costs can be saved in the event of unpredictable or infrequent access. With Aurora Global Database, a distributed database can be spanned across regions. Depending on the location of the query, latencies of less than 1 second can be achieved worldwide. PostgreSQL has higher delays here in the context of cross-region replication.
Aurora or PostgreSQL? Choosing the right engine
Aurora is the more modern engine and consistently relies on cloud technologies. Aurora is superior to the PostgreSQL engine in most categories. If costs are a priority or an instance size is required that is not offered with Aurora, Postgres should be chosen. If issues such as recovery time, incremental backups, etc. are not important, PostgreSQL is a possible solution. If more than 64TiB of memory is required, Aurora must be used.
Learn more about software development
Sources
Details about RDS Aurora: https://docs.aws.amazon.com/de_de/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html
Details about RDS PostgreSQL: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html



