Relational, NoSQL and in-memory databases, and moving them
What a managed database service takes over, why a Multi-AZ standby is not a second server you can read from, how to pick a database from the access pattern, and how a live one moves with a cutover of minutes.
Lesson 5 of 11 in objective 3. Cloud technology and services, part of AWS Certified Cloud Practitioner (CLF-C02).
What "managed" actually buys
Amazon RDS runs the same database engines people already use — MySQL, PostgreSQL, MariaDB, Oracle, SQL Server and the Amazon Aurora engines — which is why moving to it leaves an application's SQL untouched. What changes is who does the chores: AWS operates the host and the database software, so provisioning, minor-version patching, automated backups, recovery and failover stop being somebody's week. What stays yours is everything about your application: schema design, indexes, queries, and who is allowed to connect.
Running the same engine on an EC2 instance instead is a legitimate answer to a different question — an extension RDS does not support, a version it does not offer, or a need to touch the operating system — and the trade is explicit: you have moved the server into AWS and kept every one of the chores. A stem that lists backups, patching and failover rehearsals as the reason for moving has ruled that option out in its first sentence.
Staying up is not the same as keeping up
A Multi-AZ deployment keeps a synchronous copy of the database in a second Availability Zone and fails over to it automatically. Its purpose is availability, and the standby answers no queries — there is no separate endpoint for it, which is exactly what makes a failover invisible to the application. (Amazon RDS also offers a Multi-AZ DB CLUSTER variant whose standbys can serve reads; a question that means that says cluster, and the classic instance deployment is what "Multi-AZ" alone refers to.)
Read replicas are the feature that adds read capacity. They are asynchronous copies, each with its own endpoint, you can have several, and they can live in another Region. Reporting queries that are slowing down customer transactions belong on one. The manager's line in the question — we are already paying for a second copy, just point the reports at it — is the misconception being tested, and the answer is that the two features buy different things: Multi-AZ is for staying up, read replicas are for keeping up.
Pick the database from the access pattern
The pattern, not the size, decides. Lookups by key at any scale, with a flexible document shape and no joins, go to Amazon DynamoDB: single-digit millisecond responses, no instance class to choose in advance, and on-demand capacity that absorbs a launch nobody could forecast. Joins, transactions across tables and existing SQL go to Amazon RDS or Amazon Aurora. Large analytical scans go to Amazon Redshift, whose columnar storage is built for exactly the queries a key-value store is worst at. Graph relationships go to Amazon Neptune.
Two mistakes are worth naming because the exam builds options out of them. The first is choosing relational by habit and then fighting it at scale. The second is the opposite: proposing a migration to a different data model as the answer to a performance problem that has a built-in solution. A requirement that says the existing SQL must keep working rules out DynamoDB however attractive its scaling story sounds.
Replicas spread the work out; caches avoid doing it
When every visitor triggers the same expensive query and the underlying data changes a few times a day, adding a read replica moves that work onto a second machine and still runs it once per visitor. Amazon ElastiCache — managed Redis or Valkey, and Memcached — computes it once and serves the result from memory for the next few thousand requests, which removes the work rather than redistributing it. DynamoDB has its own in-memory accelerator, DAX, and Amazon MemoryDB for Redis is the durable in-memory option.
The cost of a cache is not money, it is staleness. You have to decide how out of date a reader may be and how the cache is invalidated when the data changes, which is why a cache is right for a result that is identical for nearly everyone and rarely changes, and wrong for something read once and never again. Hold the pair as: replicas spread the work out, caches avoid doing it.
Moving a live database without a long outage
AWS Database Migration Service performs a full load and then goes on replicating changes from the source, so the source stays in production the whole time and the outage is only the moment you switch which database the application writes to. That is what makes a "cutover window of a few minutes" achievable. The alternative a question offers — export a dump, copy it, import it — freezes the database for the whole of all three steps, which for a couple of terabytes is hours at best and cannot be shortened below the slowest one.
When the source and target engines DIFFER, as in an Oracle database becoming Aurora PostgreSQL, the schema, stored procedures and data types have to be translated as well, which is the AWS Schema Conversion Tool's job. A homogeneous move — Oracle to Oracle, MySQL to Aurora MySQL — needs DMS alone. That pairing is the whole question in most migration items.
Worth carrying in
- Amazon RDS
- Managed relational databases: MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora.
- Amazon Aurora
- AWS's MySQL- and PostgreSQL-compatible engines, built for the cloud.
- Multi-AZ
- A synchronous standby in another zone with automatic failover. Availability, not capacity.
- Read replica
- An asynchronous readable copy with its own endpoint. Capacity, not availability.
- Amazon DynamoDB
- Key-value and document store. Lookups by key at consistent low latency, no servers to size.
- Amazon Redshift
- The data warehouse. Columnar storage for analytical scans over data you have loaded.
- Amazon ElastiCache
- Managed in-memory cache — Redis or Valkey, and Memcached — for repeated reads of hot data.
- Amazon MemoryDB for Redis
- Durable in-memory database, rather than a cache in front of one.
- Amazon Neptune
- Graph database, for relationships between things.
- AWS DMS
- Full load plus continuing replication, so the cutover is minutes.
- AWS SCT
- Translates schema, procedures and types when the engines differ.
What the exam does with this
- Multi-AZ is availability and its standby serves nothing; read replicas are capacity and each has its own endpoint. "We are already paying for a second copy, just read from it" is the trap, stated in the stem.
- A replica repeats the expensive query on another machine; a cache stops it running at all. An identical result for nearly every visitor is the giveaway for a cache.
- Same engine at both ends means DMS alone. Different engines mean schema conversion as well, and that pairing is what a migration question is really checking.
- A requirement that the application's existing SQL keeps working eliminates DynamoDB, and a stated need for joins or cross-table transactions eliminates it twice.
- Objective
- 3. Cloud technology and services
- Share of the exam
- 34% (the whole objective)
- Questions in this lesson
- 5
- Signed for by a person
- 0
Partly checked. None of the 5 questions here has been read against the cited source by a person. 5 questions have been checked against their cited clause by an automated pass — which is not the same thing, and is not a signature.
Only questions a person has signed for are used in mock exams here. That is the whole difference between the two kinds of checking above.
Questions in this lesson
- A company runs PostgreSQL on a server in its office. The database administrator spends most of her week on backups, minor-version patching and failover rehearsals. The business wants those chores handled by AWS, and the application's existing SQL to keep working unchanged. What should they move to? machine-checked
- An Amazon RDS for MySQL database is deployed Multi-AZ. Heavy reporting queries from the analytics team are now slowing down customer transactions. A manager says: 'We are already paying for a second copy in another Availability Zone — just point the reports at that one.' What is the correct response? machine-checked
- A mobile game stores one profile document per player and looks it up by player id on every session. It needs single-digit millisecond responses, the player count may go from a hundred to two million in a week after a marketing push, and there are no joins or reporting queries. Which database fits? machine-checked
- A product page runs the same expensive aggregate query for every visitor. The underlying data changes a handful of times a day. The database is at 90% processor utilisation and pages take 800 ms to render. Which change removes most of that work? machine-checked
- A 2 TB Oracle database in a company data centre is being moved to Amazon Aurora PostgreSQL. The business will accept a cutover window of a few minutes and no more. Which approach meets that? machine-checked
Drill this lesson
A lesson is one sitting: the trainer draws a short run from these questions alone and spaces the ones you get wrong.
Practise Relational, NoSQL and in-memory databases, and moving them
The rest of objective 3
- Ways in: console, CLI, SDKs and infrastructure as code
- Regions, Availability Zones and edge locations
- EC2 and choosing an instance type
- Containers, serverless, auto scaling and load balancing
- Relational, NoSQL and in-memory databases, and moving them — you are here
- VPCs, subnets, traffic controls and private connectivity
- Object storage and the S3 storage classes
- Block, file and hybrid storage, lifecycle rules and backup
- Machine learning and analytics services
- Messaging, integration and business applications
- Developer tools, end-user computing, front end and IoT