Module:4
AWS Database Services
Managed Database Services
Difference
Amazon RDS
• Amazon Relational Database Service (Amazon RDS) is a web service that
makes it easier to set up, operate, and scale a relational database in the
AWS Cloud.
• It provides cost-efficient, resizable capacity for an industry-standard
relational database and manages common database administration tasks.
Which of the following best describes Amazon RDS?
a) A NoSQL database service
b) A fully managed relational database service
c) A virtual server for running custom databases
d) A file storage service
Answer: b) A fully managed relational database service
Which database engines are supported by Amazon RDS?
a) MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Amazon Aurora
b) DynamoDB, Neptune, DocumentDB, Timestream
c) Redshift, ElastiCache, QLDB, Keyspaces
d) None of the above
Answer: a) MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Amazon
Aurora
What is the main benefit of RDS Multi-AZ deployment?
a) Improves write performance
b) Provides automatic failover and high availability
c) Enables read scaling through replicas
d) Reduces storage costs
Answer: b) Provides automatic failover and high availability
Which feature of RDS is used to scale read-heavy workloads?
a) Multi-AZ
b) Read Replicas
c) Elastic Load Balancing
d) Auto Scaling Groups
Answer: b) Read Replicas
Can users directly log in to the underlying OS of an RDS instance?
a) Yes, with admin credentials
b) Yes, using SSH
c) No, AWS manages it
d) Only in developer mode
Answer: c) No, AWS manages it
• Which of the following does Amazon RDS manage automatically?
a) Patching of database software
b) Backups
c) Failover in Multi-AZ setups
d) All of the above
Answer: d) All of the above
What is the difference between Multi-AZ and Read Replica in RDS?
a) Multi-AZ is for failover, Read Replica is for read scalability
b) Both are used only for backup
c) Both are used for performance only
d) Neither provide availability
Answer: a) Multi-AZ is for failover, Read Replica is for read scalability
Does Amazon RDS support encryption?
a) Only at rest
b) Only in transit
c) Both at rest and in transit
d) No, encryption is not supported
Answer: c) Both at rest and in transit
Amazon Aurora
• Amazon Aurora (Aurora) is a fully managed relational database engine that's compatible
with MySQL and PostgreSQL.
• The code, tools, and applications you use today with your existing MySQL and PostgreSQL
databases can be used with Aurora. With some workloads, Aurora can deliver up to five
times the throughput of MySQL and up to three times the throughput of PostgreSQL
without requiring changes to most of your existing applications.
• Aurora includes a high-performance storage subsystem. Its MySQL- and PostgreSQL-
compatible database engines are customized to take advantage of that fast distributed
storage.
• The underlying storage grows automatically as needed. An Aurora cluster volume can grow
to a maximum size of 128 tebibytes (TiB).
• Aurora also automates and standardizes database clustering and replication, which are
typically among the most challenging aspects of database configuration and administration.
Features of Amazon Aurora
1. Availability and Durability: AWS Aurora has a feature of fault-tolerant and self-mending storage built for the
cloud. It offers an incredible accessibility of 99.99%. The storage in the cloud replicates the 6 copies of the
information across 3 Availability Zones. The AWS Aurora backs up the data continuously due to the safety
purpose and precaution from storage failure.
2. Performance and Scalability: AWS Aurora provides 5 times the throughput of ordinary MySQL. This performance
is comparable with enterprise databases, at 1/10th the cost. The user can scale database preparation up and
down for smaller to larger instance varieties as per the user needs.
3. Fully Managed: The Amazon Aurora is managed by Amazon Relational Database Service (RDS). The user no
longer needs to stress over database management tasks, for example, hardware provisioning, software fixing,
setup, configuration, or backups. Aurora consequently and consistently screens and backs up the database to
Amazon S3, empowering granular point-in-time recuperation.
4. Security: Amazon Aurora provides numerous degrees of security to the database to improve it among others. On
an encoded Amazon Aurora occurrence, data within the underlying storage is encrypted. The administration is
through AWS Key Management Service and encryption of information in transit using SSL. In addition, there are
the automatic reinforcements, snapshots, and replica within the same cluster.
5. Migration Support: MySQL and PostgreSQL compatibility make Amazon Aurora a convincing target for database
relocations to the cloud. If the users want to migrate from MySQL or PostgreSQL, can see migration
documentation for a list of tools and options. To move from commercial database engines, the user can use the
AWS Database Migration Service for a safe migration with minimal downtime.
6. Compatibility with MySql and PostgreSQL: The Amazon Aurora database engine is perfectly compatible with
existing MySQL and PostgreSQL open supply databases, and adds compatibility for new releases frequently. This
means that the user can relocate MySQL or PostgreSQL databases to Aurora using standard MySQL or
PostgreSQL import/export tools or previews. It also means the user using code, applications, drivers, and tools
with existing databases can also use it with Amazon Aurora with little or no modification.
7. Cost: Amazon Aurora is designed to be cost-effective. You only pay for what you use, and you can scale your
database up or down as needed. Additionally, Aurora provides cost-saving features such as automated storage
optimization and the ability to pause or stop your database when it’s not in use.
• Which of the following statements about Amazon Aurora is true?
a) Aurora is a NoSQL database
b) Aurora is a MySQL- and PostgreSQL-compatible relational database
c) Aurora does not support automatic backups
d) Aurora cannot scale storage automatically
Answer: b) Aurora is a MySQL- and PostgreSQL-compatible relational
database
AWS DynamoDB
DynamoDB
• Serverless
• No-SQL
• Fully managed
• Single digit millisecond performance
• No cold starts
• No version upgrades and no downtime maintenance
• Can build serverless event-driven applications
Use cases
• Scale gaming platforms
• Deliver seamless retail experiences
• Create media metadata stores
• Develop software applications
• Ideal for applications with known access patterns
• Cost-effective usage based payment model
Payment model
• On-demand: DynamoDB's on-demand model charges for each request made, and
the price depends on the type of request, operation, table class, and AWS region.
• Provisioned capacity: This model reserves a certain level of performance for your
database, which is paid for on an hourly basis.
• Reserved capacity: You can use reserved capacity to further reduce the cost of
provisioned throughput. For example, a one-year upfront commitment for 100
write capacity units costs $150.00, and a one-year upfront commitment for 100
read capacity units costs $30.00.
DynamoDB Streams
• DynamoDB Streams captures a time-ordered sequence of item-level modifications
in any DynamoDB table and stores this information in a log for up to 24 hours.
• A DynamoDB stream is an ordered flow of information about changes to items in a
DynamoDB table.
• A stream record contains information about a data modification to a single item in a
DynamoDB table
Stream Records
• To read and process a stream, your application must connect to a DynamoDB
Streams endpoint and issue API requests.
• A stream consists of stream records
• Each stream record is assigned a sequence number, reflecting the order in which
the record was published to the stream.
• Stream records are organized into groups, or shards
• The stream records within a shard are removed automatically after 24 hours.
• Shards are ephemeral
• Because shards have a lineage (parent and children), an application must always
process a parent shard before it processes a child shard.
• This helps ensure that the stream records are also processed in the correct order.
Benefits of DynamoDB stream
• Each stream record appears exactly once in the stream.
• For each item that is modified in a DynamoDB table, the stream records appear in
the same sequence as the actual modifications to the item.
• DynamoDB Streams writes stream records in near-real time so that you can build
applications that consume these streams and take action based on the contents.
DynamoDB API Actions
• ListStreams
• DescribeStream
• GetSharedIterator
• GetRecords
Data Retention Limit
• All data in DynamoDB Streams is subject to a 24-hour lifetime.
• You can retrieve and analyze the last 24 hours of activity for any given table. However,
data that is older than 24 hours is susceptible to trimming (removal) at any moment.
• If you disable a stream on a table, the data in the stream continues to be readable for
24 hours. After this time, the data expires and the stream records are automatically
deleted.
• There is no mechanism for manually deleting an existing stream. You must wait until
the retention limit expires (24 hours), and all the stream records will be deleted.
DynamoDB Table Hierarchy
Analytics use case with DynamoDB
• Data Sources → DynamoDB
• Real-time data is generated by various applications, devices, or sensors.
• This data is ingested directly into an Amazon DynamoDB table.
• DynamoDB → Lambda via DynamoDB Streams
• When new data is written to DynamoDB, DynamoDB Streams capture the
changes.
• These streams trigger an AWS Lambda function automatically to process the
incoming data.
• Lambda → DynamoDB (Aggregates)
• The Lambda function reads the current aggregates (summary, counts,
analytics, etc.) from another DynamoDB table (Aggregates table).
• It updates these aggregates with the new incoming data.
• This ensures real-time aggregation and computation without impacting the
original DynamoDB table.
• Lambda → S3 (Step 5)
• The Lambda function then writes the processed or aggregated results into
Amazon S3 as static files (e.g., JSON, CSV, or static web content).
• These files act as ready-to-serve data for front-end applications.
• S3 → Dashboards (Step 6)
• The dashboards or analytics tools fetch the static files from S3.
• This provides fast, low-latency visualizations without hitting the database
repeatedly.
Usecase 2: Fetching order info from
DynamoDB
DynamoDB Request Flow
• Which of the following is true about DynamoDB?
a) It requires users to manage servers
b) It cannot scale automatically
c) It only supports SQL queries
d) It is serverless and fully managed
Answer: d) It is serverless and fully managed
DynamoDB provides high availability by storing data in:
a) A single availability zone
b) Multiple availability zones
c) Only one data center per region
d) A backup S3 bucket
Answer: b) Multiple availability zones
DynamoDB Streams are mainly used for:
a) Backups
b) Replication to S3
c) Capturing table activity (change data capture)
d) Improving performance
Answer: c) Capturing table activity (change data capture)