0% found this document useful (0 votes)
7 views

database

Amazon RDS (Relational Database Service) simplifies the setup and management of relational databases in the AWS cloud, supporting various database engines and automating tasks like backups and patching. Users can create RDS instances with options for storage, availability, and scaling, including Multi-AZ deployments for high availability and Read Replicas for improved scalability. Key features include automated backups, manual snapshots, and monitoring capabilities, along with specific configurations for different workloads.

Uploaded by

alt.gw-eommgz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

database

Amazon RDS (Relational Database Service) simplifies the setup and management of relational databases in the AWS cloud, supporting various database engines and automating tasks like backups and patching. Users can create RDS instances with options for storage, availability, and scaling, including Multi-AZ deployments for high availability and Read Replicas for improved scalability. Key features include automated backups, manual snapshots, and monitoring capabilities, along with specific configurations for different workloads.

Uploaded by

alt.gw-eommgz
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Amazon RDS: Creating an RDS Instance

1. Introduction to Amazon RDS:

• Amazon RDS (Relational Database Service) is a web service that facilitates the setup,
operation, and scaling of relational databases in the AWS cloud.

• RDS supports industry-standard relational database types and automates administrative


tasks like backups, patching, and recovery.

2. RDS Database Instance:

• An RDS database instance is an isolated database environment in the AWS cloud.

• It can contain multiple user-created databases and supports various database engines like
MySQL, MariaDB, PostgreSQL, Oracle, SQL Server, and Amazon Aurora.

• RDS instances can be managed via the AWS Console, CLI, or RDS API.

3. RDS Database Engines:

• Supported engines: MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server, and Aurora
(with MySQL and PostgreSQL compatibility).

• Each engine has parameters in a database parameter group controlling the behavior of
managed databases.

4. Storage Options:

• RDS storage types include Magnetic, General Purpose SSD, and Provisioned IOPS.

• Storage volumes are configured similarly to EC2, with dynamic scaling options available.

5. Backup and Recovery:

• Automated backups are configured during the backup window and save snapshots based on
the backup retention period.

• Backups include full storage volume snapshots of the database instance, with the first
snapshot being a full backup and subsequent ones being incremental.

• Manual snapshots can be created and shared, with automatic snapshots only copyable.

6. Creating an RDS Database Instance:

• Configuration Steps:

o Choose between standard or easy create options.

o Select the database engine (e.g., MySQL) and version.

o Configure the instance settings such as class (e.g., standard, memory-optimized,


burstable), storage type, and size.

o Set up storage autoscaling to dynamically scale based on application needs.


o Configure availability and durability, such as enabling multi-AZ deployment for
production environments.

o Define connectivity, including VPC, subnet, and security group settings.

o Configure additional options like database authentication, backups, encryption, and


monitoring.

o Review and create the instance.

7. Post-Creation Monitoring:

• After creation, monitor the database instance for CPU utilization, storage usage, and free
memory.

• Check the configuration and ensure security group rules allow necessary access.

8. Key Points for Exams:

• Understanding of RDS components: instances, database engines, storage options.

• Knowledge of backup strategies, recovery, and snapshot management.

• Familiarity with RDS instance types, storage autoscaling, multi-AZ deployments, and
database authentication methods.

• Remember important details like the default MySQL port (3306) and database security group
settings.

Which of the following database engines is NOT supported by Amazon RDS?

• A) MySQL

• B) Oracle

• C) MongoDB

• D) PostgreSQL

• Answer: C) MongoDB

What is the default port number for a MySQL database instance in Amazon RDS?

• A) 1521

• B) 1433

• C) 3306

• D) 5432

• Answer: C) 3306

Which storage type is recommended for workloads requiring high and consistent I/O
performance in Amazon RDS?
• A) Magnetic

• B) General Purpose SSD

• C) Provisioned IOPS SSD

• D) Standard SSD

• Answer: C) Provisioned IOPS SSD

In Amazon RDS, which feature allows you to automatically scale the storage of your database
instance when it reaches capacity?

• A) Multi-AZ Deployment

• B) Enhanced Monitoring

• C) Storage Auto Scaling

• D) Read Replicas

• Answer: C) Storage Auto Scaling

Which of the following is a benefit of using Amazon RDS Multi-AZ deployments?

• A) Automated backups are disabled

• B) Higher storage capacity

• C) Improved database performance

• D) Increased availability and data redundancy

• Answer: D) Increased availability and data redundancy

You have an RDS instance using the MySQL engine. Which type of snapshot can you share
with another AWS account?

• A) Automated snapshot

• B) Manual snapshot

• C) Incremental snapshot

• D) Full snapshot

• Answer: B) Manual snapshot

Which Amazon RDS feature allows you to define when your database instance should be
automatically backed up?

• A) Backup Retention Period

• B) Backup Window

• C) Storage Auto Scaling


• D) Multi-AZ Deployment

• Answer: B) Backup Window

What type of RDS instance class is best suited for memory-intensive workloads?

• A) T2 Burstable class

• B) Standard class

• C) Memory Optimized class

• D) Provisioned IOPS class

• Answer: C) Memory Optimized class

Which of the following methods is NOT a valid way to manage an Amazon RDS database
instance?

• A) AWS Management Console

• B) RDS Command Line Interface (CLI)

• C) RDS API

• D) AWS Lambda

• Answer: D) AWS Lambda

What happens when you enable Multi-AZ for an RDS instance?

• A) It automatically replicates the database to a different region.

• B) It creates a read-only replica in a different availability zone.

• C) It automatically provisions a standby instance in a different availability zone.

• D) It disables automated backups.

• Answer: C) It automatically provisions a standby instance in a different availability zone.

Exam Notes: RDS - Multi-AZ Deployment

• Purpose: Multi-AZ deployment is designed to provide high availability (HA) for your
application by creating redundancy across different availability zones.

• Configuration:

o In a Multi-AZ deployment, a primary (master) database instance is created in one


availability zone (AZ).

o A secondary (standby) database instance is automatically set up in another AZ.

o The client application can only connect to the primary/master database via its
database endpoint.
• Synchronous Replication:

o Updates made to the master database are synchronously replicated to the standby
database.

o This ensures that both databases are always in sync, maintaining data consistency.

• Failover Process:

o In case the master database fails or the AZ goes down, the standby instance is
automatically promoted to become the new master.

o The database endpoint switches to the new master, allowing the client to reconnect
seamlessly.

• Key Points:

o Multi-AZ is a master-standby configuration.

o High availability is achieved by placing the primary and standby databases in


different AZs.

o Synchronous replication ensures data consistency between the primary and


standby databases.

o During failover, the standby database is promoted to the primary, minimizing


downtime.

o The database endpoint switches to the standby during failover to ensure the
application remains connected.

What is the primary purpose of using RDS Multi-AZ deployment?

• A) Data encryption

• B) Cost optimization

• C) High availability

• D) Performance improvement

In an RDS Multi-AZ deployment, which of the following is true about the standby instance?

• A) It can be accessed by the client applications directly.

• B) It is used for read and write operations.

• C) It is automatically promoted to the primary instance during a failure.

• D) It operates in the same availability zone as the primary instance.

How does the replication between the primary and standby instances occur in an RDS Multi-
AZ deployment?

• A) Asynchronous replication
• B) Synchronous replication

• C) Periodic backups

• D) Manual replication

What happens when the primary instance in a Multi-AZ deployment fails?

• A) The standby instance is promoted to the primary role.

• B) The database becomes unavailable until the issue is resolved.

• C) The client application needs to be manually redirected to a new instance.

• D) A new primary instance is automatically created in the same AZ.

Which of the following statements is true about the client connection in a Multi-AZ
deployment?

• A) The client connects to both primary and standby instances simultaneously.

• B) The client connects only to the primary instance via its endpoint.

• C) The client must switch endpoints manually during a failover.

• D) The client connection is automatically redirected to a read replica during a failover.

Which type of replication ensures that the standby instance is always in sync with the primary
in a Multi-AZ deployment?

• A) Asynchronous replication

• B) Synchronous replication

• C) Snapshot replication

• D) Log-based replication

When configuring an RDS instance for Multi-AZ, where is the standby instance located?

• A) In the same AZ as the primary instance

• B) In a different AZ from the primary instance

• C) In the same region as the primary instance but a different country

• D) On-premises

What is the impact on database availability during the promotion of a standby instance in a
Multi-AZ deployment?

• A) The database is unavailable until the promotion is complete.

• B) The database remains available with minimal disruption.

• C) The promotion takes several hours, causing significant downtime.


• D) The promotion process requires manual intervention.

Which feature of RDS Multi-AZ deployment helps maintain high availability during routine
maintenance?

• A) Automatic failover to the standby instance

• B) Asynchronous data replication

• C) Manual intervention for failover

• D) Increased instance size

Which of the following actions triggers a failover in an RDS Multi-AZ deployment?

• A) A manual backup operation

• B) Failure of the primary instance or AZ

• C) Read replica creation

• D) Database performance tuning

AWS RDS - Read Replicas

Overview

• Purpose: Read Replicas in RDS are used to achieve high scalability by creating read-only
copies of a database instance. These replicas are designed to serve high-volume application
read traffic, which increases the overall read throughput.

Key Points

1. High Availability vs. High Scalability:

o High availability in RDS is achieved through Multi-AZ deployment.

o High scalability is achieved using Read Replicas.

2. Scaling Options:

o Scale Up: Change the database instance type to a larger one (e.g., from db.m5.large
to db.m5.8xlarge).

o Scale Out: Use Read Replicas to distribute the read traffic across multiple instances.

3. Architecture:

o A primary/master RDS instance handles all read and write operations.

o Read Replicas are deployed in one or more Availability Zones (AZs) to handle read-
only operations and reduce the load on the primary instance.

4. Asynchronous Replication:
o Data from the master database is copied to Read Replicas using asynchronous
replication.

o This means Read Replicas may not always be in sync with the master database and
may experience some delays in receiving updates.

5. Usage Scenarios:

o Read-heavy Workloads: Direct excess read traffic to Read Replicas to scale beyond
the compute or I/O capacity of a single database instance.

o Source Database Unavailability: During backups, maintenance, or other events


when the source database is unavailable, read traffic can be directed to a Read
Replica. However, the data on the replica might be slightly outdated.

o Running Complex Queries: Use Read Replicas for business reporting or data
warehousing queries to offload the primary database instance.

6. Creation Process:

o An existing database instance is specified as the source.

o Amazon RDS takes a snapshot of the source instance and creates a read-only
instance from that snapshot.

o Asynchronous replication is used to update the Read Replica whenever the source
database instance changes.

7. Cross-Region Replication:

o Read Replicas support cross-region replication, allowing the creation of read-only


copies in different regions.

o This capability is advantageous for disaster recovery and for improving read
performance in different geographic locations.

8. Promotion to Standalone Instance:

o Read Replicas can be promoted to become standalone database instances when


needed.

o This is useful for scenarios like upgrading a database engine version or for disaster
recovery purposes.

9. Multi-AZ and Cross-Region Deployment:

o Supports Multi-AZ and cross-region deployments, enhancing disaster recovery


capabilities.

10. Statuses of Read Replicas:

o Replicating: The Read Replica is actively replicating data from the source instance.
o Error: An issue has occurred, and the replication is not functioning correctly.

o Terminated: The Read Replica has been deleted.

o Stopped: The Read Replica has been manually stopped.

o Replication Stop Point Set/Reached (MySQL only): Specific replication stop points
are set or reached.

11. 1. What is the primary purpose of using Read Replicas in Amazon RDS?
12. A) To achieve high availability by replicating data across multiple AZs
B) To offload write-heavy workloads to additional instances
C) To improve scalability by serving high-volume read traffic from read-only
copies
D) To store backups in a different region
13. 2. How does Amazon RDS replicate data from the master database instance to
Read Replicas?
14. A) Synchronously, ensuring data is always up to date
B) Asynchronously, allowing for potential delays in data propagation
C) Using Amazon S3 as an intermediary for data transfer
D) By creating manual snapshots and restoring them periodically
15. 3. Which of the following statements is true regarding Read Replicas?
16. A) Read Replicas can be promoted to standalone database instances.
B) Read Replicas support both read and write operations.
C) Read Replicas must always be in the same region as the source database.
D) Read Replicas automatically replicate specific databases from the source
instance.
17. 4. Which scenario would benefit the most from deploying Read Replicas?
18. A) Handling failover when the primary instance goes down
B) Distributing write-heavy workloads across multiple instances
C) Serving read traffic while the source database instance is under maintenance
D) Ensuring zero downtime during database upgrades
19. 5. What type of replication method is used by Amazon RDS to update Read
Replicas?
20. A) Synchronous replication
B) Full backup and restore replication
C) Asynchronous replication
D) Streaming replication
21. 6. What happens when you promote a Read Replica to a standalone database
instance?
22. A) The replica continues to receive updates from the source instance.
B) The replica stops replicating data from the source and becomes independent.
C) The replica gets deleted after promotion.
D) The replica automatically becomes the primary instance.
23. 7. Which of the following is a valid reason to create a Read Replica in a different
region?
24. A) To improve write performance across multiple regions
B) To lower costs by using cheaper instances in another region
C) To provide disaster recovery capabilities by having a copy in another region
D) To reduce latency for write operations in a different region
25. 8. What is a potential drawback of using Read Replicas in Amazon RDS?
26. A) Increased complexity in managing multiple write operations
B) Synchronous replication leading to performance degradation
C) Data on Read Replicas might be slightly stale due to asynchronous replication
D) Automatic promotion of Read Replicas in case of source instance failure
27. 9. Which RDS database engine does NOT support Read Replicas?
28. A) MySQL
B) PostgreSQL
C) MariaDB
D) Microsoft SQL Server
29. 10. How can you reduce the load on the master database instance when using
Read Replicas?
30. A) Direct all read and write operations to the master instance
B) Direct read-heavy queries to the Read Replicas
C) Scale up the master instance to handle more requests
D) Enable Multi-AZ deployment for the master instance

AWS RDS: Multi-AZ Deployment vs. Read Replicas

Multi-AZ Deployment

• Replication Type: Synchronous replication, ensuring high durability of data.

• Client Connections: Clients can only connect to the primary (active) instance. Secondary
(standby) instances are not accessible to clients.

• Backups: Automated backups are taken from the standby instance.

• Availability Zones: Always spans two availability zones within a single region.

• Database Engine Upgrades: Upgrades occur on the primary instance.

• Failover: Automatic failover to standby occurs when a problem is detected.

Read Replicas

• Replication Type: Asynchronous replication, providing scalability rather than high durability.

• Client Connections: Clients can connect to all read replicas.

• Backups: No automated backups are configured by default.

• Availability Zones: Can be within a single availability zone, multiple availability zones, or
across regions.

• Database Engine Upgrades: The upgrade process is independent from the source instance.
• Promotion: Read replicas can be manually promoted to a standalone database instance if
necessary.

What is the primary benefit of using a Multi-AZ RDS deployment?

• A) Improved scalability

• B) High data durability

• C) Lower latency

• D) Cost savings

In a Multi-AZ RDS deployment, where do automated backups occur?

• A) Primary instance

• B) Standby instance

• C) Both primary and standby instances

• D) Automated backups are not supported

Which of the following is true about client connections in a Multi-AZ RDS deployment?

• A) Clients can only connect to the primary instance

• B) Clients can connect to both primary and standby instances

• C) Clients can only connect to the standby instance

• D) Clients cannot connect to either instance

How is data replicated in Read Replicas?

• A) Synchronously

• B) Asynchronously

• C) Through manual snapshots

• D) Data is not replicated

Which of the following scenarios is best suited for using Read Replicas?

• A) Scaling out read-heavy database workloads

• B) Ensuring high availability and fault tolerance

• C) Reducing storage costs

• D) Automatically failing over to a standby instance

Can Read Replicas be promoted to a standalone database instance?

• A) No, they cannot be promoted


• B) Yes, they can be manually promoted

• C) Yes, they are automatically promoted

• D) Only in Multi-AZ deployments

Which type of RDS deployment allows for cross-region replication?

• A) Multi-AZ deployment

• B) Read Replicas

• C) Neither Multi-AZ nor Read Replicas

• D) Both Multi-AZ and Read Replicas

What happens during a database engine version upgrade in a Multi-AZ deployment?

• A) Both primary and standby instances are upgraded simultaneously

• B) The primary instance is upgraded first

• C) The standby instance is upgraded first

• D) Upgrades are not allowed in Multi-AZ deployments

Which deployment type automatically fails over to a standby instance when a problem is
detected?

• A) Multi-AZ deployment

• B) Read Replicas

• C) Cross-region replication

• D) Standalone instances

What is a key limitation of using Read Replicas for high availability?

• A) Read Replicas do not support cross-region replication

• B) Data replication is asynchronous, which may result in data lag

• C) Automated backups are not supported

• D) Read Replicas cannot be promoted to primary instances

Exam Notes on RTO and RPO:

• RPO (Recovery Point Objective):

o Definition: The maximum period of data loss that is acceptable in the event of a
failure or incident.

o Measurement: Usually measured in minutes.


o Example: An RPO of 5 minutes means that losing more than the last 5 minutes of data
(e.g., transaction logs) is unacceptable. Only data loss within the last 5 minutes is
acceptable.

• RTO (Recovery Time Objective):

o Definition: The maximum amount of downtime allowed to recover from a backup and
resume processing.

o Measurement: Typically measured in hours or even days.

o Example: If an SLA specifies an RTO of 1 hour, the system must recover within 1 hour
after a crash.

1. What does RPO (Recovery Point Objective) primarily measure?

• A) The time taken to restore a system after failure

• B) The maximum period of data loss that is acceptable

• C) The availability of a system during disaster recovery

• D) The amount of downtime tolerated during an outage

2. Which of the following best defines RTO (Recovery Time Objective)?

• A) The point in time to which data must be recovered

• B) The maximum time allowed to restore a system after a failure

• C) The percentage of system uptime over a year

• D) The maximum size of data that can be recovered

3. If a database has an RPO of 15 minutes, what does this imply?

• A) The system can tolerate 15 minutes of downtime.

• B) Up to 15 minutes of data loss is acceptable.

• C) The system must be recovered within 15 minutes.

• D) Data must be backed up every 15 minutes.

4. A company has an RTO of 2 hours for its database. What does this mean?

• A) Data loss must be limited to the last 2 hours.

• B) The backup process should run every 2 hours.

• C) The database must be operational within 2 hours of an outage.

• D) The database should be online for at least 2 hours a day.

5. What is the key difference between RPO and RTO?


• A) RTO measures data loss, while RPO measures recovery time.

• B) RPO is always longer than RTO.

• C) RPO focuses on data loss; RTO focuses on recovery time.

• D) RPO is related to system availability; RTO is related to backup frequency.

6. A company has set an RPO of 10 minutes and an RTO of 1 hour for its critical database. Which
of the following is true?

• A) Data must be backed up every 10 minutes.

• B) The company can tolerate losing 10 minutes of data and must restore the database
within 1 hour.

• C) The system must be back online within 10 minutes.

• D) Data recovery should not exceed 1 hour.

7. In the context of disaster recovery, what is the primary purpose of setting an RPO?

• A) To minimize the recovery time of a system.

• B) To ensure data integrity after recovery.

• C) To determine the acceptable amount of data loss.

• D) To define the uptime percentage of a system.

8. How does RTO affect the choice of backup and disaster recovery solutions?

• A) A shorter RTO may require faster recovery methods, such as active-passive failover.

• B) A longer RTO allows for more frequent backups.

• C) RTO does not influence backup strategies.

• D) RTO only impacts the scheduling of maintenance windows.

9. What might be a suitable RPO for a financial trading system?

• A) 0 minutes (no data loss is acceptable)

• B) 30 minutes

• C) 1 hour

• D) 24 hours

10. Which of the following scenarios would likely require a shorter RTO?

• A) A weekly report generation system.

• B) A non-critical internal file server.


• C) An e-commerce website handling thousands of transactions per hour.

• D) A backup archive storage system.

Key Differences Between SQL and NoSQL Databases

1. Database Type:

o SQL: Relational Database Management System (RDBMS).

o NoSQL: Non-relational or distributed databases.

2. Data Relationships:

o SQL: Relationships between data in tables are crucial.

o NoSQL: Relationships between data are not as important or mandatory.

3. Data Structure:

o SQL: Table-based databases, representing data in the form of rows and columns.

o NoSQL: Document-based, key-value pairs, graph databases, or wide-column stores.

4. Schema:

o SQL: Predefined schema, requiring structured data.

o NoSQL: Dynamic schema, accommodating unstructured data.

5. Scalability:

o SQL: Vertically scalable (increasing CPU, RAM, SSD, etc., on a single server).

o NoSQL: Horizontally scalable (adding more servers to handle large traffic).

6. Query Language:

o SQL: Uses SQL (Structured Query Language) for defining and manipulating data.

o NoSQL: Supports queries but focuses on the collection of documents.

7. Foreign Keys:

o SQL: Supports foreign keys to establish references between tables.

o NoSQL: No foreign key concept.

8. Complex Queries:

o SQL: Suitable for complex query-intensive environments.

o NoSQL: Not ideal for complex queries but better for hierarchical data storage (e.g.,
key-value pairs similar to JSON).

9. Transaction Management:
o SQL: Emphasizes ACID properties (Atomicity, Consistency, Isolation, Durability).

o NoSQL: Follows the Brewer's CAP theorem (Consistency, Availability, Partition


Tolerance).

10. Examples:

o SQL: MS-SQL, Oracle, MySQL.

o NoSQL: DynamoDB, MongoDB

Which type of database is characterized by table-based data storage?

• A) NoSQL

• B) SQL

• C) Document-based

• D) Key-value pairs

Which of the following is a feature of NoSQL databases?

• A) Predefined schema

• B) Dynamic schema

• C) Use of SQL for querying

• D) Vertical scalability

What is the primary advantage of NoSQL databases in terms of scalability?

• A) Vertical scalability

• B) Horizontal scalability

• C) Strong ACID compliance

• D) Support for foreign keys

Which database model is best suited for handling complex queries?

• A) Key-value pairs

• B) SQL

• C) Wide-column stores

• D) NoSQL

What does ACID stand for in the context of SQL databases?

• A) Availability, Consistency, Isolation, Durability

• B) Atomicity, Consistency, Isolation, Durability


• C) Atomicity, Consistency, Integrity, Durability

• D) Availability, Consistency, Integrity, Durability

Which of the following best describes the data structure of a NoSQL database?

• A) Document-based

• B) Table-based

• C) Structured data

• D) Relational data

Which of the following SQL features is not typically found in NoSQL databases?

• A) Dynamic schema

• B) Horizontal scalability

• C) Foreign keys

• D) Distributed storage

What does the CAP theorem, followed by NoSQL databases, represent?

• A) Consistency, Atomicity, Partition Tolerance

• B) Consistency, Availability, Partition Tolerance

• C) Consistency, Availability, Durability

• D) Consistency, Availability, Integrity

Which type of database is most appropriate for heavy-duty transactional applications?

• A) NoSQL

• B) SQL

• C) Key-value store

• D) Graph database

Which of the following is an example of a NoSQL database?

• A) DynamoDB

• B) MySQL

• C) Oracle

• D) MS-SQL

Amazon DynamoDB Overview - Exam Notes

Amazon DynamoDB Overview:


• Fully Managed NoSQL Database:

o Eliminates the need for manual database administration.

o Automatically handles data distribution and traffic across multiple servers.

o Provides control over throughput and storage requirements.

Data Structure:

• Data Format:

o Stores data in the format of items in JSON.

o Suitable for document handling.

• Core Components:

o Tables: Collection of items (similar to a collection in other NoSQL databases).

o Items: Individual records within a table (similar to rows).

o Attributes: Data elements within an item (similar to columns).

Examples:

• People Table:

o Stores personal contact information.

o Attributes may include person_id, first_name, last_name, etc.

• Cars Table:

o Stores information about vehicles.

o Attributes may include car_type, drive_type, etc.

Primary Keys in DynamoDB:

• Partition Key (Simple Primary Key):

o Composed of a single attribute.

• Composite Primary Key:

o Combination of partition key and sort key (two attributes).

o Example:

▪ People Table: person_id as the partition key.

▪ Music Table: artist as the partition key and song_title as the sort key.

Key Features of Amazon DynamoDB:

• On-Demand Capacity Mode:


o DynamoDB automatically scales up and down to meet traffic demands.

• ACID Transactions:

o Native server-side support for transactions.

o Ensures data integrity and safety.

• Backup and Recovery:

o Point-in-Time Recovery (PITR): Protects data from accidental read-write operations.

o DynamoDB allows complete backups at any time.

• Encryption:

o Data is encrypted at rest, even when the table is not in use, enhancing security.

Interaction with DynamoDB:

• API Requests:

o Unlike relational databases that use SQL, DynamoDB interacts through HTTP POST
API requests.

o Queries and actions are performed through these API requests, and responses are
received over HTTP.

What type of database is Amazon DynamoDB?

• A) Relational Database

• B) NoSQL Database

• C) Graph Database

• D) In-Memory Database

In Amazon DynamoDB, what is an item?

• A) A single attribute within a table

• B) A single record within a table

• C) A collection of attributes

• D) A collection of tables

Which key structure does DynamoDB support for uniquely identifying items in a table?

• A) Composite Key and Foreign Key

• B) Partition Key and Composite Primary Key

• C) Primary Key and Secondary Key


• D) Foreign Key and Sort Key

What is a primary benefit of DynamoDB's On-Demand Capacity mode?

• A) Reduced read latency

• B) Automatic scaling based on traffic

• C) Increased storage capacity

• D) Manual throughput configuration

In DynamoDB, what is the difference between a partition key and a composite primary key?

• A) A partition key is a single attribute; a composite primary key consists of a partition key
and a sort key.

• B) A partition key is a sort key; a composite primary key is a foreign key.

• C) A partition key is a simple primary key; a composite primary key uses indexes.

• D) A partition key is for indexing; a composite primary key is for storing data.

What type of data format does DynamoDB use to store items?

• A) XML

• B) CSV

• C) JSON

• D) Parquet

Which of the following DynamoDB features allows you to restore data to any point in time?

• A) DynamoDB Streams

• B) Point-in-Time Recovery (PITR)

• C) Global Tables

• D) DynamoDB Auto Scaling

What is a key advantage of DynamoDB being a fully managed service?

• A) Ability to run SQL queries directly on DynamoDB

• B) Eliminates the need for manual database administration

• C) Manual configuration of servers for data distribution

• D) Direct access to underlying servers for customization

How does DynamoDB handle ACID transactions?

• A) By using third-party transaction managers


• B) By providing native server-side support for transactions

• C) By allowing manual transaction management

• D) By leveraging Amazon RDS

Which of the following best describes how applications interact with DynamoDB?

• A) Applications interact using SQL over a persistent network connection.

• B) Applications interact using REST API over an FTP connection.

• C) Applications interact using SOAP API over an HTTP connection.

• D) Applications interact using HTTP POST API requests.

Global Secondary Index (GSI) vs. Local Secondary Index (LSI) in AWS DynamoDB

Global Secondary Index (GSI)

• Primary Key: Can be either simple or composite.

• Partition Key: Can be any attribute on the table.

• Creation: Can be created later or added to an existing table.

• Query Scope: Allows querying over the entire table.

• Consistency: Supports eventual consistency only.

Local Secondary Index (LSI)

• Primary Key: Must be composite, requiring both a partition key and a sort key.

• Partition Key: Must be the same as the table's partition key.

• Creation: Must be created at the time of table creation; cannot be added later.

• Query Scope: Allows querying over a single partition only.

• Consistency: Supports both eventual consistency and strong consistency.

1. Which of the following statements is true about Global Secondary Index (GSI) in DynamoDB?

• A) The primary key must be composite.

• B) The primary key can be either simple or composite.

• C) The primary key must be simple.

• D) The primary key must match the table's primary key.

2. When can a Global Secondary Index (GSI) be created on a DynamoDB table?

• A) Only during table creation

• B) At any time, even after the table has been created


• C) Only when the table has no data

• D) Only when the table has at least one Local Secondary Index (LSI)

3. Which of the following is required for a Local Secondary Index (LSI) in DynamoDB?

• A) The partition key must match the table's partition key

• B) The partition key must be unique and different from the table's partition key

• C) The partition key can be any attribute on the table

• D) The partition key is not required for LSI

4. What type of consistency does Global Secondary Index (GSI) in DynamoDB support?

• A) Strong consistency only

• B) Eventual consistency only

• C) Both eventual and strong consistency

• D) Immediate consistency only

5. What type of queries can be performed using a Local Secondary Index (LSI) in DynamoDB?

• A) Queries over a single partition only

• B) Queries over the entire table

• C) Queries across multiple partitions

• D) Queries across all attributes

6. Which of the following must be true to create a Local Secondary Index (LSI) in DynamoDB?

• A) It must be created at the same time as the table

• B) It can be created at any time after the table is created

• C) It must be created only after the table is populated with data

• D) It requires a unique primary key unrelated to the table's primary key

7. Which of the following is a difference between Global Secondary Index (GSI) and Local
Secondary Index (LSI)?

• A) GSI can only be created at table creation, while LSI can be added later.

• B) LSI supports only eventual consistency, while GSI supports strong consistency.

• C) GSI allows querying the entire table, while LSI allows querying within a single
partition.

• D) LSI can be created at any time, while GSI must be created at table creation.
8. What is the primary benefit of using a Global Secondary Index (GSI) in DynamoDB?

• A) It enforces strict consistency across partitions.

• B) It allows querying across all partitions with different primary keys.

• C) It reduces the cost of storage by partitioning data more efficiently.

• D) It ensures strong consistency for all queries.

9. Which of the following is a true statement about Local Secondary Index (LSI) in DynamoDB?

• A) The partition key can be any attribute in the table.

• B) The sort key can be any attribute, but the partition key must match the table's partition
key.

• C) The sort key must be the same as the table's sort key.

• D) The primary key can be either simple or composite.

10. Which type of DynamoDB index supports both eventual and strong consistency for read
operations?

• A) Local Secondary Index (LSI)

• B) Global Secondary Index (GSI)

• C) Both GSI and LSI

• D) Neither GSI nor LSI

4o

AWS DynamoDB: Read Consistency and Throughput Capacity

Write Operations and Durability

• When your application writes data to a DynamoDB table and receives an HTTP 200 (OK)
response, it confirms that the write operation has occurred and is durable.

Read Consistency Models

DynamoDB supports two types of read consistency:

1. Eventual Consistent Reads:

o After a write operation, reading data immediately may not always return the most up-
to-date data.

o The data will eventually become consistent, typically within a fraction of a second.

o By default, DynamoDB performs an eventually consistent read.

2. Strong Consistent Reads:


o When performing a strong consistent read, DynamoDB ensures that the response
reflects the most up-to-date data, including all successful prior write operations.

Throughput Capacity

• When creating a DynamoDB table or index, you must specify the read and write capacity
requirements to ensure consistent, low-latency performance.

• Provisioned Capacity Mode: Define your throughput capacity in advance to allocate


necessary resources for read/write activities.

• On-Demand Capacity Mode: Pay only for the read/write operations you perform, with no
need for prior capacity planning.

Capacity Units

1. Read Capacity Unit (RCU):

o 1 RCU = One strongly consistent read per second, or two eventually consistent reads
per second, for an item up to 4 KB in size.

2. Write Capacity Unit (WCU):

o 1 WCU = One write per second for an item up to 1 KB in size.

Example Scenarios

• Read Operations:

o With 1 RCU:

▪ Strong Consistency: Can read one item up to 4 KB.

▪ Eventual Consistency: Can read one item up to 8 KB or two items of 4 KB


each.

• Write Operations:

o With 1 WCU:

▪ Can write one item up to 1 KB (No strong/eventual consistency differentiation


for writes).

Calculating Required Capacity Units

• For Reads:

o If the item size is X KB:

▪ Eventual Consistency: Provision capacity = X8\frac{X}{8}8X or 1, whichever


is greater.

▪ Strong Consistency: Provision capacity = X4\frac{X}{4}4X or 1, whichever is


greater.
▪ If the result is a fraction, round up to the next whole number.

• For Writes:

o Required capacity = X amount of WCU, where X is the size of the item in KB.

Throttling and Costs

• If the read/write requests exceed the throughput settings, DynamoDB may throttle the
request to prevent overconsumption.

• Throttled requests fail with an HTTP 400 status code and a


"ProvisionedThroughputExceededException."

• Capacity units impact costs, so optimizing usage is important.

Capacity Planning

• Always check the units (KB, MB, etc.) and time intervals (seconds, minutes, hours) when
calculating throughput capacity to ensure accurate provisioning.

Provisioned vs. On-Demand Capacity

• Provisioned: Set the capacity in advance, ensuring the necessary throughput.

• On-Demand: Pay only for the read/write operations as they occur, without upfront capacity
planning.

Example Calculation for Provisioned Capacity

• 5 RCUs:

o Strong Consistency: Can read items up to 20 KB.

o Eventual Consistency: Can read items up to 40 KB.

• 5 WCUs:

o Can write items up to 5 KB or five items of 1 KB each.

1. When your application writes data to a DynamoDB table and receives an HTTP 200 response,
what does this indicate?

• A) The write operation failed.

• B) The write operation is pending.

• C) The write operation is successful and durable.

• D) The read operation is successful.

2. Which type of read consistency does DynamoDB perform by default?

• A) Eventually consistent read


• B) Strongly consistent read

• C) Causal consistency read

• D) Immediate consistency read

3. What is the primary difference between eventual consistency and strong consistency in
DynamoDB?

• A) Eventual consistency returns the most up-to-date data immediately.

• B) Strong consistency guarantees that the most recent data is returned, while eventual
consistency may not.

• C) Eventual consistency is only available for read-heavy operations.

• D) Strong consistency requires more write capacity units than eventual consistency.

4. How many strongly consistent reads per second can 1 Read Capacity Unit (RCU) support for
an item up to 4 KB in size?

• A) 0.5 reads per second

• B) 2 reads per second

• C) 1 read per second

• D) 4 reads per second

5. Which of the following is true regarding write capacity units in DynamoDB?

• A) 1 Write Capacity Unit (WCU) can handle two writes per second for an item up to 1 KB in
size.

• B) 1 Write Capacity Unit (WCU) can handle one write per second for an item up to 1 KB in
size.

• C) 1 Write Capacity Unit (WCU) can handle one write per second for an item up to 4 KB in size.

• D) 1 Write Capacity Unit (WCU) can handle two writes per second for an item up to 4 KB in
size.

6. If your application performs an eventual consistent read on an item that is 8 KB in size, how
many Read Capacity Units (RCUs) are required?

• A) 1 RCU

• B) 2 RCUs

• C) 4 RCUs

• D) 8 RCUs

7. What happens if your application exceeds the provisioned read or write throughput on a
DynamoDB table?
• A) The request will be retried automatically.

• B) The request will be throttled and fail with a 400 HTTP status code.

• C) The request will succeed but with higher latency.

• D) The request will be deferred until capacity is available.

8. In which scenario would you prefer to use on-demand capacity mode for a DynamoDB table?

• A) When the workload is predictable and consistent.

• B) When the workload is always heavy.

• C) When the workload is unpredictable or has sudden spikes in demand.

• D) When the workload involves large items.

9. How should you calculate the required number of read capacity units for a strongly
consistent read on an item of size 16 KB?

• A) Divide the item size by 8.

• B) Divide the item size by 4.

• C) Multiply the item size by 4.

• D) Multiply the item size by 8.

10. Which of the following best describes a scenario where you might encounter a
"ProvisionedThroughputExceededException" in DynamoDB?

• A) When your application exceeds the allocated read or write capacity units for the
table.

• B) When the table size exceeds the allocated storage.

• C) When the DynamoDB service is down.

• D) When there is a network timeout during the request.

DynamoDB Streams Exam Notes

• Purpose: DynamoDB Streams is an optional feature that captures data modification events
in DynamoDB tables in real-time and in the same order of occurrence.

• Use Case: Essential for keeping track of database changes and the order in which they occur.

• How it Works:

o Stream Records: Created whenever an event occurs in a DynamoDB table. Events


include:

▪ Insertion: Captures the image of the entire item, including all attributes.
▪ Update: Captures both the before and after images of modified attributes.

▪ Deletion: Captures the entire item before deletion.

o Stream Record Contents: Includes the table name, event timestamp, and other
metadata. Each record is guaranteed to be delivered only once.

• Retention: Stream records are retained for 24 hours, allowing time for management,
diagnostics, and other processing tasks.

• Integration:

o AWS Lambda: Can be used with DynamoDB Streams to automatically trigger code
execution whenever an item of interest appears in a stream.

o Kinesis Client Library and DynamoDB APIs: Other methods for interacting with
stream data.

• Workflow Example:

o A new product is added to a "Products" table, creating a new stream record.

o The stream record triggers an AWS Lambda function that reads the product details
and publishes a message to an Amazon SNS topic.

o Subscribers to the SNS topic, such as via email, are notified about the new product.

• Configuration:

o Streams can be enabled via the DynamoDB console under the "Overview" tab.

o View Types:

▪ Keys Only: Captures only the primary key attributes of the modified item.

▪ New Image: Captures the new image of the item after modification.

▪ Old Image: Captures the image of the item before modification.

▪ New and Old Images: Captures both the before and after images of the item,
useful for updates.

• Enabling Streams:

o Streams are not enabled by default and need to be manually activated.

o The view type can be selected during the enabling process.

What is the primary use of DynamoDB Streams?

• A) To back up DynamoDB tables

• B) To capture data modification events in DynamoDB tables in real-time

• C) To perform batch data processing


• D) To replicate data to other regions

• Answer: B) To capture data modification events in DynamoDB tables in real-time

Which of the following events does DynamoDB Streams capture?

• A) Table creation

• B) Index creation

• C) Data modification events like Insert, Update, Delete

• D) IAM Role changes

• Answer: C) Data modification events like Insert, Update, Delete

When an item is updated in a DynamoDB table with streams enabled, what does the stream
capture?

• A) Only the new image of the item

• B) Only the old image of the item

• C) Both the new and old images of the modified attributes

• D) No data is captured

• Answer: C) Both the new and old images of the modified attributes

How long are stream records retained in DynamoDB Streams?

• A) 12 hours

• B) 24 hours

• C) 48 hours

• D) 7 days

• Answer: B) 24 hours

Which of the following AWS services can be triggered by DynamoDB Streams to execute code
in response to stream events?

• A) Amazon S3

• B) AWS Lambda

• C) Amazon EC2

• D) Amazon RDS

• Answer: B) AWS Lambda

What type of data does the 'Keys Only' option capture in a DynamoDB Stream?
• A) All attributes of the item

• B) Only the primary key attributes of the modified item

• C) The timestamp of the modification

• D) Both old and new images of the item

• Answer: B) Only the primary key attributes of the modified item

Which view type in DynamoDB Streams should you choose if you want to capture both the
state of an item before and after an update?

• A) Keys Only

• B) New Image

• C) Old Image

• D) New and Old Images

• Answer: D) New and Old Images

What is a common use case for integrating DynamoDB Streams with AWS Lambda?

• A) To replicate DynamoDB data to S3

• B) To perform scheduled backups

• C) To trigger notifications or processing workflows based on data changes

• D) To run on-demand queries

• Answer: C) To trigger notifications or processing workflows based on data changes

What information is guaranteed to be unique and delivered only once by DynamoDB Streams?

• A) Stream Record ID

• B) Table Name

• C) Event Timestamp

• D) Primary Key

• Answer: A) Stream Record ID

Which of the following can you configure when enabling DynamoDB Streams on a table?

• A) Indexing Strategy

• B) Read/Write Capacity Mode

• C) Stream View Type

• D) Backup Frequency
• Answer: C) Stream View Type

DynamoDB Accelerator (DAX) Exam Notes

What is DAX?

• DAX stands for DynamoDB Accelerator.

• It is a DynamoDB-compatible caching service.

• DAX enables fast in-memory performance for demanding applications, significantly


improving read performance.

• DAX acts as a cache for DynamoDB, providing fast response times, typically in
microseconds, for accessing eventually consistent data.

Benefits:

• Improved Read Performance: DAX delivers fast response times, making it highly beneficial
for read-heavy workloads.

• Cost Savings: By reducing the need to over-provision read capacity units (RCUs), DAX can
lead to potential operational cost savings.

• Reduced Load: Caching frequently accessed data reduces the load on DynamoDB tables,
particularly for read operations.

How it Works:

1. Data Writing: The application writes data to DynamoDB tables.

2. Data Caching: Frequently accessed data is then written to DAX, the in-memory cache.

3. Data Reading: Before querying the DynamoDB table, the application checks DAX for the
requested data, reducing the need for direct read operations on the table.

1. What is DynamoDB Accelerator (DAX)?

• A) A write-heavy load balancer for DynamoDB

• B) An in-memory caching service for DynamoDB

• C) A backup solution for DynamoDB

• D) A DynamoDB encryption service

2. Which of the following best describes the primary benefit of using DAX?

• A) It reduces the response time for read operations to microseconds.

• B) It increases the write capacity units (WCUs) of DynamoDB.

• C) It automates DynamoDB table scaling.

• D) It provides automatic encryption for DynamoDB data.


3. DAX is most beneficial for applications with which type of workload?

• A) Write-heavy workloads

• B) Read-heavy workloads

• C) Mixed read/write workloads

• D) Sporadic, low-traffic workloads

4. How does DAX improve the cost-efficiency of DynamoDB?

• A) By reducing the need to over-provision read capacity units (RCUs)

• B) By reducing the need to over-provision write capacity units (WCUs)

• C) By automatically compressing data stored in DynamoDB

• D) By automatically archiving old data to Glacier

5. When an application reads data, what is the first step if DAX is enabled?

• A) The application writes data to the DynamoDB table.

• B) The application checks DAX for the requested data.

• C) The application reads data directly from DynamoDB.

• D) The application sends a read request to S3 for the data.

6. What type of data consistency does DAX primarily support for read operations?

• A) Strongly consistent

• B) Eventually consistent

• C) Fully consistent

• D) Consistently updated

7. Which of the following scenarios would benefit most from implementing DAX?

• A) A database with minimal read operations and heavy write operations

• B) An application with frequent, repeated read requests on the same data

• C) A DynamoDB table used for archival storage with infrequent access

• D) A transactional application requiring strongly consistent reads

8. How does DAX reduce the operational load on DynamoDB tables?

• A) By offloading write operations to an S3 bucket

• B) By caching frequently accessed data and serving it before querying DynamoDB

• C) By automatically scaling DynamoDB tables


• D) By storing backup copies of the data

9. Which AWS service is primarily integrated with DAX to enhance its functionality?

• A) Amazon S3

• B) Amazon RDS

• C) Amazon DynamoDB

• D) AWS Lambda

10. What happens if a piece of data is not found in the DAX cache?

• A) The application returns an error.

• B) The application retrieves the data directly from DynamoDB.

• C) The data is immediately written to DAX.

• D) The data is discarded as it is considered stale.

Amazon Aurora Serverless - Exam Notes

Overview:

• Aurora Serverless is an on-demand, auto-scaling configuration for Amazon Aurora. It


automatically adjusts compute capacity based on application demands and can pause when
not in use, saving costs.

• Aurora has two configurations: Serverless and Provisioned. In the Serverless model,
capacity is managed automatically, unlike the Provisioned model where you must manage it
manually.

Key Features:

• Auto-scaling: Scales compute capacity up and down based on demand, ideal for
applications with infrequent, intermittent, or unpredictable workloads.

• Pause and Resume: Aurora Serverless can automatically pause after a specified period of
inactivity, then resume when requests are received, further reducing costs.

• Separation of Storage and Compute: Storage is decoupled from compute, with storage
being fault-tolerant and self-healing, replicating data across three availability zones (AZs).

• Aurora Capacity Units (ACUs): Capacity is measured in ACUs, each consisting of 2 GB of


memory along with associated CPU and networking. Users define a minimum and maximum
number of ACUs to control scaling.

Use Cases:

• Infrequently Used Applications: Such as low-volume blogs, where traffic is not continuous.

• New Applications: Where database load is uncertain at launch and may grow over time.
• Variable Workloads: For applications like HR, budgeting, and reporting that experience
irregular usage.

• Unpredictable Workloads: Suitable for applications that see sudden spikes and drops in
activity.

• Development and Test Databases: Ideal for environments used only during work hours.

• Multi-tenant Applications: Aurora Serverless manages database capacity for multiple


tenants.

Technical Details:

• Scaling: Aurora Serverless uses a warm pool of resources to minimize scaling time. It
instantly allocates capacity as needed by switching active client connections to these pre-
warmed resources.

• Data API: Provides a secure HTTP endpoint backed by a connection pool, helping to manage
database connections more efficiently, especially for serverless and IoT applications.

Limitations of Aurora Serverless v1:

• Regional Availability: Only available in specific AWS regions and supports certain versions
of Aurora MySQL and Aurora PostgreSQL.

• Unsupported Features:

o No Aurora Cloning, Global Databases, Multi-Master Clusters, or Aurora Replicas.

o IAM Database Authentication, Backtracking, Performance Insights, and Database


Activity Streams are not supported.

o Connections are automatically closed if left open for more than 24 hours.

• S3 Integration:

o Cannot export Aurora Serverless snapshots to S3.

o Cannot save data to text files in S3 (Aurora MySQL).

o Cannot load text file data to Aurora MySQL from S3 (possible with Aurora
PostgreSQL).

Exam Focus:

• Understand the differences between Provisioned and Serverless Aurora configurations.

• Be familiar with ACUs, how they control scaling, and the concept of a warm pool of
resources.

• Know the limitations of Aurora Serverless v1 and the types of applications it's best suited
for.
These notes should help you prepare for questions on Aurora Serverless, focusing on its unique
features, use cases, and limitations.

1. What is the primary benefit of using Amazon Aurora Serverless over a provisioned Aurora
database?

o A) Lower latency

o B) Automatic scaling based on application demands

o C) Increased storage capacity

o D) Enhanced security features

2. Which of the following workloads is Amazon Aurora Serverless best suited for?

o A) Consistently high-traffic e-commerce websites

o B) Infrequent, intermittent, or unpredictable workloads

o C) Real-time analytics on streaming data

o D) High-performance computing (HPC) applications

3. What is an Aurora Capacity Unit (ACU) in Amazon Aurora Serverless?

o A) A unit of database storage

o B) A combination of 2 GB of memory, CPU, and networking resources

o C) A unit of network bandwidth

o D) A measure of IOPS (Input/Output Operations Per Second)

4. In Amazon Aurora Serverless, what happens to the database when it is paused?

o A) Compute capacity is suspended, and only storage is charged

o B) The database is completely terminated

o C) The database is archived to Amazon S3

o D) The database is automatically deleted

5. Which of the following is NOT supported in Amazon Aurora Serverless v1?

o A) Aurora Global Databases

o B) Auto-scaling of compute capacity

o C) Multi-AZ deployments

o D) Connection management via Data API

6. How does Amazon Aurora Serverless handle sudden spikes in database workload?
o A) It increases the number of database instances manually

o B) It automatically scales up using a warm pool of pre-allocated resources

o C) It requires manual intervention to scale

o D) It queues the requests until capacity is available

7. Which of the following is a key feature of Amazon Aurora Serverless?

o A) Pause and resume capability to save costs during idle periods

o B) Provisioning of fixed database capacity

o C) Real-time backup to S3

o D) Support for all AWS regions

8. What is the maximum storage limit that Amazon Aurora Serverless can scale to?

o A) 64 TB

o B) 256 TB

o C) 512 TB

o D) 128 TB

9. Which statement is true about the Data API in Amazon Aurora Serverless?

o A) It requires persistent connections to the database cluster

o B) It only works with Aurora PostgreSQL

o C) It abstracts away the need for connection pools by providing an HTTP endpoint

o D) It is only available in the AWS GovCloud region

10. Which of the following is a limitation of Amazon Aurora Serverless v1?

o A) Cannot export snapshots to S3

o B) Cannot be deployed in a Multi-AZ configuration

o C) Does not support MySQL compatibility

o D) Cannot integrate with AWS IAM for authentication

Exam Notes: Amazon Aurora Global Database

General Characteristics:

• Aurora Global Database: A single database that spans multiple regions, providing low-
latency global reads and fast recovery from region-specific outages.

• Primary & Secondary Regions:


o The primary database cluster exists in one region (where writes occur).

o Up to five read-only secondary regions can be configured.

o Asynchronous replication is used between the primary and secondary regions with
sub-second latency.

Structure:

• Configuration Flexibility: You can change the configuration of an Aurora Global Database
while it’s running to support global processing use cases.

• Primary Region: Handles writes and synchronous replication across availability zones within
the region.

• Secondary Region: Supports read capabilities with asynchronous replication from the
primary region.

Use Cases:

• Global Processing: Common in financial services, where different global regions manage
trading operations at different times (e.g., New York, London, Australia).

o "Follow the Sun" Strategy: Write capabilities are moved to different regions as the
global trading day progresses.

Benefits:

• Global Reads with Local Latency: Provides local latency for global users, ensuring fast read
operations in all configured regions.

• Scalable Secondary Clusters: Secondary clusters are read-only and can support up to 16
replica instances (compared to the 15 in a non-global Aurora cluster).

• Fast Replication: Replication from primary to secondary clusters has minimal impact on
performance.

• Disaster Recovery: In the event of a regional outage, secondary clusters can be promoted to
primary in under a minute.

Limitations:

• Compatibility Restrictions:

o Aurora Global does not support Multi-Master clusters.

o Aurora Serverless v1 is not supported.

o Backtracking is not available.

• Cluster Operations: You cannot start or stop individual Aurora database clusters within an
Aurora Global Database.
• Engine Version Consistency: AWS recommends that secondary clusters use the same
Aurora Database Engine version as the primary cluster. Discrepancies in versions can lead to
issues.

Key Concepts for the Exam:

• Following the Sun: Understand this concept where the primary region is switched across
global regions based on operational demands (e.g., trading day shifts).

• Limitations: Be aware of the features that are not supported in Aurora Global Databases, as
these could be potential exam questions.

What is the maximum number of read-only secondary regions you can configure in an Aurora
Global Database?

• A) 3

• B) 5

• C) 7

• D) 10

Which of the following features is NOT supported by Amazon Aurora Global Database?

• A) Global reads with local latency

• B) Aurora Multi-Master clusters

• C) Disaster recovery with fast failover

• D) Asynchronous replication between regions

How quickly can you promote a secondary region to the primary region in an Aurora Global
Database?

• A) In less than 5 minutes

• B) In less than 10 minutes

• C) In less than a minute

• D) Instantly

Which replication method is used between the primary and secondary regions in an Aurora
Global Database?

• A) Synchronous replication

• B) Asynchronous replication

• C) Multi-Master replication

• D) Point-in-time replication
Which of the following is a key benefit of using Aurora Global Database?

• A) Multi-AZ deployment within a single region

• B) Global reads with low latency

• C) Automatic failover within the same availability zone

• D) Unlimited database storage

In the context of an Aurora Global Database, what is the "Follow the Sun" strategy?

• A) Promoting all secondary regions to primary at the same time

• B) Moving the primary region to different global regions based on time zone needs

• C) Enabling write operations in all regions simultaneously

• D) Synchronizing read and write operations across all regions

Which of the following is true about Aurora Global Database when considering disaster
recovery?

• A) Secondary regions cannot be promoted to primary.

• B) The promotion of a secondary region to primary takes several hours.

• C) Secondary regions can be promoted to primary in under a minute.

• D) Replication from primary to secondary is synchronous for disaster recovery purposes.

Which scenario would be problematic according to AWS best practices for Aurora Global
Database?

• A) Using a secondary region for read-only workloads

• B) Running different Aurora engine versions between primary and secondary clusters

• C) Promoting a secondary region to primary in the event of an outage

• D) Scaling secondary clusters independently of the primary

What is the maximum number of Aurora replicas that can be configured in a secondary region
of an Aurora Global Database?

• A) 10

• B) 12

• C) 16

• D) 20

Which of the following features is currently mutually exclusive with Aurora Global Database?

• A) Aurora Serverless v1
• B) Global reads

• C) Asynchronous replication

• D) Disaster recovery

Exam Notes on Amazon ElastiCache

Overview of Amazon ElastiCache

• Amazon ElastiCache is an in-memory cache service that stores frequently accessed and
infrequently changing critical pieces of information in memory.

• Purpose: Improves application performance by providing low-latency access to data, which


is faster than disk-based databases.

• Use Cases: Caching the results of I/O-intensive database queries or computationally


intensive calculations that do not change frequently.

Engines Supported

• Memcached:

o A simple key-value store.

o Ideal for storing data from persistent data stores (e.g., Amazon RDS, DynamoDB) and
dynamically generated web pages.

o Suitable for transient session data that does not require persistent backing.

• Redis:

o Supports more complex data structures, such as lists and sorted sets, in addition to
simple key-value pairs.

o Provides features like Multi-AZ (Multi-Availability Zone) replication, which ensures


high availability by storing a standby replica in another availability zone.

o Automatically switches to the standby replica if the primary node fails.

Benefits of Using ElastiCache

• Performance: Reduces the load on databases like Amazon RDS by serving frequently
accessed content from the in-memory cache.

• Scalability: Eliminates the need to scale in and out the data layer during peak and slack
times, as frequently accessed content is served from memory.

• Availability: Features built-in automatic failure detection and recovery, ensuring high
availability of cached data.

Example Scenario
• Online Store: Consider an online store using AWS infrastructure with a load balancer,
multiple EC2 targets, and an RDS database with Multi-AZ standby.

o When a customer logs in, the application needs to show preferred products based on
previous purchases. Performing this calculation directly on RDS would be slow and
resource-intensive.

o Solution: Store the top 10 products in an ElastiCache cluster (in-memory key-value


store) and retrieve this data quickly, reducing load on the RDS instance and improving
response time.

What is the primary benefit of using Amazon ElastiCache in a web application?

• A) It provides persistent storage for data.

• B) It improves application performance by caching frequently accessed data.

• C) It automatically scales the EC2 instances.

• D) It manages DNS routing for your application.

• Answer: B) It improves application performance by caching frequently accessed data.

Which of the following engines are supported by Amazon ElastiCache?

• A) MySQL and PostgreSQL

• B) Redis and Memcached

• C) Cassandra and MongoDB

• D) DynamoDB and Oracle

• Answer: B) Redis and Memcached

What feature of Redis in Amazon ElastiCache ensures high availability by storing a replica in
another availability zone?

• A) Cross-region replication

• B) Multi-AZ replication

• C) Read replicas

• D) Global tables

• Answer: B) Multi-AZ replication

In which scenario would you choose Memcached over Redis in Amazon ElastiCache?

• A) When you need support for complex data structures like lists and sets.

• B) When you need a simple key-value store without complex operations.

• C) When you require automatic failover.


• D) When you need Multi-AZ replication.

• Answer: B) When you need a simple key-value store without complex operations.

How does Amazon ElastiCache improve the scalability of a web application?

• A) By reducing the load on the backend database by serving frequently accessed data from
memory.

• B) By automatically adding more EC2 instances during peak times.

• C) By managing the database schema and optimizing queries.

• D) By distributing traffic across multiple regions.

• Answer: A) By reducing the load on the backend database by serving frequently


accessed data from memory.

Which Amazon ElastiCache engine would you choose if your application requires operations
on sorted sets and lists?

• A) Memcached

• B) Redis

• C) DynamoDB

• D) MySQL

• Answer: B) Redis

What is a key difference between using ElastiCache with Redis and Memcached?

• A) Redis supports complex data types, whereas Memcached supports only simple key-value
pairs.

• B) Memcached provides Multi-AZ support, whereas Redis does not.

• C) Redis does not support automatic failover, whereas Memcached does.

• D) Memcached supports persistence, whereas Redis does not.

• Answer: A) Redis supports complex data types, whereas Memcached supports only
simple key-value pairs.

What type of data is best suited to be cached in Amazon ElastiCache?

• A) Frequently changing transactional data

• B) Data that requires complex SQL queries

• C) Frequently accessed, infrequently changing data

• D) Large binary files like images and videos


• Answer: C) Frequently accessed, infrequently changing data

How does Amazon ElastiCache help reduce the response time for read-heavy applications?

• A) By scaling up the database automatically.

• B) By serving cached results from memory rather than querying the database.

• C) By compressing the data before sending it to the client.

• D) By replicating the data across multiple regions.

• Answer: B) By serving cached results from memory rather than querying the database.

What is a benefit of using ElastiCache with Redis in a Multi-AZ configuration?

• A) It allows for synchronous data replication across different regions.

• B) It provides automated failover to a standby node in a different availability zone.

• C) It scales the cache horizontally by adding more nodes.

• D) It reduces the need for a primary database by storing all data in Redis.

• Answer: B) It provides automated failover to a standby node in a different availability


zone.

Exam Notes: ElastiCache - Security

1. Data Security in ElastiCache

• In-Transit Encryption:

o Security enabled for encryption as data moves from one node to another in a cluster
or between your cluster and your application.

o Important for secure data transfer within the ElastiCache environment.

• At-Rest Encryption:

o Encryption of data stored on disk, especially during synchronization and backup


operations.

o For example, during snapshot creation and storage to S3.

2. Requirements for Redis ElastiCache Security Features

• Redis Version:

o The cluster must be running Redis 3.2.6, 4.0.10, or later.

• VPC Configuration:

o The cluster or replication group must be created in a VPC, specifically based on


Amazon VPC.
3. Access Patterns and Security Scenarios

• Access Within the Same VPC:

o EC2 instances and ElastiCache Redis cluster are in the same VPC.

o Create custom security group rules to allow connections from the EC2 instances’
security group to the ElastiCache security group.

• Access from Different VPCs in the Same Region:

o Applications running on EC2 instances in one VPC accessing ElastiCache Redis in


another VPC within the same region.

o Implemented using VPC peering or PrivateLink.

o VPCs must not have overlapping IP address ranges.

• Access from Different VPCs in Different Regions:

o Connects multiple geographically dispersed VPCs through a Transit VPC.

o Transit VPC acts as a global network hub, allowing communication between


application EC2 instances in one region and ElastiCache Redis clusters in another
region.

• Access from On-Premises Data Centers:

o Hybrid architecture allows applications in on-premises data centers to access


ElastiCache Redis clusters in AWS VPCs.

o Supported through VPN or Direct Connect.

4. Key Points for Exam Preparation

• Understand various access scenarios and how to secure them:

o Same VPC access.

o Different VPCs within the same region.

o Different VPCs across different regions.

o Hybrid architecture with on-premises data centers.

• Study and memorize access patterns and security configurations for ElastiCache Redis
clusters.

1. Which of the following statements about ElastiCache in-transit encryption is true?

• A) In-transit encryption is enabled by default for all ElastiCache clusters.

• B) In-transit encryption secures data as it moves between nodes in a cluster or between


the cluster and an application.
• C) In-transit encryption only works for Memcached clusters.

• D) In-transit encryption cannot be used with Redis clusters.

2. To use encryption at rest with Amazon ElastiCache, your Redis cluster must meet which of
the following conditions?

• A) The Redis version must be 2.8.24 or later.

• B) The cluster must be deployed in a public subnet.

• C) The Redis version must be 3.2.6, 4.0.10, or later, and the cluster must be in a VPC.

• D) The cluster must be created in a region that supports AWS Shield.

3. Which of the following AWS services is used to secure communication between two VPCs in
different regions for ElastiCache access?

• A) AWS Direct Connect

• B) AWS VPN

• C) AWS Transit VPC

• D) AWS CloudFront

4. What must be ensured when configuring VPC peering for ElastiCache access between two
VPCs?

• A) The VPCs must not have overlapping IP address ranges.

• B) Both VPCs must be in the same availability zone.

• C) The VPCs must have the same security group configurations.

• D) The VPCs must be in different regions.

5. In which scenario would you need to use a Transit VPC to access an ElastiCache Redis
cluster?

• A) When you need to connect multiple VPCs across different regions.

• B) When you want to connect multiple EC2 instances within the same VPC.

• C) When connecting an on-premises data center to a VPC.

• D) When you want to connect EC2 instances within the same region but different availability
zones.

6. Which of the following is required to enable ElastiCache access from an on-premises data
center?

• A) A VPN or Direct Connect connection between the data center and the AWS VPC.

• B) An S3 bucket for storing data at rest.


• C) A Transit Gateway configured in both the on-premises data center and the VPC.

• D) The ElastiCache cluster must be in a public subnet.

7. What is the primary purpose of security groups in ElastiCache?

• A) To encrypt data at rest.

• B) To control inbound and outbound traffic to ElastiCache clusters.

• C) To monitor ElastiCache performance.

• D) To create snapshots of ElastiCache clusters.

8. When setting up a VPC peering connection for ElastiCache, what must you configure to
ensure proper routing between VPCs?

• A) Enable DNS resolution.

• B) Create a VPN connection between the VPCs.

• C) Update the route tables of both VPCs to allow traffic to the peered VPC.

• D) Assign Elastic IP addresses to the ElastiCache nodes.

9. Which of the following scenarios would not require a Transit VPC?

• A) Connecting multiple VPCs across different regions.

• B) Accessing an ElastiCache cluster from an EC2 instance within the same VPC.

• C) Creating a global network hub to connect geographically dispersed VPCs.

• D) Enabling communication between ElastiCache clusters in different regions.

10. To securely connect on-premises applications to an ElastiCache Redis cluster in AWS,


which network architecture should be implemented?

• A) VPC Peering

• B) Hybrid architecture using VPN or Direct Connect

• C) AWS Transit VPC

• D) PrivateLink

Exam Notes: ElastiCache - Session Store

What is a Session Store?

• A session store is used by web applications to keep track of user sessions, which are active
from the time a user logs in until they log out or the session times out.

• Session data includes user profile information, personalized data, recommendations,


targeted promotions, and discounts.
• The challenge arises when session data is stored on individual web servers. If a user starts a
session on one server and is later redirected to another, the session information may be lost
unless a session store is used.

Sticky Sessions (Session Affinity)

• Sticky Sessions ensure that each request from a specific user is directed to the same web
server.

• Drawbacks of Sticky Sessions:

o Reduced Elasticity: If a web server goes down, the session data is lost, causing
disruptions.

o Uneven Load Distribution: Traffic can become disproportionately heavy on certain


servers, leading to potential overloads.

o Loss of Session on Auto-Scaling: When an Auto Scaling event terminates a web


server, all session data on that server is lost.

ElastiCache Redis as a Session Store

• ElastiCache Redis provides a scalable, in-memory cache that can be used as a session
store.

• Benefits:

o Session information is stored outside of the application servers, enabling seamless


load balancing and elasticity.

o Redis acts as a fast key-value store, with session data stored in it and retrieved as
needed.

o Web servers can scale independently without losing session data since sessions are
managed by Redis.

Steps to Implement ElastiCache Redis as a Session Store

1. Create an ElastiCache Redis Cluster: Set up a Redis cluster in ElastiCache.

2. Modify Application Code: Update the application to use Redis as the session store.

3. Session Workflow:

o User logs in; EC2 web server verifies credentials.

o A new session is created in Redis and a session cookie is returned to the user's
browser.

o Subsequent requests from the user, regardless of which web server handles them,
retrieve session data from Redis.
o This allows for load balancing across multiple web servers without losing session
continuity.

Advantages of ElastiCache Redis over Sticky Sessions

• Improved Elasticity: No dependency on a single web server, allowing servers to be added or


removed without affecting sessions.

• Scalable and Fast: Redis can handle large volumes of session data efficiently.

• Session Persistence: Sessions persist across server failures, maintaining user experience.

MCQ 1:

Q: What is the primary benefit of using ElastiCache Redis as a session store in a web application?

• A) Improved session persistence across server failures

• B) Reduced latency for database queries

• C) Automatic data replication across regions

• D) Cost savings on web server instances

Answer: A) Improved session persistence across server failures

MCQ 2:

Q: Which of the following is a drawback of using sticky sessions in a web application?

• A) Increased latency due to network hops

• B) Inability to use an Auto Scaling group effectively

• C) Loss of session data when the ElastiCache cluster fails

• D) Complicated application code maintenance

Answer: B) Inability to use an Auto Scaling group effectively

MCQ 3:

Q: When using ElastiCache Redis as a session store, where is the session data stored?

• A) On each individual web server

• B) In an S3 bucket

• C) In an in-memory cache within the Redis cluster

• D) In an RDS database

Answer: C) In an in-memory cache within the Redis cluster

MCQ 4:
Q: What happens to a user's session if a web server handling sticky sessions fails and Auto Scaling
launches a new server?

• A) The session is automatically transferred to the new server

• B) The session is lost and the user must log in again

• C) The session is persisted in S3

• D) The session continues without any interruption

Answer: B) The session is lost and the user must log in again

MCQ 5:

Q: How does ElastiCache Redis help in maintaining session continuity when using multiple web
servers?

• A) By ensuring each user is directed to the same server for every request

• B) By storing session data in a centralized, highly available in-memory cache

• C) By distributing session data across all web servers

• D) By replicating session data to an RDS instance

Answer: B) By storing session data in a centralized, highly available in-memory cache

MCQ 6:

Q: Which of the following best describes the purpose of setting a Time to Live (TTL) on session keys
in ElastiCache Redis?

• A) To reduce memory usage by automatically expiring old session data

• B) To ensure session data is replicated across multiple nodes

• C) To prevent sessions from being accessed by unauthorized users

• D) To balance load among different Redis clusters

Answer: A) To reduce memory usage by automatically expiring old session data

MCQ 7:

Q: What is a potential risk of not using a session store like ElastiCache Redis in a multi-server web
application?

• A) Inability to scale the application horizontally

• B) Inconsistent session handling across servers

• C) Increased costs due to higher usage of EC2 instances

• D) Slow database queries


Answer: B) Inconsistent session handling across servers

MCQ 8:

Q: Which AWS service can be used to store session data outside of the application server, ensuring
session persistence across scaling events?

• A) Amazon RDS

• B) AWS Lambda

• C) Amazon ElastiCache

• D) Amazon S3

Answer: C) Amazon ElastiCache

MCQ 9:

Q: What should be modified in your web application to use ElastiCache Redis as a session store?

• A) The network configuration to route traffic through ElastiCache

• B) The application code to store and retrieve sessions from Redis

• C) The IAM roles to allow access to Redis

• D) The Auto Scaling group settings

Answer: B) The application code to store and retrieve sessions from Redis

MCQ 10:

Q: Which of the following best describes the relationship between ElastiCache Redis and EC2
instances in the context of session management?

• A) Redis caches database queries from EC2 instances

• B) Redis replaces EC2 instances in serving user requests

• C) Redis stores session data that EC2 instances retrieve as needed

• D) Redis automatically scales EC2 instances based on session load

Answer: C) Redis stores session data that EC2 instances retrieve as needed

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy