Sub topic 2
Choosing a database engine
This chapter assumes you know basic SQL and relational concepts, have an AWS account with the AWS CLI configured, and understand VPCs at a basic level. By the end, you should be able to pick an RDS engine for a workload and avoid the common mistakes that come with that choice.
What an engine is
An engine is the database software that RDS runs for you. RDS supports these engines:
- Amazon Aurora (MySQL-compatible and PostgreSQL-compatible)
- MySQL
- PostgreSQL
- MariaDB
- Oracle Database
- Microsoft SQL Server
- Db2
You choose the engine when you create the instance, and it determines almost everything that follows. It sets the SQL dialect, the available extensions, the licensing model, the parameter names, and the upgrade path. You cannot switch an existing instance from one engine to another. Changing engines means migrating the data, for example with AWS Database Migration Service.
Open-source engines
PostgreSQL, MySQL, and MariaDB carry no license fee. You pay only for the instance, storage, and backups.
| Engine | Typical fit | Notes |
|---|---|---|
| PostgreSQL | New applications, complex queries, JSON data, extensions | Rich feature set. Extensions such as PostGIS are available. |
| MySQL | Web applications, existing MySQL codebases | Very widely used, with a large ecosystem. |
| MariaDB | Applications already built on MariaDB | A MySQL fork with some different features. |
If you have no existing constraint, PostgreSQL is a common default for new projects. The tutorial's examples use it for that reason.
Commercial engines
Oracle, SQL Server, and Db2 are commercial products. You usually choose one because an existing application requires it.
- License included: the license cost is part of the hourly instance price. This is simpler, but it costs more.
- Bring your own license (BYOL): you supply your own license where the engine and edition allow it. Check the current licensing rules for your edition before relying on this.
Commercial engines also tend to require larger instance classes and may offer fewer minor-version choices. Licensing can easily cost more than the compute.
Engine versions
Each engine has major versions and minor versions. Major versions change behavior and can break applications. Minor versions are mostly bug and security fixes. Every major version has an end-of-support date, after which AWS upgrades or charges extra for it. Pick a current major version unless your application needs an older one. Later chapters cover upgrades in more detail.
You can list the versions available in your Region:
aws rds describe-db-engine-versions \
--engine postgres \
--query "DBEngineVersions[].EngineVersion" \
--output textAurora in brief
Aurora is a separate AWS-built engine that speaks the MySQL or PostgreSQL protocol. It uses a different storage design from standard RDS. A later chapter compares it with standard RDS, so for now treat it as an option to revisit.
Decision flow
Common mistakes
- Choosing for a feature you never use. Picking a commercial engine "just in case" adds license cost and constraints.
- Ignoring compatibility. Application drivers, ORMs, and SQL syntax differ between engines. Test against the real engine, not a lookalike.
- Assuming you can switch later. Engine changes require a migration, so decide early.
- Using an unsupported or aging major version. This forces an upgrade on a schedule you did not choose.
Exercise
Your team has a new web application with no engine requirement. A colleague wants Oracle "because it is the most powerful." What are two reasons to prefer an open-source engine here, and what is one reason you could not change your mind later?
Show answer
Open-source engines (PostgreSQL, MySQL) have no license fee, and they avoid the larger instance sizes and licensing rules that commercial engines bring. You also get a broad ecosystem of drivers and extensions. You could not change your mind later because an existing instance cannot be converted to another engine. You would need to migrate the data, for example with AWS Database Migration Service.