Technology and services · 12 min
Amazon DynamoDB, Amazon ElastiCache and AWS DMS
In this lesson you will learn what types of databases AWS offers and what each one is used for, how Amazon DynamoDB and Amazon ElastiCache work, and which services are used to migrate a database to AWS.
A database is a program that stores organized information so it can be found quickly. Relational databases store it in tables that are connected to each other, such as a customers table and an orders table, but AWS also offers databases that store data in other ways, and each one is designed for a different type of data. For example, an online store's shopping cart stores a very simple piece of data, which says which products each customer has, but it has to read and write it very fast when there are millions of customers shopping at the same time.
That cart doesn't need related tables or queries with joins, so it is better solved with a database that is not relational. For example, the store doesn't need to cross the cart with other tables: it just looks up the customer's cart and adds or removes a product.
What types of databases are there on AWS?

The AWS services overview groups its databases by the type of data they store. These are the types that are on the exam:
- Relational databases, which store data in tables connected to each other, which on AWS are Amazon RDS and Amazon Aurora and are used for ERP, CRM and e-commerce. In this group the overview also includes Amazon Redshift, a data warehouse, that is, a store where large volumes of data are gathered to analyze them with SQL, the language used to ask a database questions. For example, the store keeps its customers, its products and its orders in Aurora.
- Key-value databases, which store each piece of data next to a unique name used to find it, which on AWS are Amazon DynamoDB and are used for high-traffic web applications, e-commerce and games. For example, the store saves the cart with the customer number as the key and the list of products as the value.
- In-memory databases, which keep the data in memory to respond as fast as possible, which on AWS are Amazon ElastiCache and are used for caches, sessions (the data about who is signed in at that moment) and game leaderboards, with microsecond latency, where a microsecond is a millionth of a second. For example, the store keeps there who has a session open so it doesn't have to ask the main database on every click.
- Document databases, which store each complete record in a single document with all its data, which on AWS are Amazon DocumentDB, compatible with MongoDB, and are used for catalogs and profiles in JSON format. For example, the store saves each product in its catalog as a document with its name, its sizes, its colors and its photos.
- Graph databases, which store the data and the connections between them, which on AWS are Amazon Neptune and are used for highly connected data, such as social networks, recommendation engines or fraud detection. For example, the store uses a graph to recommend products bought by other people who bought the same thing you did.
Match each database with its use
0 of 6 pairsTap a database and then its use.
0 of 6 pairs.
Amazon DynamoDB
AWS defines DynamoDB as a serverless, fully managed NoSQL database with single-digit millisecond performance at any scale. NoSQL means that the database doesn't store data in related tables, and in the case of DynamoDB it stores it as key-value pairs and as documents. Single-digit milliseconds means that each read or write takes less than a hundredth of a second, whether the store has ten customers or ten million. For example, the store's cart responds just as fast on a quiet Tuesday as on the biggest sales day of the year.
Because DynamoDB is serverless, you don't choose the computers the database runs on or install patches on them, which are the updates that fix bugs in a program, since all you need to do is create a table and start writing. The example its documentation uses is precisely the shopping cart. For example, the store's team creates the carts table and its application starts saving products that same day, without setting up any machine.
Global tables
For applications with users on several continents, DynamoDB offers global tables. With a global table, the same table exists in several Regions and all those copies accept writes, so each user writes to the copy closest to them. For example, if the store sells in Mexico and in Spain, a customer in Madrid saves their cart in a Region in Europe and one in Monterrey in a Region in the Americas, and the two copies stay the same.
True or false?
0 of 3In DynamoDB you choose the servers and patch them.
With global tables, the table exists in several Regions and all of them accept writes.
DynamoDB is the option for queries with joins between related tables.
Amazon ElastiCache
An application takes longer to read data from a database on disk than to read it from memory. That is why there is Amazon ElastiCache, which keeps in memory the data the application reads often so it doesn't have to go to the database every time. That place where frequently requested data is kept close at hand is called a cache. For example, the store keeps in ElastiCache the list of its ten best-selling products, which appears on the home page and which thousands of customers see every minute.

With ElastiCache, the application asks the cache first. If the data is there, the cache answers without touching the database, and if it isn't, the application reads it from the database and leaves it in the cache for the next time. For example, the first customer who opens the red shoe's page makes the application read its data from the database, and the customers after that get it straight from the cache.
ElastiCache works with three engines, which are Valkey, Memcached and Redis OSS. Also, you can use it in serverless mode, where AWS adjusts the capacity for you, or as a cluster of nodes that you choose, that is, a group of machines where you decide how many and what size. For example, a store that doesn't know how much traffic it will get chooses serverless mode so it doesn't have to work out how many machines it needs.
How do you migrate a database to AWS?

Migrating a database means moving it from one place to another, for example from a company's own machines to AWS. A company that has its database in its own data center usually can't shut it down for a whole weekend to copy it to AWS, because its customers would no longer be able to use it. To avoid that there is AWS DMS (Database Migration Service), which copies the data from the source database to the target database and can keep replicating the changes, that is, also copying what gets written while the original database is still in use. When everything is copied you do the final cutover, so the downtime is short.
For example, the store uses DMS to copy its orders database to AWS while it keeps selling. The orders that come in during the copy also move to AWS and, one early morning, the store points its application to the new database in a few minutes.
When the engine changes
If besides moving the database you change engines, for example from Microsoft SQL Server to Aurora PostgreSQL, you first have to convert the schema, which is the shape of the database: its tables, its views (saved queries with a name) and its procedures (instructions stored inside the database). Each engine writes those pieces in its own way, so they have to be translated. That conversion is done by two tools:
- AWS SCT (Schema Conversion Tool), which you download to your computer.
- DMS Schema Conversion, which is used inside the AWS console, the website where you manage your services.
In short, when the engine is the same you only use DMS to copy the data. When the engine changes, you use SCT or DMS Schema Conversion for the schema and then DMS for the data. For example, if the store moves from MySQL in its data center to MySQL on Amazon RDS, DMS is enough; if it moves from SQL Server to Aurora PostgreSQL, it first converts the schema and then copies the data with DMS.
What do you use to migrate?
A company wants to move its Microsoft SQL Server database, which is in its data center, to Aurora PostgreSQL with the least downtime. What does it use?
How do you recognize each service on the exam?
In database questions, look in the question for the type of data and the problem to solve. These are the phrases that point to each service:
- "NoSQL", "key-value", "serverless" and "milliseconds at any scale", which point to DynamoDB, as long as the question doesn't talk about relational data or joins.
- "Reduce the read load on the database" or "microsecond latency", which point to ElastiCache.
- "Compatible with MongoDB", which points to DocumentDB.
- "Relationships between data", "social networks" or "graphs", which point to Neptune.
- "Migrate with the least downtime", which points to DMS, together with SCT if the engine changes.
For example, if a question says that a database gets too many reads of the same products and the page slows down, the phrase points to ElastiCache.
cloud path tip: if you use an account with the new AWS experience, DynamoDB and ElastiCache are included in the free plan, DocumentDB and Neptune are only available with the paid plan, and DMS is not available until you turn on the advanced features.
Review question
A video game stores each player's progress with their ID. At night it has peaks of millions of players, and the team doesn't want to manage database servers. Which service does it use?
Next
- Database, the AWS whitepapers page that summarizes its database services.
- Practice with cloud path's practice exams.