Database
Services
RDS DynamoDB Redshift Elasticache
Nagesh Ramamoorthy
RDS
• RDS features
• DB Instances
• High Availability ( Multi-AZ)
• Read Replicas
• Parameter Groups
• Backup & Restore
• Monitoring
• RDS Security
RDS
Amazon Relational Database
Service (Amazon RDS) is a web
service that makes it easier to set
up, operate, and scale a relational
database in the cloud.
It provides cost-efficient, resizable
capacity for an industry-standard
relational database and manages
common database administration
tasks
RDS features
• When you buy a server, you get CPU, memory, storage, and IOPS, all bundled together. With Amazon RDS, these
are split apart so that you can scale them independently
• Amazon RDS manages backups, software patching, automatic failure detection, and recovery.
• To deliver a managed service experience, Amazon RDS doesn't provide shell access to DB instances
• You can have automated backups performed when you need them, or manually create your own backup snapshot.
• You can get high availability with a primary instance and a synchronous secondary instance that you can fail over to
when problems occur
• You can also use MySQL, MariaDB, or PostgreSQL Read Replicas to increase read scaling.
• In addition to the security in your database package, you can help control who can access your RDS databases by
using AWS Identity and Access Management (IAM)
• Supports the popular engines : MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server, and the new, MySQL-
compatible Amazon Aurora DB engine
DB instances
• The basic building block of Amazon RDS is the DB
instance
• A DB instance can contain multiple user-created
databases, and you can access it by using the same
tools and applications that you use with a stand-
alone database instance
• Each DB instance runs a DB engine. Amazon RDS
currently supports the MySQL, MariaDB,
PostgreSQL, Oracle, and Microsoft SQL Server DB
engines
• When creating a DB instance, some database
engines require that a database name be specified.
• Amazon RDS creates a master user account for your
DB instance as part of the creation process
DB instance
Class
• The DB instance class determines the computation
and memory capacity of an Amazon RDS DB
instance
• Amazon RDS supports three types of instance
classes: Standard, Memory Optimized, and
Burstable Performance.
• DB instance storage comes in three types: Magnetic,
General Purpose (SSD), and Provisioned IOPS
(PIOPS).
Standard DB instance classes : db.m4,db.m3, db.m1
Memory Optimized DB instance classes: db.r4, db.r3,
Burstable Performance DB instance class: db.t2
High Availability (Multi-AZ)
• Amazon RDS provides high availability and failover support
for DB instances using Multi-AZ deployments
• In a Multi-AZ deployment, Amazon RDS automatically
provisions and maintains a synchronous standby replica in a
different Availability Zone
• The high-availability feature is not a scaling solution for read-
only scenarios; you cannot use a standby replica to serve read
traffic.
• DB instances using Multi-AZ deployments may have increased
write and commit latency compared to a Single-AZ
deployment
Failover Process for Amazon RDS
• In the event of a planned or unplanned outage of your DB instance, RDS
automatically switches to a standby replica in another Availability Zone
• Failover times are typically 60-120 seconds. However, large transactions or a
lengthy recovery process can increase failover time
• The failover mechanism automatically changes the DNS record of the DB instance
to point to the standby DB instance
• As a result, you need to re-establish any existing connections to your DB instance.
Failover Cases
• The primary DB instance switches over automatically to the standby replica if any of the
following conditions occur:
o An Availability Zone outage
o The primary DB instance fails
o The DB instance's server type is changed
o The operating system of the DB instance is undergoing software patching
o A manual failover of the DB instance was initiated using Reboot with failover
Read Replicas
You can reduce the load on your source DB instance by routing read queries from your applications to the Read
Replica
Amazon RDS takes a snapshot of the source instance and creates a read-only instance from the snapshot
Amazon RDS then uses the asynchronous replication method for the DB engine to update the Read Replica whenever
there is a change to the source DB instance
The Read Replica operates as a DB instance that allows only read-only connections.
Applications connect to a Read Replica the same way they do to any DB instance
you must enable automatic backups on the source DB instance
Read Replica Use cases
• Scaling beyond the compute or I/O capacity of a single DB instance for
read-heavy database workloads
• Serving read traffic while the source DB instance is unavailable.
• Business reporting or data warehousing scenarios where you might want
business reporting queries to run against a Read Replica
Cross Region Replication
You can create a MySQL, PostgreSQL, or MariaDB Read
Replica in a different AWS Region :
o Improve your disaster recovery capabilities
o Scale read operations into an AWS Region closer to
your users
o Make it easier to migrate from a data center in one
AWS Region to a data center in another AWS Region
DB Parameter Group
You manage your DB engine configuration through the use of parameters in a DB
parameter group
DB parameter groups act as a container for engine configuration values that are
applied to one or more DB instances
A default DB parameter group is created if you create a DB instance without
specifying a customer-created DB parameter group
This default group contains database engine defaults and Amazon RDS system
defaults based on the engine, compute class, and allocated storage of the instance
Modifying
Parameter
Group
You cannot modify the parameter settings of a
default DB parameter group
you must create your own DB parameter group to
change parameter settings from their default value
When you change a dynamic parameter and save the
DB parameter group, the change is applied
immediately
When you change a static parameter and save the DB
parameter group, the parameter change will take
effect after you manually reboot the DB instance
When you change the DB parameter group
associated with a DB instance, you must manually
reboot the instance
Backup and Restore
• Amazon RDS creates a storage volume snapshot of your DB instance, backing up the
entire DB instance and not just individual databases
• Amazon RDS saves the automated backups of your DB instance according to the backup
retention period that you specify
• If necessary, you can recover your database to any point in time during the backup
retention period
• You can also backup your DB instance manually, by manually creating a DB snapshot
• All automated backups are deleted when you delete a DB instance.
• Manual snapshots are not deleted
Backup
Window
Automated backups occur daily during the preferred backup window
The backup window can't overlap with the weekly maintenance window
for the DB instance
I/O activity is not suspended on your primary during backup for Multi-AZ
deployments, because the backup is taken from the standby
If you don't specify a preferred backup window when you create the DB
instance, Amazon RDS assigns a default 30-minute backup window
You can set the backup retention period to between 1 and 35 days
An outage occurs if you change the backup retention period from 0 to a
non-zero value or from a non-zero value to 0
Monitoring
You can use the following automated monitoring tools to watch Amazon RDS and
report when something is wrong:
o Amazon RDS Events
o Database log files
o Amazon RDS Enhanced Monitoring
RDS Security
Various ways you can secure RDS:
• Run your DB instance in an Amazon Virtual Private Cloud
(VPC)
• Use AWS Identity and Access Management (IAM) policies to
assign permissions that determine who is allowed to
manage RDS resources
• Use security groups to control what IP addresses or Amazon
EC2 instances can connect to your databases on a DB
instance
• Use Secure Socket Layer (SSL) connections with DB instances
• Use RDS encryption to secure your RDS instances and
snapshots at rest.
• Use the security features of your DB engine to control who
can log in to the databases on a DB instance
DynamoDB
DynamoDB is a fully managed
NOSQL database , designed for
massive scale with predictable
performance goals
DynamoDB Features
• Every table in DynamoDB should be associated with a primary key (To be specified while creation)
• Any language of choice can be used to create , insert, update, query, scan(entire table) and delete
operations on a dynamo table using appropriate API
• Each Row/record in a table is called an "item“
• DynamoDB allows to set TTL for individual items in a table to delete the items automatically on
expiration
• The table data is stored in SSD disks and spread across multiple servers across different AZ in a
region for faster performance, high availability and data durability
• The tables are schema less, except for the primary key , there is no requirements of the number
and type of attributes
• DynamoDB offers encryption at rest
Read
Consistency
Strongly Consistent Reads
When you request a strongly consistent read, DynamoDB returns a response with
the most up-to-date data, reflecting the updates from all prior write operations
that were successful.
Eventually Consistent Reads
When you read data from a DynamoDB table, the response might not reflect the
results of a recently completed write operation. The response might include
some stale data.
DynamoDB supports eventually consistent and
strongly consistent reads. DynamoDB uses eventually
consistent reads, unless you specify otherwise.
Throughput Capacity
• When you create a table or index in Amazon DynamoDB, you must specify your
capacity requirements for read and write activity
• You specify throughput capacity in terms of read capacity units and write capacity
units:
• One read capacity unit(RCU) represents one strongly consistent read per
second, or two eventually consistent reads per second, for an item up to 4 KB
in size.
• One write capacity unit (WCU) represents one write per second for an item
up to 1 KB in size.
DynamoDB
Autoscaling
DynamoDB auto scaling actively manages
throughput capacity for tables and global
secondary indexes.
With auto scaling, you define a range (upper
and lower limits) for read and write capacity
units.
If you use the AWS Management Console to
create a table or a global secondary index,
DynamoDB auto scaling is enabled by default
You can manage auto scaling settings at any
time by using the console, the AWS CLI, or
one of the AWS SDKs.
AWS RedShift
AWS redshift is:
• Simple( to get started , to scale)
• Fast ( Using the latest DW architectures) ,
• Fully managed (To patch , to backup and fault
tolerant)
• Petabyte scale ( Upto 2 PB ) datawarehouse service
• Based on PostGreSQL.
• Secure ( SSL on transit, encryption on rest , within
VPC , no access to compute nodes )
• Compatible with various industry BI tools using
JDBC/ODBC connectivity
RedShift Features
AWS redshift uses Massively parallel processing (MPP) architecture, columnar storage, data compression and zone mapping for faster query
performance on data sets.
Hardware is optimized for large data processing with features of locally attached storage devices , 10gig mesh network and 1 MB of block size
There are two types of nodes that can be selected in a redshift cluster
1) DS2 node types are optimized for large data workloads and use hard disk drive (HDD) storage, 2) DC2 nodes uses SSD disks
Node size and the number of nodes determine the total storage for a cluster
All the cluster nodes are created in the same AZ of a region
There are two types of monitoring metrics produced every minute ie 1) cloud watch metrics 2) query performance metrics which is not
published to cloudwatch
The automated snapshots backups are taken usually every 8 hours or every 5 GB of data change
Elasticache
• Elasticache is a distributed memory cache system /
data store
• There are two engines supported : Redis ,
Memcached
• Three main methods of how to cache: Lazy
Population, Wite through , Timed refresh ( TTL)
Memcached
Memcached is a "Gold Standard“
Memcached is simple to use , multithreaded
Memcached clusters are made of 1 to 20 nodes and
maximum 100 nodes in a region
Horizontal scaling in Memcached is easy and it is just
about adding or removing the nodes
Vertical scaling in Memcached would create a new
cluster with empty data
Backup / restore capability and replication features
are available only with Redis
Redis
Redis is single-threaded
Redis has two flavors : Cluster mode disabled( Only one shard)
and cluster mode enabled ( one to 15 shards)
A Redis Shard ( node group) can have 1 to 6 nodes with the
replication option of one node primary and other read replicas
Read replicas of Redis are synced asynchronously
Multi-AZ with Autorecovery is enabled by default for Redis
cluster with cluster mode enabled
Backups are stored in S3 with 0 to 35 days retention period.

AWS database services

  • 1.
    Database Services RDS DynamoDB RedshiftElasticache Nagesh Ramamoorthy
  • 2.
    RDS • RDS features •DB Instances • High Availability ( Multi-AZ) • Read Replicas • Parameter Groups • Backup & Restore • Monitoring • RDS Security
  • 3.
    RDS Amazon Relational Database Service(Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks
  • 4.
    RDS features • Whenyou buy a server, you get CPU, memory, storage, and IOPS, all bundled together. With Amazon RDS, these are split apart so that you can scale them independently • Amazon RDS manages backups, software patching, automatic failure detection, and recovery. • To deliver a managed service experience, Amazon RDS doesn't provide shell access to DB instances • You can have automated backups performed when you need them, or manually create your own backup snapshot. • You can get high availability with a primary instance and a synchronous secondary instance that you can fail over to when problems occur • You can also use MySQL, MariaDB, or PostgreSQL Read Replicas to increase read scaling. • In addition to the security in your database package, you can help control who can access your RDS databases by using AWS Identity and Access Management (IAM) • Supports the popular engines : MySQL, MariaDB, PostgreSQL, Oracle, Microsoft SQL Server, and the new, MySQL- compatible Amazon Aurora DB engine
  • 5.
    DB instances • Thebasic building block of Amazon RDS is the DB instance • A DB instance can contain multiple user-created databases, and you can access it by using the same tools and applications that you use with a stand- alone database instance • Each DB instance runs a DB engine. Amazon RDS currently supports the MySQL, MariaDB, PostgreSQL, Oracle, and Microsoft SQL Server DB engines • When creating a DB instance, some database engines require that a database name be specified. • Amazon RDS creates a master user account for your DB instance as part of the creation process
  • 6.
    DB instance Class • TheDB instance class determines the computation and memory capacity of an Amazon RDS DB instance • Amazon RDS supports three types of instance classes: Standard, Memory Optimized, and Burstable Performance. • DB instance storage comes in three types: Magnetic, General Purpose (SSD), and Provisioned IOPS (PIOPS). Standard DB instance classes : db.m4,db.m3, db.m1 Memory Optimized DB instance classes: db.r4, db.r3, Burstable Performance DB instance class: db.t2
  • 7.
    High Availability (Multi-AZ) •Amazon RDS provides high availability and failover support for DB instances using Multi-AZ deployments • In a Multi-AZ deployment, Amazon RDS automatically provisions and maintains a synchronous standby replica in a different Availability Zone • The high-availability feature is not a scaling solution for read- only scenarios; you cannot use a standby replica to serve read traffic. • DB instances using Multi-AZ deployments may have increased write and commit latency compared to a Single-AZ deployment
  • 8.
    Failover Process forAmazon RDS • In the event of a planned or unplanned outage of your DB instance, RDS automatically switches to a standby replica in another Availability Zone • Failover times are typically 60-120 seconds. However, large transactions or a lengthy recovery process can increase failover time • The failover mechanism automatically changes the DNS record of the DB instance to point to the standby DB instance • As a result, you need to re-establish any existing connections to your DB instance.
  • 9.
    Failover Cases • Theprimary DB instance switches over automatically to the standby replica if any of the following conditions occur: o An Availability Zone outage o The primary DB instance fails o The DB instance's server type is changed o The operating system of the DB instance is undergoing software patching o A manual failover of the DB instance was initiated using Reboot with failover
  • 10.
    Read Replicas You canreduce the load on your source DB instance by routing read queries from your applications to the Read Replica Amazon RDS takes a snapshot of the source instance and creates a read-only instance from the snapshot Amazon RDS then uses the asynchronous replication method for the DB engine to update the Read Replica whenever there is a change to the source DB instance The Read Replica operates as a DB instance that allows only read-only connections. Applications connect to a Read Replica the same way they do to any DB instance you must enable automatic backups on the source DB instance
  • 11.
    Read Replica Usecases • Scaling beyond the compute or I/O capacity of a single DB instance for read-heavy database workloads • Serving read traffic while the source DB instance is unavailable. • Business reporting or data warehousing scenarios where you might want business reporting queries to run against a Read Replica
  • 12.
    Cross Region Replication Youcan create a MySQL, PostgreSQL, or MariaDB Read Replica in a different AWS Region : o Improve your disaster recovery capabilities o Scale read operations into an AWS Region closer to your users o Make it easier to migrate from a data center in one AWS Region to a data center in another AWS Region
  • 13.
    DB Parameter Group Youmanage your DB engine configuration through the use of parameters in a DB parameter group DB parameter groups act as a container for engine configuration values that are applied to one or more DB instances A default DB parameter group is created if you create a DB instance without specifying a customer-created DB parameter group This default group contains database engine defaults and Amazon RDS system defaults based on the engine, compute class, and allocated storage of the instance
  • 14.
    Modifying Parameter Group You cannot modifythe parameter settings of a default DB parameter group you must create your own DB parameter group to change parameter settings from their default value When you change a dynamic parameter and save the DB parameter group, the change is applied immediately When you change a static parameter and save the DB parameter group, the parameter change will take effect after you manually reboot the DB instance When you change the DB parameter group associated with a DB instance, you must manually reboot the instance
  • 15.
    Backup and Restore •Amazon RDS creates a storage volume snapshot of your DB instance, backing up the entire DB instance and not just individual databases • Amazon RDS saves the automated backups of your DB instance according to the backup retention period that you specify • If necessary, you can recover your database to any point in time during the backup retention period • You can also backup your DB instance manually, by manually creating a DB snapshot • All automated backups are deleted when you delete a DB instance. • Manual snapshots are not deleted
  • 16.
    Backup Window Automated backups occurdaily during the preferred backup window The backup window can't overlap with the weekly maintenance window for the DB instance I/O activity is not suspended on your primary during backup for Multi-AZ deployments, because the backup is taken from the standby If you don't specify a preferred backup window when you create the DB instance, Amazon RDS assigns a default 30-minute backup window You can set the backup retention period to between 1 and 35 days An outage occurs if you change the backup retention period from 0 to a non-zero value or from a non-zero value to 0
  • 17.
    Monitoring You can usethe following automated monitoring tools to watch Amazon RDS and report when something is wrong: o Amazon RDS Events o Database log files o Amazon RDS Enhanced Monitoring
  • 18.
    RDS Security Various waysyou can secure RDS: • Run your DB instance in an Amazon Virtual Private Cloud (VPC) • Use AWS Identity and Access Management (IAM) policies to assign permissions that determine who is allowed to manage RDS resources • Use security groups to control what IP addresses or Amazon EC2 instances can connect to your databases on a DB instance • Use Secure Socket Layer (SSL) connections with DB instances • Use RDS encryption to secure your RDS instances and snapshots at rest. • Use the security features of your DB engine to control who can log in to the databases on a DB instance
  • 19.
    DynamoDB DynamoDB is afully managed NOSQL database , designed for massive scale with predictable performance goals
  • 20.
    DynamoDB Features • Everytable in DynamoDB should be associated with a primary key (To be specified while creation) • Any language of choice can be used to create , insert, update, query, scan(entire table) and delete operations on a dynamo table using appropriate API • Each Row/record in a table is called an "item“ • DynamoDB allows to set TTL for individual items in a table to delete the items automatically on expiration • The table data is stored in SSD disks and spread across multiple servers across different AZ in a region for faster performance, high availability and data durability • The tables are schema less, except for the primary key , there is no requirements of the number and type of attributes • DynamoDB offers encryption at rest
  • 21.
    Read Consistency Strongly Consistent Reads Whenyou request a strongly consistent read, DynamoDB returns a response with the most up-to-date data, reflecting the updates from all prior write operations that were successful. Eventually Consistent Reads When you read data from a DynamoDB table, the response might not reflect the results of a recently completed write operation. The response might include some stale data. DynamoDB supports eventually consistent and strongly consistent reads. DynamoDB uses eventually consistent reads, unless you specify otherwise.
  • 22.
    Throughput Capacity • Whenyou create a table or index in Amazon DynamoDB, you must specify your capacity requirements for read and write activity • You specify throughput capacity in terms of read capacity units and write capacity units: • One read capacity unit(RCU) represents one strongly consistent read per second, or two eventually consistent reads per second, for an item up to 4 KB in size. • One write capacity unit (WCU) represents one write per second for an item up to 1 KB in size.
  • 23.
    DynamoDB Autoscaling DynamoDB auto scalingactively manages throughput capacity for tables and global secondary indexes. With auto scaling, you define a range (upper and lower limits) for read and write capacity units. If you use the AWS Management Console to create a table or a global secondary index, DynamoDB auto scaling is enabled by default You can manage auto scaling settings at any time by using the console, the AWS CLI, or one of the AWS SDKs.
  • 24.
    AWS RedShift AWS redshiftis: • Simple( to get started , to scale) • Fast ( Using the latest DW architectures) , • Fully managed (To patch , to backup and fault tolerant) • Petabyte scale ( Upto 2 PB ) datawarehouse service • Based on PostGreSQL. • Secure ( SSL on transit, encryption on rest , within VPC , no access to compute nodes ) • Compatible with various industry BI tools using JDBC/ODBC connectivity
  • 25.
    RedShift Features AWS redshiftuses Massively parallel processing (MPP) architecture, columnar storage, data compression and zone mapping for faster query performance on data sets. Hardware is optimized for large data processing with features of locally attached storage devices , 10gig mesh network and 1 MB of block size There are two types of nodes that can be selected in a redshift cluster 1) DS2 node types are optimized for large data workloads and use hard disk drive (HDD) storage, 2) DC2 nodes uses SSD disks Node size and the number of nodes determine the total storage for a cluster All the cluster nodes are created in the same AZ of a region There are two types of monitoring metrics produced every minute ie 1) cloud watch metrics 2) query performance metrics which is not published to cloudwatch The automated snapshots backups are taken usually every 8 hours or every 5 GB of data change
  • 26.
    Elasticache • Elasticache isa distributed memory cache system / data store • There are two engines supported : Redis , Memcached • Three main methods of how to cache: Lazy Population, Wite through , Timed refresh ( TTL)
  • 27.
    Memcached Memcached is a"Gold Standard“ Memcached is simple to use , multithreaded Memcached clusters are made of 1 to 20 nodes and maximum 100 nodes in a region Horizontal scaling in Memcached is easy and it is just about adding or removing the nodes Vertical scaling in Memcached would create a new cluster with empty data Backup / restore capability and replication features are available only with Redis
  • 28.
    Redis Redis is single-threaded Redishas two flavors : Cluster mode disabled( Only one shard) and cluster mode enabled ( one to 15 shards) A Redis Shard ( node group) can have 1 to 6 nodes with the replication option of one node primary and other read replicas Read replicas of Redis are synced asynchronously Multi-AZ with Autorecovery is enabled by default for Redis cluster with cluster mode enabled Backups are stored in S3 with 0 to 35 days retention period.