Week 4
Week 4
High Availability : Highly available systems are reliable in the sense that they continue operating even
when critical components fail. They are also resilient, meaning that they are able to simply handle failure
without service disruption or data loss, and seamlessly recover from such failure.
Scalability : Scalability is the ability of a system to handle the increase in demand without impacting the
application’s performance or availability. When the demand is too high and there are not enough resources,
then it impacts performance. There are two types of scalability: 1.Vertical: scale up or down: Add or remove
resources: CPU Memory Storage 2.Horizontal: scale out or in: Add or remove systems
4.2 Elastic Load Balancer (ELB) and Auto Scaling Groups (ASG)
Nowadays many applications and websites can serve millions of concurrent requests to users/clients
globally. When the amount of network workload increases on an application or website, a single server may
fail to support network traffic. To manage the demand of volatile network traffic efficiently, you can use a
Load balancer to distribute incoming network traffic across multiple servers, and prevent failure caused by
overloading on a single server. The load balancer sits between user/client devices and backend servers to
support efficient handling of high traffic.
Elastic Load Balancer is a highly available cloud service. You can distribute traffic in one Availability
Zone or multiple Availability Zones. ELB only routes traffic to healthy targets like EC2 instances, IP
addresses, Lambda functions. Health check configuration allows monitoring the health status of your targets
that are running behind the load balancer.
For example, if any EC2 server is unhealthy or not available, ELB routes traffic to the other healthy EC2
server. It can also route traffic to the other availability zones, in case of all EC2 servers are down in a
specific availability zone.
Elastic Load Balancing automatically distributes your incoming application traffic across all the EC2
instances that you are running. Elastic Load Balancing helps to manage incoming requests by optimally
routing traffic so that no one instance is overwhelmed.
An Auto Scaling group contains a collection of EC2 instances that are treated as a logical grouping for the
purposes of automatic scaling and management. An Auto Scaling group also lets you use Amazon EC2 Auto
Scaling features such as health check replacements and scaling policies.
To use Elastic Load Balancing with your Auto Scaling group, attach the load balancer to your Auto
Scaling group. This registers the group with the load balancer, which acts as a single point of contact for all
incoming web traffic to your Auto Scaling group.
When you use Elastic Load Balancing with your Auto Scaling group, it's not necessary to register
individual EC2 instances with the load balancer. Instances that are launched by your Auto Scaling group are
automatically registered with the load balancer. Likewise, instances that are terminated by your Auto
Scaling group are automatically deregistered from the load balancer.
After attaching a load balancer to your Auto Scaling group,
you can configure your Auto Scaling group to use Elastic Load Balancing metrics (such as the Application
Load Balancer request count per target) to scale the number of instances in the group as demand fluctuates.
To ensure that your registered instances are able to handle the request load in each Availability Zone, it is
important to keep approximately the same number of instances in each Availability Zone registered with the
load balancer. For example, if you have ten instances in Availability Zone us-west-2a and two instances in
us-west-2b, the requests are distributed evenly between the two Availability Zones. As a result, the two
instances in us-west-2b serve the same amount of traffic as the ten instances in us-west-2a. Instead, you
should have six instances in each Availability Zone.
By default, the load balancer distributes traffic evenly across the Availability Zones that you enable for
your load balancer. To distribute traffic evenly across all registered instances in all enabled Availability
Zones, enable cross-zone load balancing on your load balancer. However, we still recommend that you
maintain approximately equivalent numbers of instances in each Availability Zone for better fault tolerance.
Create a target group, which is used in request routing. The rule for your listener routes requests to the
registered targets in this target group. The load balancer checks the health of targets in this target group
using the health check settings defined for the target group.
Elastic Load Balancing supports different types of load balancers. For this tutorial, you create a Network
Load Balancer.
To create a Network Load Balancer, you must first provide basic configuration information for your load
balancer, such as a name, scheme, and IP address type. Then provide information about your network, and
one or more listeners. A listener is a process that checks for connection requests. It is configured with a
protocol and a port for connections from clients to the load balancer. For more information about supported
protocols and ports, see Listener configuration.
After creating the load balancer, verify that it's sending traffic to your EC2 instances.
As soon as your load balancer becomes available, you are billed for each hour or partial hour that you keep
it running. When you no longer need a load balancer, you can delete it. As soon as the load balancer is
deleted, you stop incurring charges for it. Note that deleting a load balancer does not affect the targets
registered with the load balancer. For example, your EC2 instances continue to run.
After you’ve named your load balancer, scroll down to “Listener Configuration” and add a new HTTPS
load balancer protocol with “HTTP Instance” protocol. Click “continue.”
Now select “Upload New SSL Certificate
.”
After filling out the appropriate fields, click “continue.”
Select “ELBSample-ELBDefaultNegotiationPolicy” as your SSL cipher policy.
Click “continue.”
Now configure the “Health Check” to your requirements, set the “Ping Path” to “/.”
Add your EC2 Instance and click “continue.”
Now, the final step, review your setup and click “Create.”
Congratulations! You’ve now installed your SSL Certificate on your AWS Load Balancer.
With Connection Draining feature enabled, if an EC2 backend instance fails health checks the Elastic
Load Balancer will not send any new requests to the unhealthy instance. However, it will still allow
existing (in-flight) requests to complete for the duration of the configured timeout.
Enabling this feature will allow better management of the resources behind the Elastic Load Balancer,
such as replacing backend instances without impacting the user experience. For example, taking an
instance out of service and replacing it with a fresh EC2 instance that contains updated software, while
avoid breaking open network connections.
You can disable connection draining for your load balancer at any time.
4.13 Lab – ASG Create an Auto Scaling group using a launch template
When you create an Auto Scaling group, you must specify the necessary information to configure the
Amazon EC2 instances, the Availability Zones and VPC subnets for the instances, the desired capacity, and
the minimum and maximum capacity limits.
To configure Amazon EC2 instances that are launched by your Auto Scaling group, you can specify a
launch template or a launch configuration. The following procedure demonstrates how to create an Auto
Scaling group using a launch template.
Prerequisites
You must have created a launch template. For more information, see Create a launch template for an
Auto Scaling group.
To create an Auto Scaling group using a launch template (console)
1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/, and choose Auto Scaling
Groups from the navigation pane.
2. On the navigation bar at the top of the screen, choose the same AWS Region that you used when you
created the launch template.
3. Choose Create an Auto Scaling group.
4. On the Choose launch template or configuration page, do the following:
a. For Auto Scaling group name, enter a name for your Auto Scaling group.
b. For Launch template, choose an existing launch template.
c. For Launch template version, choose whether the Auto Scaling group uses the default, the
latest, or
a specific version of the launch template when scaling out.
d. Verify that your launch template supports all of the options that you are planning to use, and
then
choose Next.
5. On the Choose instance launch options page, under Network, for VPC, choose a VPC. The Auto
Scaling group must be created in the same VPC as the security group you specified in your launch template.
6. For Availability Zones and subnets, choose one or more subnets in the specified VPC. Use subnets in
multiple Availability Zones for high availability. For more information, see Considerations when choosing
VPC subnets.
7. If you created a launch template with an instance type specified, then you can continue to the next step to
create an Auto Scaling group that uses the instance type in the launch template.
Alternatively, you can choose the Override launch template option if no instance type is specified in your
launch template or if you want to use multiple instance types for auto scaling. For more information,
see Auto Scaling groups with multiple instance types and purchase options.
8. Choose Next to continue to the next step.
Or, you can accept the rest of the defaults, and choose Skip to review.
9. (Optional) On the Configure advanced options page, configure the following options, and then
choose Next:
a. To register your Amazon EC2 instances with a load balancer, choose an existing load
balancer or create a new one. For more information, see Use Elastic Load Balancing to distribute traffic
across the instances in your Auto Scaling group. To create a new load balancer, follow the procedure
in Configure an Application Load Balancer or Network Load Balancer from the Amazon EC2 Auto
Scaling console.
b. (Optional) For Health checks, Additional health check types, select Turn on Elastic Load
Balancing health checks.
c. (Optional) For Health check grace period, enter the amount of time, in seconds. This is how
long Amazon EC2 Auto Scaling needs to wait before checking the health status of an instance after it
enters the InService state. For more information, see Set the health check grace period for an Auto
Scaling group.
d. Under Additional settings, Monitoring, choose whether to enable CloudWatch group
metrics collection. These metrics provide measurements that can be indicators of a potential issue, such
as number of terminating instances or number of pending instances. For more information, see Monitor
CloudWatch metrics for your Auto Scaling groups and instances.
e. For Enable default instance warmup, select this option and choose the warm-up time for
your application. If you are creating an Auto Scaling group that has a scaling policy, the default instance
warmup feature improves the Amazon CloudWatch metrics used for dynamic scaling. For more
information, see Set the default instance warmup for an Auto Scaling group.
10. (Optional) On the Configure group size and scaling policies page, configure the following options, and
then choose Next:
a. For Desired capacity, enter the initial number of instances to launch. When you change this number
to a value outside of the minimum or maximum capacity limits, you must update the values
of Minimum capacity or Maximum capacity. For more information, see Set capacity limits on your
Auto Scaling group.
b. To automatically scale the size of the Auto Scaling group, choose Target tracking scaling
policy and follow the directions. For more information, see Target tracking scaling policies for Amazon
EC2 Auto Scaling.
c. Under Instance scale-in protection, choose whether to enable instance scale-in protection. For more
information, see Use instance scale-in protection.
11. (Optional) To receive notifications, for Add notification, configure the notification, and then
choose Next. For more information, see Get Amazon SNS notifications when your Auto Scaling group
scales.
12. (Optional) To add tags, choose Add tag, provide a tag key and value for each tag, and then
choose Next. For more information, see Tag Auto Scaling groups and instances.
13. On the Review page, choose Create Auto Scaling group.
EC2 Auto Scaling Policies provide several ways for scaling the Auto Scaling group.
o Manual Scaling
o Scheduled Scaling
o Dynamic Scaling
o Predictive Scaling
1. Manual Scaling
Manual scaling can be performed by
o Changing the desired capacity limit of the ASG
o Attaching/Detaching instances to the ASG
Attaching/Detaching an EC2 instance can be done only if
o Instance is in the running state.
o AMI used to launch the instance must still exist.
o Instance is not a member of another ASG.
o Instance is in the same Availability Zone as the ASG.
o If the ASG is associated with a load balancer, the instance and the load balancer must both be
in the same VPC.
Auto Scaling increases the desired capacity of the group by the number of instances being attached.
But if the number of instances being attached plus the desired capacity exceeds the maximum size,
the request fails.
When Detaching instances, an option to decrement the desired capacity for the ASG by the number
of instances being detached is provided. If chosen not to decrement the capacity, Auto Scaling
launches new instances to replace the ones that you detached.
If an instance is detached from an ASG that is also registered with a load balancer, the instance is
deregistered from the load balancer. If connection draining is enabled for the load balancer, Auto
Scaling waits for the in-flight requests to complete.
2.Scheduled Scaling
Scaling based on a schedule allows you to scale the application in response to predictable load
changes for e.g. last day of the month, the last day of a financial year.
Scheduled scaling requires the configuration of Scheduled actions, which tells Auto Scaling to
perform a scaling action at a certain time in the future, with the start time at which the scaling action
should take effect, and the new minimum, maximum, and desired size of group should have.
Auto Scaling guarantees the order of execution for scheduled actions within the same group, but not
for scheduled actions across groups.
Multiple Scheduled Actions can be specified but should have unique time values and
they cannot have overlapping times scheduled which will lead to their rejection.
Cooldown periods are not supported.
3.Dynamic Scaling
Allows automatic scaling in response to the changing demand for e.g. scale-out in case CPU
utilization of the instance goes above 70% and scale in when the CPU utilization goes below 30%
ASG uses a combination of alarms & policies to determine when the conditions for scaling are met.
o An alarm is an object that watches over a single metric over a specified time period. When
the value of the metric breaches the defined threshold, for the number of specified time
periods the alarm performs one or more actions (such as sending messages to Auto Scaling).
o A policy is a set of instructions that tells Auto Scaling how to respond to alarm messages.
Dynamic scaling process works as below
o CloudWatch monitors the specified metrics for all the instances in the Auto Scaling Group.
o Changes are reflected in the metrics as the demand grows or shrinks
o When the change in the metrics breaches the threshold of the CloudWatch alarm, the
CloudWatch alarm performs an action. Depending on the breach, the action is a message sent
to either the scale-in policy or the scale-out policy
o After the Auto Scaling policy receives the message, Auto Scaling performs the scaling
activity for the ASG.
o This process continues until you delete either the scaling policies or the ASG.
When a scaling policy is executed, if the capacity calculation produces a number outside of the
minimum and maximum size range of the group, EC2 Auto Scaling ensures that the new capacity
never goes outside of the minimum and maximum size limits.
When the desired capacity reaches the maximum size limit, scaling out stops. If demand drops and
capacity decreases, Auto Scaling can scale out again.
4. Predictive Scaling
Predictive scaling can be used to increase the number of EC2 instances in the ASG in advance of
daily and weekly patterns in traffic flows.
Predictive scaling is well suited for situations where you have:
o Cyclical traffic, such as high use of resources during regular business hours and low use of
resources during evenings and weekends
o Recurring on-and-off workload patterns, such as batch processing, testing, or periodic data
analysis
o Applications that take a long time to initialize, causing a noticeable latency impact on
application performance during scale-out events
Predictive scaling provides proactive scaling that can help scale faster by launching capacity in
advance of forecasted load, compared to using only dynamic scaling, which is reactive in nature.
Predictive scaling uses machine learning to predict capacity requirements based on historical data
from CloudWatch. The machine learning algorithm consumes the available historical data and
calculates the capacity that best fits the historical load pattern, and then continuously learns based on
new data to make future forecasts more accurate.
Predictive scaling supports forecast only mode so that you can evaluate the forecast before you
allow predictive scaling to actively scale capacity
A cloud database is a database service built and accessed through a cloud platform. It serves many of the
same functions as a traditional database with the added flexibility of cloud computing. Users install software
on a cloud infrastructure to implement the database.
Key features:
A database service built and accessed through a cloud platform
Enables enterprise users to host databases without buying dedicated hardware
Can be managed by the user or offered as a service and managed by a provider
Can support relational databases (including MySQL and PostgreSQL) and NoSQL
databases (including MongoDB and Apache CouchDB)
Accessed through a web interface or vendor-provided API
Amazon Web Services Database Services offer a fully managed and scalable database solution for your
applications. Amazon offers a variety of database choices, which include Amazon RDS, Aurora,
DynamoDB, ElasticCache, and Redshift.
AWS offers a wide range of database options that you can choose for your applications. AWS database
services mainly fall into two categories: Relational and non-relational.
Amazon RDS – Aurora, Oracle, PostgreSQL, MySQL, MariaDB, SQL Server
DynamoDB
ElasticCache – Memcached, Redis
Redshift
Amazon RDS is the service provided by the AWS which makes it easy to set up, deploy, scale, and
operate relational databases in the cloud. It provides you with six familiar database engines to choose and
that includes Amazon Aurora, PostgreSQL, MySQL, MariaDB, Oracle Database, and SQL Server.
As RDS is a managed service provided by AWS, we can expect that like other AWS services it will
provide scalability, security and cost effectiveness to the various RDBMS it provides. The database products
available through AWS RDS are as listed below.
MySQL - Support versions for MySQL 5.5 to 5.7. Minor upgrades happen automatically without
needing any involvement from the user.
MariaDB – Support versions for MariaDB from 10.0 to 10.2.
Oracle – Supports version 11g and 12c. You can use the oracle license provided by aws or bring
your own license. The costing for these two are different.
Microsoft SQL Server – Supports version 200t to 2017. Also AWS supports the various editions
like – Enterprise, Standard, Web and Express.
PostgreSQL – Supports version 9 to 11. Can be configured as a multi A-Z deployment with read
replicas.
Amazon Aurora – This is Amazon’s own RDBMS. We will be covering it in a separate tutorial.
Each of these Database software is offered as Software as a Service (saas) by providing following features.
Customization of CPU capacity, Memory allocation and IOPS(Input Output per second) for a
database instance.
Manage software patching, failure and recovery of the RDBMS software without any user
intervention.
Allow manual or automated backup of the database using snapshots. Restore the database from these
snapshots.
Provide high availability by creating a primary and secondary instance which are synchronous. In
case of a failure of primary AWS RDS automatically fails over to secondary.
Put the databases in a virtual private cloud (VPC) and aslo use AWS IAM (Identity and Access
management) service to control access to the databases.
There are two purchase options for AWS RDS service. On-Demand Instances and Reserved
Instances. For on-Demand instance you pay for every hour of usage while for Reserved instance you
make a upfront payment for one year to three period time frame.
For using any Aws service you ned to set up an AWS account. We assume you have set up the AWS
account by following the guide lines mentioned in the Amazon Web Services aws home page.
Below are the preliminary steps to access the RDS services from the console.
Step-1
After logging in to the amazon console, to access the RDS services we need to navigate to the
Amazon RDS home page by searching for RDS in the search box of under the services tag as shown
in the diagram below.
Step-2
On clicking the link above we get the Amazon RDS home page. If it is the first time ever you are
accessing RDS services, then it will show you a screen prompting for creating a database as shown
below.
In case you have already created some RDS resources a summary of that will be available by
scrolling down in the above page. A screen shot is shown below.
Step-3
The next screen gives us an option to select the DB engine we need and that is the start of our
configuration steps for the database we need.
Now we will see the details on each of the industry’s popular database configuration and usage.
Amazon RDS - Interfaces
The RDS interfaces are a way to access the RDS service we create. After the creation and configuration of
the RDS service there is a need of accessing the data, uploading data to this database and running some other
program which should be able to connect to the database. Such requirements of accessing and manipulating
data by end users of the database and not necessarily the AWS account holder which created the database
needs these interfaces.
1.GUI Console
This is the simplest of the interfaces where the user can login through a web browser and start using the
DB services. The down side of such access is , it needs a human to interact with the RDS services and we
cannot run a database program to do some regular tasks like – backup or analysing the DB etc.
2.Command Line Interface
It is also called CLI access where you can execute DB command through the AWS command prompt
screen which should have been installed in the client computer you are using. Below are the steps to install
CLI in your local system using which you will access AWS services.
The steps to install AWS CLI are as below.
Step-4 : Next we configure the aws CLI with credentials. We issue this command and then input the
required values one by one.
aws configure
With the above configuration in place you are now ready to use CLI for communicating with AWS
environments for setting up and using amazon RDS. In the next chapters we will see how we can do that.
3. AWS API
Amazon Relational Database Service (Amazon RDS) also provides an application programming interface
(API). APIs are used when the information is exchanged between the systems rather than a human issuing
the commands and receiving the result. For example, if you want to automate the addition of database
instances to a RDS service when the number of transactions reach certain threshold , then you use a AWS
SDK to write a program which will monitor the number of database transactions and spin-off a RDS
instance when the required condition is met.
Below is an example of API code that creates a copy of a DB snapshot. It is a python program which uses
AWS sdk named boto3. The client library in boto3 has a method named copy_db_snapshot which is called
by the python program to create a copy of the DB snapshot with the required parameters as shown.
import boto3
client = boto3.client('rds')
response = client.copy_db_snapshot(
SourceDBSnapshotIdentifier='mydbsnapshot',
TargetDBSnapshotIdentifier='mydbsnapshot-copy',
)
print(response)
When the above program is run we get the response which describes the various properties of the copy
event. Here the term string represents the various names of parameters which is defined by the user for their
environment. For example VpcID represents the ID of the vpc in which the copy action is happening.
{
'DBSnapshot': {
'DBSnapshotIdentifier': 'string',
'DBInstanceIdentifier': 'string',
'SnapshotCreateTime': datetime(2015, 1, 1),
'Engine': 'string',
'AllocatedStorage': 123,
'Status': 'string',
'Port': 123,
'AvailabilityZone': 'string',
'VpcId': 'string',
'InstanceCreateTime': datetime(2015, 1, 1),
'MasterUsername': 'string',
'EngineVersion': 'string',
'LicenseModel': 'string',
'SnapshotType': 'string',
'Iops': 123,
'OptionGroupName': 'string',
'PercentProgress': 123,
'SourceRegion': 'string',
'SourceDBSnapshotIdentifier': 'string',
'StorageType': 'string',
'TdeCredentialArn': 'string',
'Encrypted': True|False,
'KmsKeyId': 'string',
'DBSnapshotArn': 'string',
'Timezone': 'string',
'IAMDatabaseAuthenticationEnabled': True|False,
'ProcessorFeatures': [
{
'Name': 'string',
'Value': 'string'
},
]
}
}
AWS RDS Security : AWS provides multiple features to provide RDS security
DB instance can be hosted in a VPC for the greatest possible network access control
IAM policies can be used to assign permissions that determine who is allowed to manage RDS resources
Security groups allow controlling what IP addresses or EC2 instances can connect to the databases on a DB
instance
Secure Socket Layer (SSL) connections with DB instances
RDS encryption to secure RDS instances and snapshots at rest.
Network encryption and transparent data encryption (TDE) with Oracle DB instances
Clicking on any of the options would land you on the create database wizard. The first option to select on
this wizard is whether one would like to use the Standard Create option or the Easy Create option. The
Standard Create option provides options to configure and customize all the details to configure the AWS
RDS Aurora cluster, while the Easy Create option uses recommended settings for most of the options.
Advance users generally go with the Standard Create option, which is the default option as well. We will
select this option as we intend to explore all the settings to create the cluster.
The next step is the Engine options. As we intend to create an AWS RDS Aurora cluster, we would select
Amazon Aurora as the Engine. Aurora engine comes in two editions – MySQL compatible and PostgreSQL
compatible. The topology and architecture of Aurora remain native of Aurora, but the database engine
remains compliant with the selected edition. This enables users to use their existing MySQL or PostgreSQL
tools with the Amazon Aurora engine and still benefit from the additional features that Aurora provides on
the top of these database engines. Select the edition of your choice.
The next step is the Database Location. Aurora allows the creation of a Regional database Or a Global
database. As the name suggests, one can create an Aurora database in any single AWS region, whereas the
Global database can span multiple regions. One does not need a global database unless they need their
database existence in multiple geographies or regions. For the demonstration, we would be continuing with
the Regional database.
The next step is to select the database features. There are four options as shown below.
One writer multiple readers – This is the default option, and can be used in general when you have
more reads than writes on your database instance
One writer and multiple readers – Parallel Query – This option is suitable when you have analytical
workloads that may involve large scale data aggregation, complex calculations, and typical
operations of analytical workloads on a massive volume of transactional data
Multiple writers – This option is suitable for use-cases where the database writes are extremely high
in volume compared to reads, and parallel write capacity is required by multiple applications
Serverless – This option is suitable when the database usage is very volatile or unpredictable, and
you need the database capacity to elastically scale with the workloads
After selecting the database feature, the next step is to select the template – whether the database is being
created for production workloads or lower environments. This option sets the default settings of the rest of
the database configuration accordingly. For demo purposes, we can go ahead with Dev/Test template.
In the next step, we need to configure the settings of the database in the Aurora cluster. Provide a name for
the cluster identifier as well as a username and password that would be used to connect to the cluster.
Now we need to select the database instance size. This will determine the compute capacity available to
the database. The Memory-optimized instance class is the default selection. In case if you anticipate
workloads that will have occasional spikes when you need more capacity and for the rest, you need lower
capacities, one can consider burstable classes.
If one needs a high-availability deployment of the cluster, one can create database replicas in multiple
availability zones, which may have an impact on the overall database instance cost as well. In lower
environments like development or test, one can opt to not create a database replica. As we selected the
templates as Dev/Test, the default option for Availability and durability is to not create Aurora Replica.
The next step is to configure network connectivity. One can change the VPC and the subnets, if one does
not want to go with the default option. To access this cluster over the internet, one needs to select the Yes
option for the publicly accessible setting. Alternatively, you can also place this cluster in a private subnet,
and configure the network connectivity over a VPN over other suitable options, to avoid exposing the AWS
RDS aurora cluster on the private subnet.
Security groups control the inbound and outbound traffic over specific ports. While it is possible to choose
an existing security group, there’s also an option to create a new security group just for the AWS RDS
Aurora cluster right through the wizard. We are going to keep all the default values for the network
configuration of this AWS RDS Aurora Cluster. The default database port for Aurora is 3306. One can
change this default port to any desired port number. For this exercise, we are going to keep the default port
number as well.
AWS RDS Aurora cluster supports password-based authentication, as well as password and IAM based
authentication. If one’s entire cloud security is not IAM driven, one can just continue with password-based
authentication which is password authentication.
In the additional configuration section, one can configure the initial database name. This is the database that
would be created in the aurora database and would be treated as the default database.
The next setting is the Backtrack feature. It’s a unique feature that allows us to rewind the data to a
historical point-in-time, without the need to restore a snapshot as a new cluster, and then deleting the
existing cluster..
The next setting is related to monitoring. One can enable enhanced monitoring as well as configure the
time period granularity at which the metrics should be collected. The Log exports section provides an option
to enable different kinds of logs generated in CloudWatch Logs. Depending upon the nature of data and
compliance requirements, one can enable different logs.
The last setting is the maintenance setting, which can be configured to schedule the maintenance window
as well as version upgrades. With this, we have covered all the settings that can be configured to create the
AWS RDS Aurora cluster. Finally, click on the Create database button to create the Aurora cluster.
This will start the creation of the cluster as well as the database, and it would be in an available state in
few minutes generally, as shown below. On the connectivity and security tab, you would find the read-only
and read-write endpoints, which can be used with your existing IDEs that you may be using for MySQL, to
connect to the AWS RDS Aurora cluster.
One can delete this cluster from the Delete menu item from the Actions drop-down as shown below. This
cluster can prove to be costly if kept on for a long duration without any use. Consider deleting this cluster
one the exercise is completed.
In this way, one can create an AWS RDS Aurora Cluster compliant with MySQL or PostgreSQL.
Conclusion
In this section, we learned how to create a brand-new AWS RDS Aurora cluster. We learned almost every
setting that can be configured while creating the cluster from the AWS Console.
ElastiCache is AWS in-memory database solution that makes it easy to deploy, operate, and scale an in-
memory cache in the cloud. It provides faster retrieval of information from fast, managed, in-memory caches
instead of relying entirely on slower disk-based databases, thereby improving the performance of web
applications.
Sign in to the AWS Management Console, and open the ElastiCache console
at https://console.aws.amazon.com/elasticache/.
3. In the Create Subnet Group wizard, do the following. When all the settings are as you want them,
choose Yes, Create
a. In the Name box, type a name for your subnet group
b. In the Description box, type a description for your subnet group
In the VPC ID box, choose the Amazon VPC that you created
c. In the Availability Zone and Subnet ID lists, choose your private subnet’s Availability Zone and
ID, and then select Add
7. Select Create.
8. For Cluster engine, choose Redis. Make sure the Cluster-Mode enabled check box is cleared
9. Complete the remaining based on the requirement
10. Launch an EC2
Note: In the ElastiCache security group the instance security group should be open on port 6379
DB instances replicas can be created in two ways Multi-AZ & Read Replica.
Multi-AZ
Multi-AZ allows you to have an exact copy of your production database in another AZ. AWS handles the
replication for you, so when your production database is written to, this write will automatically be
synchronized to the stand-by database.
In the event of planned database maintenance, DB instance failure, or an AZ failure, RDS will
automatically failover to the stand-by so that database operations can resume quickly without administrative
intervention.
For disaster recovery purposes, a database that's in us-east-1A will automatically replicate over to us-east-
1b. The important thing about this to understand is that you don't deal with IP addresses for this reason. If
us-east-1a fails, AWS automatically switches over to us-east-1b. Since there's no explicit IP address being
referenced in your code (but a DNS instead), the switch is seamless from the application's perspective.
It is important to understand that multi-AZ is for disaster recovery only. It is not for performance
improvements. For improving performance, you need read replicas.
Multi-AZ Databases
SQL Server
Oracle
MySQL
PostgreSQL
MariaDB
Read Replicas
Read replicas allow you to have a read-only copy of your production database. This is achieved by using
Asynchronous replication from the primary RDS instance to the read replica. You use read replicas
primarily for very read-heavy database workloads.
MySQL
PostgreSQL
MariaDB
Aurora