Databases on AWS, this article will help you in understanding database services available in AWS environment and how that can be useful. This article can be used as quick guide for those people who are preparing for AWS solutions architect exam
Amazon RDS (Relational Database Service)
RDS is used for online transaction processing (OLTP) comes in six different flavors
In terms of RDS just remember the following points
- RDS runs on virtual machines
- You cannot SSH into these operating systems
- you cannot RDP using Windows and you can’t SSH to your Linux operating systems and that is a really important point to remember for your exams
- Patching of the RDS operating system and database itself is always going to be Amazon’s responsibility because you do not get operating system level access.
- Remember that RDS is not serverless. However, there’s an exception to the rule Aurora is serverless.
Two different types of backups for AWS RDS are
- Automated backups
- Database snapshots
RDS – Read Replicas
- Read replicas can be multi-AZ
- They are primarily used to increase performance.
- This is a very common exam scenario. You have got a struggling database, which is having very heavy read traffic. Maybe it’s a WordPress blog or something like that. How do you increase the performance on that database? And one of the answers is add read replicas and to point your EC2 instances to those read replicas
- To enable read replicas you must have backups turned on
- Read replicas can be in different regions as well as the same regions. You can have read replicas around different regions in the world
- And read replicas can be MySQL, PostgreSQL, MariaDB, Oracle and Aurora. The only database engine or RDS engine that doesn’t support read replicas at this time is SQL server.
- Read replicas can be promoted to a master but when you do this it’s going to break the read replica, so it’s going to break the replication
RDS – To be remember
- Multi-AZ is not used for performance and you can force a failover from one availability zone to another by rebooting the RDS instance.
- Encryption is supported for MySQL, Oracle, SQL Server, PostgreSQL, MariaDB and Aurora.
- AWS KMS (Key Management Service) is used for encryption. Once your RDS instance is encrypted, the data stored at rest in the underlying storage is going to be encrypted as well as when you do automated backups, read replicas and snapshots also going to be encrypted as well.
- DynamoDB is Amazon’s NoSQL database solution. It is the opposite of RDS.
- Amazon DynamoDB is a fast and reliable NoSQL database service for all applications that require consistent single digit millisecond latency at any scale.
- DynamoDB is a fully managed database service and it supports both document and key value data models.
- Amazon DynamoDB features a flexible data model and reliable performance that creates a great fit for mobile, Web, gaming ad-tech, IOT and lots of other applications.
Basics of DynamoDB
DynamoDB is stored on SSD storage so that’s why it is so fast. It is spread across three different geographically distinct data centers.
It has two different types of Reads models
- Eventually consistent reads (default)
- Strongly consistent reads
What is the difference between eventual consistent reads and strongly consistent reads?
Eventual consistent reads
In case of eventually consistent reads, consistency across all copies of application data is usually reached within one second.
This will give you the best read performance. And this is enabled by default.
Strongly consistent reads
However, if you have an application that writes to a DynamoDB table and it needs to read that data within or less than one second then you want strongly consistent reads and this will basically return a result that reflects all writes that received a successful response prior to the read.
So again the one second rule so long as your application is happy that it doesn’t need to read that data that’s been written within one second. Then you want eventually consistent reads.
However if you’ve got an application that needs to as soon as an update has been done to a DynamoDB table and that application needs to read that update in one second or less then you’re going to want strongly consistent reads
So just remember the one second rule for DynamoDB
Databases on AWS: Amazon Redshift
- AWS Redshift is a data warehousing solution and this is used for online analytics processing
- Redshift is used for business intelligence.
- It’s only available in one availability zone right now.
- When you are doing backups, Redshift has backups enabled by default with a one day retention period just like with RDS. You can extend this retention period to 35 days
- Redshift will always attempt to maintain at least 3 copies of data. The original and replica on the compute nodes as well as a backup in Amazon S3.
- For disaster recovery, AWS Redshift can also asynchronously replicate snapshots to S3 in another region.
- Click here to read details about Redshift
Databases on AWS: Aurora
- 2 copies of data are contained in each availability zone (AZ) with a minimum of 3 Availability Zones. You are always going to have six copies of your data.
- The snapshots of AWS Aurora can be shared with other AWS accounts
- There are three different types of replicas available. Aurora, MySQL, and PostgreSQL replicas.
- Automated failover is only available with Aurora replicas.
- Remember that Aurora has automated backups turned on by default and you can also take snapshots with Aurora.
- Use Aurora services, if you want a simple cost-effective option for infrequent, intermittent, or unpredictable workloads.
Databases on AWS: Amazon Elasticache
Basically, it is a web service that makes it easy to deploy operate, and scale in-memory caching within the cloud and this service improves the performance of Web applications by allowing the user to retrieve data from managed in-memory caches instead of relying on slower disk space databases
Elasticache supports two open source caching engines:
Memcached vs Redis
|Simple cache to offload DB||Yes||Yes|
|Ability to scale horizontally||Yes||Yes|
|Advance data type||No||Yes|
|Sorting/Ranking data sets||No||Yes|
|Multi – AZ||No||Yes|
|Backup and Restore capabilities||No||Yes|