Vous êtes sur la page 1sur 4

Databases on AWS

Notes:

Relational databases are not good for modern web applications due to their ability to only be able to
vertically scale (CPU, RAM, etc.) instead of scale horizontally scale. You can think of this database as an
Excel Spreadsheet

No-SQL databases are able to scale horizontally because to can scale out the cluster by adding more
nodes to it.

A relational database has the advantage of using a well-known SQL Query Language where as a No-SQL
database you are many times forced to use the proprietary API is for the database engines.

Relational databases are designed for the data to be normalized across many tables and then join the
tables together while no-SQL databases allow for a flat table structure and don’t need to merge any
tables together.

Relations databases are ACID compliant (Atomicity, Consistency, Isolation, Durability) this is good for
rolling back on transactions within relational databases.

Even though you can’t traditionally scale horizontally with a relational database you can still add read
replicas which allows to take the load off of a read intensive application by adding a limited number of
read replicas to handle the read operations. It does this by making read only copies of the primary
databases and allowing the webserver or any other specified EC2 instance to strictly read from these
read replicas thus off-loading the primary database. You can have a total of 5 read replicas per primary
DB and you are allowed to have read replicas of your read replicas but you will experience replication
lag. You need to have automatic backups turned on in order to use this feature. Remember that each
RR (read replica) will have its own DNS endpoint, you can have RR’s that have Multi-AZ and RR’s in a
different region as well as the ability to encrypt RR’s. Last but not least RR’s can be promoted to be their
own primary DB thus, however, breaking the existing replication. Read Replica Db is currently available
on:

 MySQL Server
 PostgerSQL
 MariaDB
 Aurora
This is different than Multi AZ as Multi AZ is used more for added reliability and creating a highly
available database by having an ELB with EC2 instances behind it being replicated at 2 AZ’s (availability
zones) Simultaneously, thus making it the perfect option for Disaster Recovery. Multi-AZ can be
triggered by DB Instance failure, AZ failure, or a planned database maintenance. Multi AZ is currently
available with:

 SQL Server
 Oracle
 MySQL Server
 PostgerSQL
 MariaDB

Aurora, currently has it built in, being a managed service by AWS.

The two main types of relational databases are OLAP and OLTP

OLTP: This is optimized for inserts and updates and things like that.

OLAP: This is optimized for reporting purposes or queries

Relational databases can be both OLAP and OLTP but are usually optimized for one over the other.

COMMON OLTP databases are:

 Oracle
 SQL-server
 MySQL
 PostgreSQL

Data warehouses are usually OLAP usually used for running queries against data, when it comes to very
large data sets in a data warehouse and getting results extremely quickly.

There are four types of No-SQL databases

 Column – stores data in columns instead of rows for faster queries


 Key value – Simple databases storing data as keys and value assigned to those given keys
 Document – Its optimized for storing J-son or XML documents
 Graph – used for social media applications its optimized for storing data elements and the
relation between those elements

Common No-SQL databases are:

 MongoDB
 CouchDB
 HBase
 Cassandra
 Riak

It’s important to be able to distinguish the types of databases and their use cases

Amazon RDS is a service that covers OLTP with relational databases. Its engines are:

 Oracle
 SQL-server
 MySQL
 PostgreSQL
 Aurora

Amazon redshift is a service that covers OLAP with a data warehouse optimized for analytics

No-SQL databases are used for high transaction rates and horizontal scaling each engine as the following
use case:

DynamoDB: document database

ElastiCache: key Value in memory database that runs Memcached or Redis

Amazon Neptune: Graph database for social media

HBase on EMR(Elastic Map reduce): No-SQL column database that runs on EMR

There are two type of Backups:

 Automated: You can recover your database to any point in past time and has a retention period
of between 1 and 35 days. These take a full daily snapshots while also storing transaction logs
throughout the day. During recovery AWS will automatically choose the most recent backup
stored and apply transaction logs relevant to that day. This means the ability to perform a point
in time recovery down to the second as long as it is within the retention period timeframe.
These are enabled by default and all the backup data is being stored in S3 with free storage
spaces equal to the size of your Database. There is a defined window when backups occur and
this is important to note because your storage I/O may be suspended and you may experience
increased latency. Make sure to specify your backup windows during non-peak/ offline hours.

 DB Snapshots: These are user imitated backups in which you take a snapshot during a specific
point in time. These snapshots will persist even with the RDS Instance has been deleted unlike
the automated backups.
It’s important to note that the restoration of either the Automated or the DB Snapshot backup will
result in a new RDS Instance with a new DNS Endpoint

Encrypting Databases:

RDS Encryption at rest is currently supported for MySQL, Oracle, SQL Server, PostreSQL, MariaDB &
Aurora. This is done by using AWS Key Management service (KMS). Once the RDS instance is encrypted
the data in the data stored at rest in the underlying storage, automated backups, read replicas and
snapshots are also encrypted.

You can only encrypt an existing DB Instance by creating a snapshot of that instance, make a copy of it,
and then encrypt that copy.

Vous aimerez peut-être aussi