0% found this document useful (0 votes)
8 views11 pages

Module Databases

The AWS shared responsibility model categorizes services into fully managed, managed, and unmanaged, focusing on database services like Amazon RDS and DynamoDB. Amazon RDS offers managed relational databases with automated tasks, while DynamoDB provides a fully managed NoSQL solution with flexible schemas. The document also covers in-memory caching with Amazon ElastiCache, document databases with Amazon DocumentDB, and data protection through AWS Backup.

Uploaded by

rafaelstevanato
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views11 pages

Module Databases

The AWS shared responsibility model categorizes services into fully managed, managed, and unmanaged, focusing on database services like Amazon RDS and DynamoDB. Amazon RDS offers managed relational databases with automated tasks, while DynamoDB provides a fully managed NoSQL solution with flexible schemas. The document also covers in-memory caching with Amazon ElastiCache, document databases with Amazon DocumentDB, and data protection through AWS Backup.

Uploaded by

rafaelstevanato
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

AWS shared responsibility model

The AWS shared responsibility model groups services into three


categories based on the ownership of administrative tasks. These
categories are fully managed, managed, and unmanaged. The AWS
services that you will be exploring in this module are primarily fully
managed, with a few managed services, and no unmanaged services.

To learn more about how these categories relate to database


services, expand the following three categories.

Relational databases

Relational databases store data in a way that relates it to other


pieces of data, and they use structured query language, or SQL, to
manage and query data. This approach stores data in an easily
understandable, consistent, and scalable way that works great for
applications requiring structured data management.

AWS offers fully managed relational database solutions that remove


the burden of database administration while maintaining high availability
and security. AWS relational databases support popular database engines
like MySQL, PostgreSQL, and Oracle, making it easier to migrate existing
databases to AWS.

An example of a relational database would be an inventory


management system for a restaurant. Each record in the database
includes data for a single item, such as product name, size, price, and so
on. The following table shows how this type of data is configured in a
relational database.

ID

Product Name

Size

Price

Medium roast ground coffee

12 oz.

$13.95

Single-origin whole bean coffee


12 oz.

$21.95

Amazon Relational Database Service (Amazon RDS)

Amazon RDS is a managed relational database service that handles


routine database tasks such as backups, patching, and hardware
provisioning. Amazon RDS supports multiple database instance class types
that optimize for memory, performance, or input/output (I/O).

To improve data resilience, Amazon RDS offers Multi-AZ deployment


and automated backups, but you can also manually create backups using
DB snapshots. These are full backups of your entire database instance,
which can be useful for specific point-in-time recovery or long-term data
archiving purposes. Amazon RDS offers security features including network
isolation, encryption in transit, and encryption at rest. You can readily
scale database resources vertically or horizontally as needed.

Supported database engines


Amazon RDS supports different database engines, including Amazon
Aurora, MySQL, PostgreSQL, Microsoft SQL Server, MariaDB, and Oracle
Database.

Use cases
Some examples of practical use cases for Amazon RDS are web
applications, enterprise workloads, and product inventories for e-
commerce platforms.

Benefits

Cost optimization

Multi-AZ deployment

Performance optimization

Security controls

Amazon Aurora

Aurora is a managed relational database designed to help reduce


unnecessary I/O operations. It's compatible with MySQL and PostgreSQL,
provides high performance and availability, and automatically scales
alongside your workloads. Aurora replicates data across multiple
Availability Zones for enhanced durability and fault tolerance, and features
automated backups, encryption at rest, and continuous monitoring.
Use cases
Some examples of practical use cases for Aurora are gaming
applications, media and content management, and real-time analytics.

Benefits

High performance and availability

Automated storage and backup management

Advanced replication and fault tolerance

NoSQL databases

NoSQL databases are sometimes referred to as non-relational


databases because their structures are different than relational databases
like Amazon RDS. Instead of row and column relationships, NoSQL
databases build a structure for the data that they contain using key-value
pairs instead. With key-value pairs, data is organized into items identified
by unique keys.

Each key has one or more associated attributes, or values, that


represent various characteristics of the data. You can think of a key as a
word entry in a dictionary, and the value as its associated definition. Not
every item in the table has to have the same attributes, and you can add
or remove attributes at any time.

The following table shows an example of how key-value paired data


is stored in NoSQL databases.

Key

Value

Name: John Doe


Address: 123 Any Street
Favorite drink: Medium latte

Name: Mary Major


Address: 100 Main Street
Birthday: July 5, 1994

Amazon DynamoDB

DynamoDB is a fully managed NoSQL database service that provides


fast and predictable performance for both document and key-value data
structures. It's a powerful and incredibly fast database option for use cases
that require a flexible schema, and is ideal for applications that require
high performance and seamless scaling.

DynamoDB seamlessly scales alongside your data without impacting


performance, which means that you only pay for the resources that you
use. It also includes built-in security features for enhanced protection, and
automatically spreads your data across multiple servers to handle your
workload.

Use cases
Some examples of practical use cases for DynamoDB are gaming
platforms, financial service applications, and mobile applications with
global user bases.

Benefits

Scalability with provisioned capacity

Consistent high performance

High availability and durability

Data encryption

n this demo you'll explore a hands-on example of configuring two


major database services: Amazon RDS and Amazon Dynamo DB.

Here we are in the AWS management console and to get started go


to the search bar and enter RDS, and then select the service when it
appears in the results. From there you'll find yourself in the Amazon RDS
dashboard. Now you can choose Create database to get started. To
configure this database we will choose MySQL for the engine options. Then
scrolling down, we will select the free tier template since we're just trying
things out.

Then scrolling down some more we will provide a database instance


identifier.

You can enter in a meaningful name for this one but for this
demonstration we will leave it as database-1. To access the database after
it's created you need to configure authorization under the credential
settings. For the username we will leave it to be admin and then for the
password I will enter in a password.

Scrolling down some more we need to find the connectivity section,


and from here you can select what sort of network you want to place this
in. We'll leave the default VPC selected, but we do need to enable public
access. So under public access I will choose yes.
This will allow us to easily connect to this database later in the
demonstration using a SQL client. But in the real world, you likely would
have this locked down so only authorized applications can connect.

Now we have all of our configurations in place, we will scroll to the


bottom accepting the rest of the defaults, and then we will choose Create
database. You're then redirected to the databases page to wait for the RDS
instance to finish creating. It's ready to use

when you see the status change from creating to available.

Now let's look at how to perform some basic commands in the RDS
MySQL instance we just created. There are many different ways to connect
to your RDS instance including a variety of clients. Setting up clients for
connecting to the database is out of scope, but to set up the connection to
the instance you would use the endpoint and port values shown on the
connectivity and security tab of the database-1 instance details page.

Then to authenticate use the username and password that you


defined when setting up the RDS instance. So using that information, we
are connected to the instance and we can now run the following SQL
statements to create a database and 3 tables in the RDS instance.

We are creating the database first and then in that database we are
creating 3 tables users products and orders. These tables relate to each
other through foreign keys, so if we run this these tables have now been
created.

Now let's run some insert statements to insert data into those
tables. Running these statements will populate 3 tables with some data.
One thing to note is that every entry in one table has to have the same
columns, so the schema here is rigid.

Let's go ahead and run this, and now that we have some data in our
tables, we can run this next statement to retrieve data from across the
tables we just created. Running this statement returns all orders a user
placed joining together the data across the different tables into one result
set. Not too bad, right?

Now that you know how to create and interact with a table in a basic
RDS instance, let's shift focus to another AWS database service Dynamo
DB. Unlike Amazon RDS, DynamoDB is a NoSQL database that doesn't
require managing instances or multiple tables within a single database.
Instead, it has its own query language and uses stand-alone tables. There
is no concept like a foreign key to relate tables to each other. You don't use
SQL to query the data and it has a flexible schema. Let's explore this.

Starting here in the AWS management console, enter DynamoDB


into the search and then select the service when it appears in the results.
After you're in the DynamoDB dashboard, choose Create table. In the table
details section enter the table name orders and then for the partition key
we will choose number from the dropdown and we will give the partition
key a name - order number. Then, for this demonstration, we will keep the
rest of the defaults scroll down to the bottom and choose Create table.

This is all you need to create a table - just the table name and the
partition key. Every item in this table has to have a value for the partition
key, but otherwise the schema for each item can vary. It's ready to use
once you see the status change from creating to active.

Now let's add some items to the Dynamo DB table we just created.
To do that, I have a Python script created that will load 10 items into this
database. This is the code for this task, and don't worry too much about
how this works. Instead, just understand that in order for applications to
interact with DynamoDB, they invoke the DynamoDB APIs using the AWS
SDK. Let's give this a run using the terminal.

OK, now that the script is done running we should have 10 items in
the table. Let's go check. So here we are back in the AWS management
console. Let's select the table that we created and then we will run a scan
on the table to see if those items loaded.

A scan will bring back all of the data in the table essentially
performing a read all type of query. To do that choose Explore table items
and then with the scan selected, choose Run. This will display the results
from a scan that returns all of the items with the table entries listed down
here under items returned You can scroll over to see all of the information
that was entered by that Python script.

Notice how the notes attribute is not present for every item in the
table. This is an example of showing how Dynamo DB allows for a flexible
schema. Not every item in the table needs to have the same attributes.

Now, what if your table starts getting larger and you want to bring
back only data for one specific order? For this demo, we will run a query to
do this. So selecting query and then providing the order number, which in
this case we can say we want to pull back order number 5. We can then
choose run and see that only one item is returned, which is order number
5.

All right there is of course always more to learn but that wraps things
up for this demonstration of AWS database services.

In-memory caches

An in-memory cache is a high-speed storage layer that temporarily


stores frequently accessed data in a computer's main memory, or RAM.
Retrieving data from RAM provides extremely fast processing and retrieval
speeds, often hundreds or thousands of times faster than traditional disk-
based storage systems.

When applications need specific information, they first check the


cache before requesting it from the original data source. This reduces the
load on primary databases and speeds up response times for end users.
In-memory caches are ideal for storing session data, API responses,
database query results, and other information that applications require
repeatedly.

Amazon ElastiCache

ElastiCache is a fully managed in-memory caching service that was


built to help reduce the complexity of administering in-memory caching
systems. This means that you can continue to use the same Redis, Valkey,
or Memcached tools and configurations to scale your workloads. It
automatically detects and replaces failed nodes, which makes it ideal for
applications that need consistent high performance.

Use cases
Some examples of practical use cases for ElastiCache are session
data management, database query enhancement, and gaming
leaderboards.

Benefits

High performance for Redis, Valkey, or Memcached instances

High availability

Replication across multiple Availability Zones

Data encryption

Amazon DocumentDB

Amazon DocumentDB (with MongoDB compatibility) is fully managed


service designed to handle semistructured data, which is information that
doesn't conform to rigid relational schemas. Amazon DocumentDB is a
MongoDB-compatible database, so it manages JSON-like documents with
dynamic schemas.

Amazon DocumentDB is perfect for applications requiring frequent


schema changes and document-oriented data. Unlike relational databases
or nonrelational databases, you can quickly iterate without relying on
predefined schemas. Amazon DocumentDB can store, query, and index
JSON data effortlessly, all while benefiting from automatic scaling,
continuous backup, and enterprise-grade security features.
Use cases
Some examples of practical use cases for Amazon DocumentDB are
content management systems, catalog and inventory management, and
user profile and personalization systems.

Benefits

MongoDB compatibility

Performance and scalability

Increased read throughput

AWS Backup

AWS Backup streamlines data protection across various AWS


resources and on-premises deployments by providing a single dashboard
for monitoring and managing backups. It eliminates the complexity of
managing multiple backup strategies by supporting multiple storage
types, including Amazon Elastic Block Store (Amazon EBS) volumes,
Amazon Elastic File System (Amazon EFS) file systems, and various
databases.

AWS Backup centralizes and automates data protection processes,


improving consistency and reducing administrative overhead. It offers
flexible scheduling options, encryption capabilities, and cross-Region
backup support for enhanced disaster recovery.

Use cases
Some examples of practical use cases for AWS Backup are
centralized disaster recovery, consistent backup policies for compliance
requirements, and consolidating multiple backup processes through a
single interface.

Benefits

Centralized backup management

Cross-region backup redundancy

Streamlined regulatory compliance

Amazon Neptune

Neptune is a fully managed, purpose-built graph database service


that manages highly connected data sets, like those used in social
networking applications. It excels at understanding complex relationships
that are difficult to identify in traditional relational databases like user
connections, friend networks, and interaction patterns. Neptune can
maintain high performance even as data complexity grows, and offers high
availability with automatic failover and backups.

Use cases
Some examples of practical use cases for Amazon Neptune are
social network user connection mapping, fraud detection systems, and
search and recommendation systems.

Recap and next steps

In this module, we explored the managed relational database


capabilities of Amazon RDS and Amazon Aurora. You learned how AWS
DMS facilitates seamless database migrations, and DynamoDB provides
insights into NoSQL database solutions for scalable applications.

We covered the in-memory caching capabilities of ElastiCache and


the MongoDB-compatible document database features of Amazon
DocumentDB. We examined the comprehensive data protection strategy
across AWS services offered by AWS Backup. And finally, we concluded
with the powerful graph database capabilities of Neptune for complex
relationship queries.

Resources

To learn more about the material covered in this module, choose the
resource links contained in the following table.

Resource link

Description

Amazon Relational Database Service (Amazon RDS)(opens in a new


tab)

A relational database service supporting multiple engines like


MySQL, PostgreSQL, and Microsoft SQL Server with automated
maintenance and backups

Amazon RDS Security(opens in a new tab)

Detailed information about security configurations in Amazon RDS

Amazon Aurora(opens in a new tab)

A cloud-native database offering superior performance and


availability over traditional databases while maintaining MySQL and
PostgreSQL compatibility

AWS Database Migration Service (AWS DMS)(opens in a new tab)

A service that provides seamless database migration between


source and target databases while keeping the source database
operational

Amazon DynamoDB(opens in a new tab)

A NoSQL database service providing single-digit millisecond


performance at any scale with built-in security

Amazon ElastiCache(opens in a new tab)

An in-memory caching service that supports Redis, Valkey, or


Memcached to improve application performance through faster data
retrieval

Amazon DocumentDB(opens in a new tab)

A MongoDB-compatible document database service designed for


mission-critical workloads with automatic scaling

Amazon Backup(opens in a new tab)

A centralized service for automating and managing data backups


across AWS services and on-premises resources

Amazon Neptune(opens in a new tab)

A graph database service optimized for storing and querying highly


connected data relationships

What Is a Relational Database?(opens in a new tab)

A structured database using tables with predefined schemas,


supporting complex queries and transactions through SQL for consistent
data relationships

What Is a NoSQL Database?(opens in a new tab)

A nonrelational database offering flexible schemas and high


scalability for varied data types, optimized for specific data models and
patterns

What Is an In-Memory Caching Service?(opens in a new tab)

A high-speed data storage layer using RAM instead of disk storage,


delivering microsecond latency for frequently accessed data

AWS Shared Responsibility Model(opens in a new tab)

AWS is responsible for security of the cloud (infrastructure,


hardware, networking, facilities) while customers are responsible for
security in the cloud (data, configuration, access management).

You might also like