EC2 (ACG) Flashcards
How would you connect to a newly created EC2 instance from the terminal?
- After creating the new EC2 instance, browse to the download of the new key pair
- Change to read only:
chmod 400 mynewkp.pem - ssh ec2-user@[instance IP goes here] -i mynewkp.pem
- sudo su
- yum update -y
How would you list and create S3 buckets from the terminal?
aws S3 ls
aws S3 mb s3://mybucket-john-1234
Bucket names must be unique across all AWS accounts in all the AWS regions within a partition. A partition is a group of Regions.
What are the AWS partitions?
A partition is a group of Regions. AWS currently has three partitions:
- Standard Regions (aws)
- China Regions (aws-cn)
- AWS GovCloud US (aws-us-gov)
What is Amazon’s fully managed RDS engine?
Amazon Aurora which is compatible with MySQL and PostgreSQL. Aurora can deliver up to five times the throughput of MySQL and up to three times the throughput of PostgreSQL without requiring changes to most of your existing applications.
What is the difference between OLTP and OLAP?
Online Transaction Processing (OLTP) is all about data processing and completing large numbers of small transactions in real-time, for example, customer orders, banking transactions, payments and booking systems.
Online Analytics Processing (OLAP) processes complex queries to analyze historical data, for example, analyzing net profit figures from the past 3 years, and sales forecasting.
What are RDS database types?
SQLServer, Oracle, MySQL, PostgreSQL, Maria DB, and Amazon Aurora.
RDS is designed for which type of workloads?
OLTP workloads. Great for processing lots of small transactions like customer orders, banking transactions, payments, and booking systems.
RDS is suitable for OLAP workloads. True or false?
False, RDS is not suitable for OLAP. Use Redshift for data warehousing and OLAP tasks, like analyzing large amounts of data, reporting, and sales forecasting.
What is Multi-AZ?
It is an exact copy of your production database in another Availability Zone. AWS handles the replication for you. When you write to your production database, this right will automatically synchronize to the standby database.
Which RDS types can be configured as Multi-AZ?
All of them. SQL Server, Oracle MySQL, PostgreSQL and MariaDB.
What happens in the event of unplanned failure in RDS Multi-AZ?
RDS will automatically fail over to the standby during a failure so that database operations can resume quickly without administrative intervention. Multi-AZ is for disaster recovery, not for improving performance, so you cannot connect to the standby when the primary DB is active.
What can you do to improve performance of your RDS database?
Add read replicas. A read replica is a read-only copy of your primary database. Great for read heavy workloads and takes the load off your primary database. Each read replica has its own DNS endpoint which is different and independent from the primary database.
Read Replicas are primarily used for disaster recovery. True or false?
FALSE
Read replicas are primarily used for scaling, not for disaster recovery.
Read replicas requires automatic backups. True or false?
TRUE
Automatic backups must be enabled in order to deploy a read replica.
Multiple read replicas are supported. True or false?
TRUE
MySQL, Maria DB, PostgreSQL, Oracle, and SQL Server allow you to add up to five read replicas to each DB instance.
Multi-AZ is used for disaster recovery. True or false?
TRUE
Read replicas provide a read-only copy of your primary database in the same AZ, cross-AZ or cross-region. True or false
TRUE
What are three key characteristics of Multi-AZ?
- An exact copy of your production database in another AZ.
- Used for DR (disaster recovery).
- In the event of a failure, RDS will automatically fail over to the standby instance.
What are three key characteristics of read replica?
- A read-only copy of your primary database in the same AZ, cross-AZ, or cross-region.
- Used to increase or scale read performance.
- Great for read-heavy workloads and takes the load off your primary database for read only workloads, e.g., business intelligence reporting jobs.
What are the two ways to backup RDS?
- Database snapshot
2. Automated Backup (enabled by default)
You can enable encryption at any time on an RDS DB instance. True or false?
FALSE
You can’t enable encryption on an unencrypted RDS DB instance. Encryption must be enabled when first creating your database.
How would you encrypt an existing unencrypted RDS DB instance?
Create a snapshot, encrypt the snapshot, and then do a database restore with the encrypted snapshot.
What are four key characteristics of automated backups?
- Automated, enabled by default, you define the backup window
- Point-in-time snapshot plus transaction logs
- Retention period of 1 to 35 days
- Can be used to recover your database to any point in time within the retention period
What are four key characteristics of a DB snapshot?
- User initiated, ad hoc
- Point-in-time snapshot only
- No retention period; stored indefinitely until you delete
- Used to back up your DB instance to a known state and restore to that specific state at any time, e.g., before major changes to a database
What are three things to keep in mind regarding RDS encryption?
- Must be enabled at creation. Includes all underlying storage, automated backups, snapshots, logs, and read replicas.
- Uses the AWS Key Management Service (KMS) service for AES-256 encryption.
- Existing unencrypted RDS instances can be encrypted through snapshots. You can create a new RDS instance from the encrypted snapshot.
What is ElastiCache?
ElastiCache stores frequently accessed data in an in-memory cache. Memory is faster than disk.
What are the two types of ElastiCache?
- Memcached - great for object caching, scales horizontally, but no persistence, Multi-AZ, or failover.
- Redis - more sophisticated solution with enterprise features like persistence, replication, Multi-AZ, and failover. Supports sorting and ranking data, and complex data types like lists and hashes.
When should you use ElastiCache?
When your database is read heavy and the data is not prone to frequent changing.
ElastiCache is great for write heavy loads. True or false?
FALSE
ElastiCache is an in-memory cache designed to improve read performance for read-heavy databases.
When should you use memcached?
- Fast in-memory, key-value data store
- Object caching is your primary goal
- You want to keep things as simple as possible
- You don’t need persistence or Multi-AZ
- You don’t need to support advanced data types or sorting