Relational databases

Natasha Ong
This is some text inside of a div block.
4 min read

In a nutshell:

Relational databases organise data into structured tables with relationships, making it efficient for querying, updating, and managing data.
AWS offers two relational database service options - Amazon Relational Database Storage (RDS) and Amazon Aurora
Amazon RDS supports multiple database engines (MySQL, PostgreSQL, SQL Server, Oracle, MariaDB)
Amazon Aurora is only MySQL and PostgreSQL-compatible, but offers exceptional performance and high availability through multi-Availability Zone replication.

Relational databases

Say you're a company's AWS expert wanting to store data about your customers in various systems. For every customer, you want to store their name, phone number, and home address. Just like that, there is a relationship - every customer you record will have a relationship of names, phone numbers and addresses stored in different parts of your system.  

You need a way to keep track of this relationship somewhere - is there any way you can create a place where clicking on a customer's name will also bring up their phone number and address?

In this case, it's best to use a relational database management system, (RDBMS). Essentially, It means we store data in a way such that it relates to other pieces of data. Our example is exactly this - we store our customer data in a way that it relates to the customer's name, phone number and address.

Psst... are you wondering whether non-relational databases exist? They sure do! We'll be learning about them in the next topic. For now, here's a little teaser: if relational databases are like neat spreadsheets with fixed categories, non-relational databases are more like a jumbled collection of notes and files that can vary in format.

Relational databases use structured query language (SQL) to store and query data.

  • This approach allows data to be stored in an easily understandable, consistent, and scalable way.
  • For example, the we can write a SQL query to identify all the customers whose first names start with the letter A.

SQL runs on a variety of database systems. If companies have an on-premises environment, they're probably running one of the most popular database systems - for example, MySQL or PostgresSQL - in their data centre.

But is there a way for companies move their data to the cloud and continue to run their relational databases on there?


  1. You can do what we call a Lift-and-Shift, and migrate your database to run on Amazon EC2. It's a quick entry to the cloud, and you can migrate them using an AWS service like Database Migration Service, which we'll cover later in the course.
  2. The other option is to use a more supported service called Amazon Relational Database Service, or RDS. It supports all the major database engines we mentioned previously, but this service comes with added benefits. These include automated patching, backups, redundancy, failover, disaster recovery*, all of which you normally have to manage for yourself. This makes it an extremely attractive option to AWS customers, as it allows you to focus on business problems and not maintaining databases.
*Woah! Lots of technical terms at once. You'll come across these words once in a while when you study cloud computing. Let's get to know them:
  • Patching: Keeping the database up to date for better performance and safety, like updating your phone.
  • Backups: Making spare copies of data in case of accidents.
  • Failover: The process of smoothly switching to your backup database when the main system fails, like using mobile data if Wi-Fi stops.
  • Redundancy: Having duplicate data copies of your data or systems, ensuring data is always there. Unlike backups, the redundant copies are always active - imagine if your car's spare tire is no longer sitting in the back, instead it's rolling alongside your main 4 tires!
  • Disaster recovery: Having plans and tools in place to rescue your data and systems in case a big disaster happens.

3. You can migrate or deploy databases to Amazon Aurora, which is made for larger enterprises.

Amazon Relational Database Service (RDS)

  • Amazon Relational Database Service (Amazon RDS) is a service that enables you to run relational databases in the AWS Cloud.
  • Amazon RDS is a managed service that automates tasks like managing the hardware, database setup, patching, and backups.
  • With these capabilities, you can spend less time completing time-consuming admin tasks and more time using data to improve your apps.
  • Many Amazon RDS database engines offer encryption at rest (protecting data while it is stored) and encryption in transit (protecting data while it is being sent and received).

Amazon RDS database engines

Amazon RDS is available on six database engines. Supported database engines include:

  • MySQL: Easy to use and well-suited for web applications.
  • PostgreSQL: Known for its advanced data features strong community support.
  • Amazon Aurora: High-performance database that's great for enterprise.
  • Oracle Database: A commercial database with advanced features and capabilities, also often used for enterprise applications.
  • MariaDB: Known for its speed and reliability.
  • Microsoft SQL Server: Well-suited for Windows-based applications.

Amazon Aurora

  • Amazon Aurora is an enterprise-class relational database.
  • It is compatible with MySQL and PostgreSQL relational databases. This means if your application was originally designed to work with a MySQL or PostgresSQL database, you can transition to using Amazon Aurora without major changes.
  • It is up to five times faster than standard MySQL databases and up to three times faster than standard PostgreSQL databases.
  • Consider Amazon Aurora if your workloads require high availability.
  • It replicates six copies of your data across three Availability Zones and continuously backs up your data to Amazon S3. Note that Availability Zones are physically separate AWS data centres in the same region. We'll dive into them in detail later in the course!
  • You can deploy up to 15 read replicas, which are essentially copies of your main database. These replicas handle read requests for your data, reducing the load on the primary database. This not only enhances your database's ability to scale but also boosts its overall performance – a double win!
  • You also get point in time recovery, which means winding back time to recover what your data looked like at a specific point in time.
  • AWS' most managed relational database option.
  • Priced at 1/10th the cost of on-premise databases. That's a pretty cost effective!