Skip to content

Aws Database

← Back to all decks

66 cards — 🟢 8 easy | 🟡 31 medium | 🔴 13 hard

🟢 Easy (8)

1. What is AWS Redshift and how is it different than RDS?

Show answer cloud data warehouse

Remember: RDS = Relational Database Service. Manages backups, patching, replication, failover. Supports MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora.

Gotcha: RDS is not serverless by default. Use Aurora Serverless for auto-scaling compute, or RDS Proxy for connection pooling.

2. What is Amazon RDS and how does it simplify database management?

Show answer A managed relational database service.

Remember: RDS = Relational Database Service. Manages backups, patching, replication, failover. Supports MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora.

Gotcha: RDS is not serverless by default. Use Aurora Serverless for auto-scaling compute, or RDS Proxy for connection pooling.

3. What is AWS RDS (Relational Database Service) and what databases does it support?

Show answer * Relational Database Service
* Managed DB service (you can't ssh the machine)
* Supports multiple DBs: MySQL, Oracle, Aurora (AWS Proprietary), ...

Remember: RDS = Relational Database Service. Manages backups, patching, replication, failover. Supports MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora.

Gotcha: RDS is not serverless by default. Use Aurora Serverless for auto-scaling compute, or RDS Proxy for connection pooling.

4. What is the use case for Aurora multi-master?

Show answer Aurora multi-master is perfect for a use case where you want to have instant failover for write node.

Remember: Aurora = AWS-optimized MySQL/PostgreSQL. 5x throughput of MySQL, 3x of PostgreSQL. Storage auto-scales to 128 TB.

5. What is DynamoDB Accelerator?

Show answer Amazon definition: "Amazon DynamoDB Accelerator (DAX) is a fully managed, highly available, in-memory cache for DynamoDB that delivers up to a 10x performance improvement – from milliseconds to microseconds..."

Learn more [here](https://aws.amazon.com/dynamodb/dax)

Remember: DynamoDB = fully managed NoSQL. Single-digit millisecond latency at any scale. Pay per request or provisioned capacity.

Gotcha: DynamoDB pricing can surprise you — on-demand mode charges per read/write. Design your access patterns first, not your schema.

6. What is Amazon DocumentDB?

Show answer Amazon definition: "Amazon DocumentDB (with MongoDB compatibility) is a fast, scalable, highly available, and fully managed document database service that supports MongoDB workloads. As a document database, Amazon DocumentDB makes it easy to store, query, and index JSON data."

Learn more [here](https://aws.amazon.com/documentdb)

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

7. What is the difference between AWS Regions and Availability Zones?

Show answer Regions and Availability Zones (AZs) are AWS's infrastructure hierarchy
for providing high availability and disaster recovery.

Region:
- Separate geographic area (e.g., us-east-1, eu-west-1)
- Completely isolated from other regions
- Data doesn't automatically replicate between regions
- Choose based on: latency, compliance, available services

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

8. What is AWS ElastiCache? In what use case should it be used?

Show answer Amazon Elasticache is a fully managed Redis or Memcached in-memory data store.
It's great for read-intensive workloads where the common data/queries are cached and apps/users access the cache instead of the primary database.

Remember: ElastiCache = managed Redis or Memcached. Use Redis for persistence, pub/sub, sorted sets. Use Memcached for simple key-value caching.

🟡 Medium (31)

1. What AWS service would you use for a managed SQL database?

Show answer AWS RDS (Relational Database Service). It supports MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, and Aurora. RDS handles provisioning, patching, backups, and failover. Key features: automated daily snapshots, Multi-AZ deployments for high availability, read replicas for scaling reads, and encryption at rest with KMS. For serverless SQL, consider Aurora Serverless.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

2. Which service would you use if you need store frequently used data for low latency access?

Show answer Amazon ElastiCache — a managed in-memory caching service (Redis or Memcached) designed for sub-millisecond latency on frequently accessed data such as session state, query results, or leaderboard scores.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

3. What are some use cases for using RDS read replicas?

Show answer You have a main application which works against your database but you would like to add additional app, one used for logging, analytics, ... so you prefer it won't use the same database. In this case, you create a read replica instance and the second application works against that instance.

Remember: RDS = Relational Database Service. Manages backups, patching, replication, failover. Supports MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora.

Gotcha: RDS is not serverless by default. Use Aurora Serverless for auto-scaling compute, or RDS Proxy for connection pooling.

4. Describe AWS RDS and its benefits.

Show answer * Amazon RDS (Relational Database Service): It's a managed database service that makes it easy to set up, operate, and scale a relational database in the cloud. It supports various engines like MySQL, PostgreSQL, Oracle, and SQL Server.
* Benefits: Automated backups, scaling, patches, and high availability are some advantages of RDS.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

5. What do you know about RDS backups?

Show answer * Automated backups
* Full daily backup (done during maintenance window)
* Transactions logs backup every 5 minutes
* Retention can be increased and by default it's 7 days

Remember: RDS = Relational Database Service. Manages backups, patching, replication, failover. Supports MySQL, PostgreSQL, MariaDB, Oracle, SQL Server, Aurora.

Gotcha: RDS is not serverless by default. Use Aurora Serverless for auto-scaling compute, or RDS Proxy for connection pooling.

6. Explain "Point-in-Time Recovery" feature in DynamoDB

Show answer Amazon definition: "You can create on-demand backups of your Amazon DynamoDB tables, or you can enable continuous backups using point-in-time recovery. For more information about on-demand backups, see On-Demand Backup and Restore for DynamoDB."

Learn more [here](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/PointInTimeRecovery.html)

Remember: DynamoDB = fully managed NoSQL. Single-digit millisecond latency at any scale. Pay per request or provisioned capacity.

Gotcha: DynamoDB pricing can surprise you — on-demand mode charges per read/write. Design your access patterns first, not your schema.

7. Describe the workflow of an application using the cache in AWS

Show answer 1. The application performs a query against the DB. There is a check to see if the data is in the cache
1. If it is, it's a "cache hit" and the data is retrieved from there
2. If it's not in there, it's a "cache miss" and the data is pulled from the database
1. The data is then also written to the cache (assuming it is often accessed) and next time the user queries for the same data, it might be retrieved from the cache (depends on how much time passed and whether this specific data was invalidated or not)

8. Explain the differences between AWS RDS and DynamoDB.

Show answer * RDS: It's a relational database service supporting SQL-type databases like MySQL, PostgreSQL, SQL Server, etc.
* DynamoDB: It's a NoSQL database service designed for fast and predictable performance with seamless scalability.

Remember: DynamoDB = fully managed NoSQL. Single-digit millisecond latency at any scale. Pay per request or provisioned capacity.

Gotcha: DynamoDB pricing can surprise you — on-demand mode charges per read/write. Design your access patterns first, not your schema.

9. True or False? It's possible to scale Aurora replicas

Show answer True. If your read replica instances exhaust their CPU, you can scale by adding more instances

Remember: Aurora = AWS-optimized MySQL/PostgreSQL. 5x throughput of MySQL, 3x of PostgreSQL. Storage auto-scales to 128 TB.

10. You need a cache with read replicas that can be scaled and one support multi AZ. Which one would you use?

Show answer ElastiCache Redis.

Remember: read replicas offload read traffic from the primary. Up to 5 for RDS, up to 15 for Aurora. Async replication = eventual consistency.

11. True or False? Moving AWS RDS from single AZ to multi AZ is an operation with downtime (meaning there is a need to stop the DB)

Show answer False. It's a zero downtime operation = no need to stop the database.

Remember: choose the right AWS database: RDS/Aurora (relational), DynamoDB (key-value), ElastiCache (caching), Neptune (graph), DocumentDB (MongoDB-compatible), Timestream (time-series).

Gotcha: database costs include compute, storage, I/O, backups, and data transfer. Use the AWS pricing calculator before committing to an architecture.

12. Explain "Global Tables" in DynamoDB

Show answer Amazon definition: "A global table is a collection of one or more replica tables, all owned by a single AWS account."

Learn more [here](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_HowItWorks.html)

Remember: DynamoDB = fully managed NoSQL. Single-digit millisecond latency at any scale. Pay per request or provisioned capacity.

Gotcha: DynamoDB pricing can surprise you — on-demand mode charges per read/write. Design your access patterns first, not your schema.

13. Why to use AWS RDS instead of launching an EC2 instance and install a database on it?

Show answer AWS RDS is a managed service, that means it's automatically provisioned and patched for you.

In addition, it provides you with continuous backup (and the ability to restore from any point of time), scaling capability (both horizontal and vertical), monitoring dashboard and read replicas.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

14. What would you use for NoSQL database?

Show answer Amazon DynamoDB — a fully managed, serverless NoSQL key-value and document database that delivers single-digit millisecond latency at any scale, with built-in security, backup, and global replication.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

15. What would you use to migrate on-premise database to AWS?

Show answer AWS Database Migration Service (DMS)

Remember: choose the right AWS database: RDS/Aurora (relational), DynamoDB (key-value), ElastiCache (caching), Neptune (graph), DocumentDB (MongoDB-compatible), Timestream (time-series).

Gotcha: database costs include compute, storage, I/O, backups, and data transfer. Use the AWS pricing calculator before committing to an architecture.

16. Explain Aurora Serverless. What use cases is it good for?

Show answer * Aurora serverless is an automated database instantiation and it's auto scaled based on an actual usage
* It's good mainly for infrequent or unpredictable workflows
* You pay per second so it can eventually be more cost effective

Remember: Aurora = AWS-optimized MySQL/PostgreSQL. 5x throughput of MySQL, 3x of PostgreSQL. Storage auto-scales to 128 TB.

17. What would you use if you need a fully managed document database?

Show answer Amazon DocumentDB

Remember: choose the right AWS database: RDS/Aurora (relational), DynamoDB (key-value), ElastiCache (caching), Neptune (graph), DocumentDB (MongoDB-compatible), Timestream (time-series).

Gotcha: database costs include compute, storage, I/O, backups, and data transfer. Use the AWS pricing calculator before committing to an architecture.

18. What should you use for scaling reads?

Show answer You can use an ElastiCache cluster or RDS Read Replicas.

Remember: choose the right AWS database: RDS/Aurora (relational), DynamoDB (key-value), ElastiCache (caching), Neptune (graph), DocumentDB (MongoDB-compatible), Timestream (time-series).

Gotcha: database costs include compute, storage, I/O, backups, and data transfer. Use the AWS pricing calculator before committing to an architecture.

19. What you would use for having automated backups for an application that has MySQL database layer?

Show answer Amazon Aurora — a MySQL- and PostgreSQL-compatible managed relational database that provides continuous automated backups to S3, point-in-time recovery (up to 35-day retention), and up to 5x throughput over standard MySQL.

Remember: RDS automated backups = daily snapshots + transaction logs (point-in-time recovery). Retention: 0-35 days. Manual snapshots persist until deleted.

20. You need a cache that supports sharding and built with multi-threaded architecture in mind. Which one would you use?

Show answer ElastiCache Memcached

Remember: choose the right AWS database: RDS/Aurora (relational), DynamoDB (key-value), ElastiCache (caching), Neptune (graph), DocumentDB (MongoDB-compatible), Timestream (time-series).

Gotcha: database costs include compute, storage, I/O, backups, and data transfer. Use the AWS pricing calculator before committing to an architecture.

21. True or False? Amazon RDS supports MongoDB

Show answer False. RDS is relational database and MongoDB is a NoSQL db.

Remember: choose the right AWS database: RDS/Aurora (relational), DynamoDB (key-value), ElastiCache (caching), Neptune (graph), DocumentDB (MongoDB-compatible), Timestream (time-series).

Gotcha: database costs include compute, storage, I/O, backups, and data transfer. Use the AWS pricing calculator before committing to an architecture.

22. You need a highly available cache with backup and restore features. Which one would you use?

Show answer ElastiCache Redis.

Remember: RDS automated backups = daily snapshots + transaction logs (point-in-time recovery). Retention: 0-35 days. Manual snapshots persist until deleted.

23. What do you know about Amazon Aurora?

Show answer * A MySQL & Postgresql based relational database.
* Proprietary technology from AWS
* The default database proposed for the user when using RDS for creating a database.
* Storage automatically grows in increments of 10 GiB
* HA native - failover in instant
* Has better performances over MySQL and Postgres
* Supports 15 replicas (while MySQL supports 5)

Remember: Aurora = AWS-optimized MySQL/PostgreSQL. 5x throughput of MySQL, 3x of PostgreSQL. Storage auto-scales to 128 TB.

24. True or False? ElastiCache doesn't support IAM authentication

Show answer True. ElastiCache does not support IAM authentication for Redis/Memcached access. It uses AUTH tokens (Redis) or no auth (Memcached). IAM is only used for API-level operations.

Remember: ElastiCache = managed Redis or Memcached. Use Redis for persistence, pub/sub, sorted sets. Use Memcached for simple key-value caching.

25. Explain RDS Multi Availability Zone

Show answer * RDS multi AZ used mainly for disaster recovery purposes
* There is an RDS master instance and in another AZ an RDS standby instance
* The data is synced synchronously between them
* The user, application is accessing one DNS name and where there is a failure with the master instance, the DNS name moves to the standby instance, so the failover done automatically

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

26. Which service would you use if you need a data warehouse?

Show answer Amazon Redshift — a fully managed petabyte-scale columnar data warehouse optimized for analytic queries (OLAP). It supports SQL, integrates with S3 for data lake queries via Redshift Spectrum, and scales from a few hundred GB to petabytes.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

27. How to make RDS snapshots encrypted?

Show answer * If RDS database is encrypted then, the snapshot itself is also encrypted
* If RDS database isn't encrypted then, the snapshot itself isn't encrypted and then you can copy the un-encrypted snapshot to created an encrypted copy

Remember: RDS automated backups = daily snapshots + transaction logs (point-in-time recovery). Retention: 0-35 days. Manual snapshots persist until deleted.

Remember: snapshots are point-in-time copies, usually copy-on-write. Fast to create but not a replacement for offsite backups.

28. Explain Amazon RDS Read Replicas

Show answer [AWS Docs](https://aws.amazon.com/rds/features/read-replicas): "Amazon RDS Read Replicas provide enhanced performance and durability for RDS database (DB) instances. They make it easy to elastically scale out beyond the capacity constraints of a single DB instance for read-heavy database workloads."

In simpler words, it allows you to scale your reads.

Remember: read replicas offload read traffic from the primary. Up to 5 for RDS, up to 15 for Aurora. Async replication = eventual consistency.

29. Explain AWS RDS Storage Auto Scaling

Show answer * RDS storage can automatically be increased upon lack in storage
* The user needs to set "Maximum Storage Threshold" to have some limit on storage scaling
* Use cases: applications with unpredictable workloads
* Supports multiple RDS database engines

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

30. Explain AWS Redshift and its use cases.

Show answer AWS Redshift: It's a fully managed, petabyte-scale data warehouse service. It's optimized for querying large datasets and is suitable for analytics, reporting, and business intelligence.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

31. True or False? RDS read replicas are asynchronous

Show answer True. This is done so the reads are consistent.

Remember: read replicas offload read traffic from the primary. Up to 5 for RDS, up to 15 for Aurora. Async replication = eventual consistency.

🔴 Hard (13)

1. How AWS RDS switches from single AZ to multi AZ?

Show answer 1. Snapshot is taken by RDS
2. The snapshot is restored to another, standby, RDS instance
3. Synchronization is enabled between the two instances

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

2. What do you if you suspect AWS Redshift performs slowly?

Show answer * You can confirm your suspicion by going to AWS Redshift console and see running queries graph. This should tell you if there are any long-running queries.
* If confirmed, you can query for running queries and cancel the irrelevant queries
* Check for connection leaks (query for running connections and include their IP)
* Check for table locks and kill irrelevant locking sessions

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

3. You run an architecture where you have a Lambda function that uploads images to S3 bucket and stores information on the images in DynamoDB. You would like to expose the function to users so they can invoke it. Your friend Carlos suggests you expose the credentials to the Lambda function. What's your take on that?

Show answer That's a big no. You shouldn't let users direct access to your Lambda function.

The way to go here and expose the Lambda function to users is to use an API Gateway endpoint.

Remember: DynamoDB = fully managed NoSQL. Single-digit millisecond latency at any scale. Pay per request or provisioned capacity.

Gotcha: DynamoDB pricing can surprise you — on-demand mode charges per read/write. Design your access patterns first, not your schema.

4. You have set up read replicas to scale reads but users complain that when they update posts in forums, the posts are not being updated. What may cause this issue?

Show answer Read Replicas use asynchronous replication so it's possible users access a read replica instance that wasn't synced yet.

Remember: read replicas offload read traffic from the primary. Up to 5 for RDS, up to 15 for Aurora. Async replication = eventual consistency.

5. True or False? In case of RDS (not Aurora), read replicas require you to change the SQL connection string

Show answer True. Since read replicas add endpoints, each with its own DNS name, you need to modify your app to reference these new endpoints to balance the load read.

Remember: Aurora = AWS-optimized MySQL/PostgreSQL. 5x throughput of MySQL, 3x of PostgreSQL. Storage auto-scales to 128 TB.

6. How can I switch an RDS intance from public to private or vice versa ?

Show answer It's like changing the access to an office room. Making it public means anyone with permission can come in, while making it private limits access to a select few.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

7. How to encrypt an un-encrypted RDS instance?

Show answer Create a copy of the un-encrypted instance -> copy the snapshot to create an encrypted copy -> restore the database from the encrypted snapshot -> migrate the application to work against the copied instance -> remove the original DB instance

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

8. What patterns are there for loading data into the cache?

Show answer * Write Through: add or update data in the cache when the data is written to the DB
* Lazy Loading: all the read data is cached
* Session Store: store temporary session data in cache

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

9. True or False? Aurora storage is striped across 20 volumes

Show answer False. Aurora storage is striped across 100 volumes, not 20. This 6-way replication across 3 AZs provides fault tolerance — Aurora can lose 2 copies and still write, lose 3 and still read. Storage auto-scales to 128 TB.

10. True or False? in regards to RDS, replicas can be encrypted even if the master isn't encrypted

Show answer False. RDS read replicas of an unencrypted master cannot be encrypted. You must encrypt the master first, then create encrypted replicas from it.

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

11. How IAM authentication works with RDS?

Show answer For example:

1. EC2 instance uses IAM role to make an API call to get auth token
2. The token, with SSL encryption, is used for accessing the RDS instance

Note: The token has a lifetime of 15 minutes

Gotcha: always enable Multi-AZ for production databases. The small cost increase prevents hours of downtime during AZ failures or maintenance.

12. How can you make an application stateless using ElastiCache?

Show answer Let's say you have multiple instances running the same application and every time you use the application, it creates a user session.
This user session can be stored in ElastiCache so even if the user contacts a different instance of the application, the application can retrieve the session from ElastiCache.

Remember: ElastiCache = managed Redis or Memcached. Use Redis for persistence, pub/sub, sorted sets. Use Memcached for simple key-value caching.

13. True or False? Aurora stores 4 copies of your data across 2 availability zones

Show answer False. It stores 6 copies across 3 availability zones

Remember: Aurora = AWS-optimized MySQL/PostgreSQL. 5x throughput of MySQL, 3x of PostgreSQL. Storage auto-scales to 128 TB.