AWS - Relational Database Service (RDS)


What is data warehousing?

  • Used for business intelligence tools like Cognos, Jaspersoft etc.
  • Used to pull very large and complex data sets. Usually used by management to do queries on data (such as current performance vs target etc.)


What is Elastic Cache?

  • Elastic cache is web service that makes it easy to deploy, operate, and scale an in-memory cache in the cloud. 
  • The service improves the performance of web applications by allowing you to retrieve information from fast, managed, in-memory caches, instead of relying entirely on slower disk-based databases.
  • Can be used to improve throughput of read heavy applications.
  • Elastic cache supports two open-source in-memory caching engines:
    • Memcached
      • A widely adopted memory object caching system.
      • Elasticache is protocol compliant with Memcached, so existing tools of memcached will work seamlessly with Elasticache.
    • Redis
      • Popular open-source in-memory key-value store that supports data structures such as sets and lists.
      • Elasticache supports master/slave replication and Multi-AZ which can be used to achieve cross AZ redundancy.
  • Elasticache is a good choice if your database is read heavy and not prone to frequent changes.
  • Redshift is good answer if your database is stressed because management keeps running OLAP transactions on it.

AWS supported datatypes:

  • RDS - OLTP
    • SQL server
    • MySQL
    • Postgres
    • Oracle
    • Aurora
    • MariaDB
  • DynamoDB - No SQL
  • Redshift - OLAP
  • Elastic Cache - In-memory caching.

Database Backups:
  • There are two types of backups: Automated backups and Database Snapshot
  • Automated backups allows you to recover your database to any point in time within a retention period. The retention period can be between 1 and 35 days. Automated backups take a full daily snapshot of the database and also store the transaction logs throughout the day. When a restore is done, the latest snapshot is restored and transaction logs are re-applied to the snapshot. This allows to recover to any point in time.
  • Automated backups are enabled by default.
  • Automated backups are deleted if you delete the original database instance.
  • The backup data is stored in S3 and you get free storage equal to size of your database.
  • Backups are taken within a defined window. During the backup storage I/O may be suspended while your data is being backed up, and you may experience elevated latency.
  • DB Snapshots are done manually (i.e. they are user initiated). They are stored even after you delete the original database instance, unlike automated backups.
  • Whenever you restore either an Automated backup or Snapshot, the restored DB will be a new instance with new access URL.
Encryption:
  • Encryption at rest is supported for MySQL, Oracle, SQL Server, Postgres, MariaDB and Aurora. Encryption is done using AWS Key Management Service. Once your RDS instance is encrypted, the data stored at rest in the underlying storage is encrypted, as are its automated backups, read replicas and snapshots.
  • At the present, encrypting an existing instance is not supported. To encrypt a running instance, you must first create a Snapshot, make a copy of that snapshot and encrypt the copy.
Multi AZ (Availability Zone)
  • Supported for SQL Server, Oracle, Mysql, Postgres, MariaDB.
  • Multi-AZ allows you to have an exact copy of your database in another Availability Zone. AWS handles the replication for you, so when your production database is written to, the write will be automatically synchronized to standby database.
  • In the event of a planned database maintenance, DB instance failure or an AZ failure, Amazon RDS will automatically failover to the standby so that database operations can resume quickly without administrative interference. 
  • Multi-AZ is used for disaster recovery only. It can not be used to improve performance, for that you use read replicas.
Read Replica:
  • Read replica 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 replica primarily for read-heavy database workload.
  • Supported databases: Mysql, Postgres, MariaDB, Aurora.
  • Used for scaling not disaster recovery.
  • Must have automated backup turned-on in order to deploy read replica.
  • You can have upto 5 read replica copies of any database.
  • You can have read replicas of read replicas (but watchout for latency).
  • Each read replica will its own DNS endpoint.
  • You can have read replicas that have multi AZ
  • You can create read replicas of multi AZ source database.
  • Read replicas can be promoted to be their own databases. This breaks replication.
  • You can have a read replica in another region.
Aurora:
  • Aurora is MySQL compatible relational database engine.
  • Aurora provides up to 5 times better performance than MySQL.
  • Aurora starts with 10GB  and scales in 10GB increments to 64TB (Storage autoscaling)
  • Compute resources can scale upto 32 vCPUs and 244 GB of memory.
  • 6 copies of data are maintained. 3 AZs with 2 copies each.
  • Aurora is designed to transparently handle the loss of upto 2 copies of data without affecting write availability and upto 3 copies without affecting read availability.
  • Aurora storage is self healing. Data blocks and disks are continuously scanned for errors and repaired automatically.
  • Two types of replicas are available:
    • Aurora Replicas (currently 15)
    • MySQL replicas (currently 5)

0 comments:

Post a Comment