RDS Flashcards
How many read replicas can you have in Aurora?
you can have 15 replicas, while MySQL has five. The replication process is faster.
How Aurora ensures high availability?
there are 6 copies of your data across 3 AZ.
- 4 copies out of 6 needed for writes
- 3 copies out of 6 needed for reads
- self-healing with peer-to-peer replication
What’s the advantage of using RDS over deploying databases on EC2?
- Automated provisioning, OS patching
- Continuous backups and restore to specific timestamp (Point in Time Restore)!
- Monitoring dashboards
- Read replicas for improved read performance
- Multi-AZ setup for DR (Disaster Recovery)
- Maintenance windows for upgrades
- Scaling capability (vertical and horizontal)
- Storage backed by EBS (gp2 or io1)
- Automated Backup
But you cannot SSH into the instance.
What is storage autoscaling in RDS?
RDS storage autoscaling helps you increase the storage on your DB instance dynamically. When RDS detects you are running out of free database storage, it scales automatically. You have to set the maximum storage threshold so your database does not grow infinitely. This is useful for applications with unpredictable workloads.
How many read replicas can be there in RDS?
There can be up to 5 read replicas
Can RDS read replicas be in the same AZ?
The replicas can be within the same AZ, cross AZ or cross-region
Are replicas in-sync with the main RDS DB instance?
The replication to replicas is asynchronous, but they are eventually consistent
What is the use of RDS read replicas?
Replicas provide better performance for reading the data from the RDS for the stop it can be used by the reporting or any analytical tool that only needs to read the data.
Replicas can be promoted to their own DB. Applications must update the connection string to leverage the read replicas
Is there a network cost when data goes from one AZ to another?
The data synchronization between same or different AZ free. But there is a cost when data is synchronized across regions. Data synchronization within the same region is free but It’s not free between different regions.
How is disaster recovery configured in RDS?
The disaster recovery is configured across the AZs (Multi-AZ) with synchronous replication (instantly). One DNS name is configured for the application to the main RDS database instance. In the event of failure, the automation failover will occur and DNS will point to the DR instance. There won’t be any interruption in the application. The DR instance becomes the master DB Instance.
The DR instance cannot be used for scaling (no one can read or write to it, it’s just here for the failover if anything goes wrong with the master database).
Read Replicas can be setup as a Multi-AZ for disaster recovery (DR). It’s a common exam question.
Can RDS be changed from a single AZ to multiple AZ?
The RDS settings can be modified to make the database from a single AZ to multiple AZ. Behind the scene, AWS will take that snapshot of the master instance and restore it in the new AZ. A synchronization is set up between the master and the standby DB instances.
What is the difference between RDS and RDS custom?
In RDS, the entire database at the OS is managed by AWS.
In RDS custom, you have access to the database and the OS. You don’t have control over the hardware. You also have access to the EC2 instance. RDS custom is available only for Oracle and Microsoft SQL Server. You can customize the instance or the database. But you must disable the automation mode before you perform any customization.
Aurora is compatible with which databases?
It’s compatible Postgres and MySQL
What is the writer endpoint and reader endpoint in Aurora DB?
The writer endpoint is a DNS name that is used for writing the data to the master DB instance. In case of failure, the writer endpoint may point to the read replica and promote it as a master DB instance. The application pointing to the master DB instance would not require any change.
Reader endpoint is also a DNS name used by the applications to read the data from the read replicas. The Aurora database automatically performs the auto-scaling, and new replicas are set up to ensure the desired performance.
Is it possible to backtrack data in Aurora?
Yes the database can be restored at any point of time without using backup put a stop. Aurora uses a different method to do that.
What is Aurora replicas autoscaling?
If there are multiple read requests AWS creates more replicas depending upon the higher CPU usage of the existing read replicas.
What are Aurora’s custom endpoints?
The custom endpoints provide load balancing and high availability for each group of DB instances within your cluster. If one of the DB instances within a group becomes unavailable, Aurora directs subsequent custom endpoint connections to one of the other DB instances associated with the same endpoint.
The custom endpoints can be created to run analytical queries or any other specific purpose. These read replicas can be larger instances compared to other existing replicas.
What is Aurora serverless?
Amazon Aurora Serverless is an on-demand, autoscaling configuration for Amazon Aurora. It automatically starts up, shuts down, and scales capacity up or down based on your application’s needs. You can run your database on AWS without managing database capacity.
Manually managing database capacity can take up valuable time and can lead to inefficient use of database resources. With Aurora Serverless, you create a database, specify the desired database capacity range, and connect your applications. You pay on a per-second basis for the database capacity that you use when the database is active, and migrate between standard and serverless configurations with a few steps in the Amazon Relational Database Service (Amazon RDS) console.
What is Aurora multi-master?
Most kinds of Aurora clusters are single-master clusters. For example, provisioned, Aurora Serverless, parallel query, and Global Database clusters are all single-master clusters. In a single-master cluster, a single DB instance performs all write operations and any other DB instances are read-only. If the writer DB instance becomes unavailable, a failover mechanism promotes one of the read-only instances to be the new writer.
In a multi-master cluster, all DB instances can perform write operations. The notions of a single read/write primary instance and multiple read-only Aurora Replicas don’t apply. There isn’t any failover when a writer DB instance becomes unavailable, because another writer DB instance is immediately available to take over the work of the failed instance. We refer to this type of availability as continuous availability, to distinguish it from the high availability (with brief downtime during failover) offered by a single-master cluster
What is global Aurora?
Amazon Aurora Global Database is designed for globally distributed applications, allowing a single Amazon Aurora database to span multiple AWS Regions. It replicates your data with no impact on database performance, enables fast local reads with low latency in each Region, and provides disaster recovery from Region-wide outages.
What is Aurora Machine Learning?
Amazon Aurora machine learning enables you to add ML-based predictions to applications via the familiar SQL programming language, so you don’t need to learn separate tools or have a prior machine learning experience. It provides simple, optimized, and secure integration between Aurora and AWS ML services without having to build custom integrations or move data around.
Which database takes less than one second for cross-region replication?
Global Aurora database. Cross-region replication within one second is a hint in the exam for the global Aurora database
how many backup options are there in RDS?
Automated backup and manual backup.
In automated backup full backup is taken every day and transaction logs are backed up every five minutes. It gives the ability to restore the backup any point in time. The automated backup can be retained from 1 to 35 days.
The manual database snapshots are triggered by the users. The backups are retained as long as the user wants them.
A trick that can come up in the exam: if you have a requirement of having an RDS database at a specific time frame, you can reduce the cost by taking its backup and then deleting it. When you again need to have the database, you can restore it and start using it. This way, you can reduce the cost of having an RDS database. but you will still have to pay for the storage
How the backup in Aurora is different than the backup in RDS?
Automated backup in Aurora cannot be disabled as it can be disabled in RDS by setting the retention period to zero.
Similar to RDS the backup in Aurora is retained from 1-35 days.
What is Aurora Database Cloning?
By using Aurora cloning, you can create a new cluster that uses the same Aurora cluster volume and has the same data as the original. The process is designed to be fast and cost-effective. The new cluster with its associated data volume is known as a clone. Creating a clone is faster and more space-efficient than physically copying the data using other techniques, such as restoring a snapshot.
It is useful for creating a staging database from production database without it.
Can RDS or Aurora databases can be encrypted?
Yes, they can be encrypted by using AWS KMS.
Can read replicas be encrypted if master is not encrypted?
No, if the master is not encrypted, read replicas cannot be encrypted
How to encrypt an unencrypted database?
To encrypt an unencrypted database, take a DB snapshot and restore it as encrypted
What are the security options for RDS and Aurora?
- The database can be encrypted (at rest) by using AWS KMS, and it must be defined at the time of launching the database.
- RDS and Aurora uses TLS by default for inflight encryption.
- IAM roles to connect to the databases without using a username or password
- You can control network access to your RDS and Aurora database by using security groups
- You cannot assess the instance by SSH unless it’s RDS custom
What is Amazon RDS proxy?
Amazon RDS Proxy is a fully managed, highly available database proxy for Amazon Relational Database Service (RDS) that makes applications more scalable, more resilient to database failures, and more secure.
Many applications, including those built on modern serverless architectures, can have many open connections to the database server and may open and close database connections at a high rate, exhausting database memory and compute resources (opening and closing connections consume CPU and RAM). Amazon RDS Proxy allows applications to pool and share connections established with the database, improving database efficiency and application scalability. It’s serverless, autoscaling, and highly available (multi-az) With RDS Proxy, failover times for Aurora and RDS databases are reduced by up to 66%, and database credentials, authentication, and access can be managed through integration with AWS Secrets Manager and AWS Identity and Access Management (IAM).
https://aws.amazon.com/rds/proxy/
It supports MySQL, Postgres and MariaDB. No code change is required for most of the applications.
It needs to be accessed by VPC, it’s never publically accessible.
What databases are supported by RDS proxy?
It supports mySQL, PostgresSQL, MariaDB and Aurora (mySQL, PostgresSQL)
Is there any code changes required for using RDS proxy?
No changes are required
What is ElastiCache?
Amazon ElastiCache is a fully managed, in-memory caching service supporting flexible, real-time use cases. You can use ElastiCache for caching, which accelerates application and database performance, or as a primary data store for use cases that don’t require durability like session stores, gaming leaderboards, streaming, and analytics. ElastiCache is compatible with Redis and Memcached.
It requires heavy code changes.
What’s the difference between Redis and memcached?
Redis is multi AZ with auto failover, read replicas to scale deeds and have high availability, backup and restore feature. Memcached uses multi node called sharding for partitioning the data. There’s no high availability or application, nonpersistent, no backup and restore and it has multi threaded architecture.
Does elastic cache uses IAM Authentication?
No, the elastic cache does not support IAM authentication. IAM policies in elastic cache are only used for AWS API-level security
How is Redis authenticated?
You can set password when you create Redis cluster. Redis also supports SSL in flight encryption.
What authentication mechanism is used by memcached?
Memcache supports SASL based authentication
What are the use cases for Redis?
Radis sorted set guarantee both uniqueness and element sorting therefore it’s perfect for gaming leaderboards