Module Objective: Add a database layer to a cloud architecture, choosing between relational and non-relational options, and secure and migrate that data appropriately.
Builds on Module 4: The database layer gives the compute layer somewhere durable to read and write structured application state.
Architectural Need for a Database
Once a compute layer runs application logic, that logic almost always needs to persist state beyond a single request — user accounts, orders, inventory — which is what a dedicated database layer provides, separate from the compute and storage layers already built.
Database Layer Considerations
Choosing a database is an architectural decision driven by data model, consistency requirements, query complexity, and expected scale — the same relational-vs-non-relational framing introduced in AWS Academy Cloud Foundations, now applied to real design trade-offs.
| Consideration | Question to Ask |
|---|---|
| Data model | Does the data have complex relationships needing joins, or simpler key-based access? |
| Consistency | Does every read need the absolute latest write, or is eventual consistency acceptable? |
| Scale | Will demand grow gradually, or does it need to handle unpredictable, massive spikes? |
| Operational overhead | How much of the database engine's management should AWS handle versus the team? |
Amazon RDS in an Architectural Context
For the café case study's relational needs, Amazon RDS provides the managed database layer — with Multi-AZ deployment protecting against failure and read replicas offloading read-heavy traffic, both of which connect directly to the high-availability patterns from Module 9 of this course.
Amazon DynamoDB in an Architectural Context
For workloads needing very low, consistent latency at large scale with simpler access patterns — such as storing session state or user preferences — DynamoDB fits where a relational engine would require more operational effort to scale to the same level.
Database Security Controls
A database layer needs security controls at multiple levels: network-level isolation, encryption, and access control — bringing together concepts from IAM, KMS, and VPC covered earlier.
| Control | What It Protects |
|---|---|
| Network isolation (private subnet, security groups) | Prevents direct internet access to the database |
| Encryption at rest (AWS KMS) | Protects stored data even if underlying storage is somehow accessed |
| Encryption in transit (SSL/TLS) | Protects data moving between the application and the database |
| IAM database authentication | Uses temporary IAM-based credentials instead of long-lived database passwords |
Migrating Data into AWS Databases
For an existing on-premises database, AWS Database Migration Service and the AWS Schema Conversion Tool provide the path into RDS or Aurora with minimal downtime, as covered in AWS Academy Cloud Foundations Module 8.
Key Terms for Module 5
- database layer
- The architectural tier responsible for durable, structured application state, separate from compute
- private subnet placement
- A security pattern that keeps a database reachable only from the compute layer, not the internet
- IAM database authentication
- Using temporary IAM-based credentials for database access instead of long-lived passwords
- homogeneous migration
- Migrating a database between instances of the same database engine
Review Questions
- Why is separating the database layer from the compute layer considered good architectural practice?
- What questions should drive the choice between a relational and non-relational database for a given workload?
- Why is a database instance typically placed in a private subnet rather than a public one?
- What is the difference between a homogeneous and a heterogeneous database migration?