RDS is a Database as a Service (DBaaS) product. It can be used to provision a fully functional database without the admin overhead traditionally associated with DB platforms. It can perform at scale, be made publicly accessible, and can be configured for demanding availability and durability scenarios.
RDS supports a number of database engines:
RDS can be deployed in single AZ or Multi-AZ mode (for resilience) and supports the following instance types:
Types of storage are supported:
RDS instances are charged based on:
RDS supports encryption with the following limits/restrictions/conditions:
Network access to an RDS instance is controlled by a security group (SG) associated with the RDS instance.
Since RDS can only have one master instance at a time, increasing its resources will help with its writing capacity.
RDS is capable of a number of different types of backups. Automated backsups to S3 occur daily and can be retained from 0 to 35 days. (0 means disabled). Manual snapshot are taken manually and exist until deleted, and point-in-time log-based backups are also stored on S3.
KMS is a regional service, so if the database is restored to another region, it will require a new master key.
With MultiAZ you donot have access to secondary AZ. For RDS only point of contact to the database is via CNAME. For the maintenance, changes happens first on the secondary and then later promoted to primary.
RDS Read Replicas are read-only copies of an RDS instance that can be created in the same region or a different region from the primary instance. Read Replicas can be addressed independently (each having their own DNS name) and used for read workloads, allowing you to scale reads. 5 Read Replicas can be created from a RDS instance, allowing a 5x increase in reads.
Amazon Aurora is a fully-managed, MySQL-compatible, relational database engine that combines the speed and availability of high-end commercial databases with the simplicity and cost-effectiveness of open source database.
Aurora can have maximum of 15 replicas.
Aurora Serverless is a fully managed on-demand, auto-scalling, high-availabile relational database that only charge when it’s in use. Aurora Serverless is based on the same database engine as Aurora, but instead of provisioning certain resouce allocation. Aurora Serverless handles this as a service. You simply specify a minimum and maximum number of Aurora capacity units (ACUs).
Abstracts away the capacity planning for database. You simply pay based on the resource you use (per second). You start with specifying minimum and capacity unit with ACUs.
Common Use case for Aurora Serveless are -
Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale. It is a NoSQL database service. It’s a regional service, partioned regionally and allows the creation of tables, hence tables names in DynamoDB have to be regionally unique. .
user_fav_movies
{
"name": "Bob Smith",
"createdAtTS": 1590268741
"email": "bob.smith@gmail.com",
"fav_movies": [
"Titanic",
"50 First Dates"
]
}
{
"name": "John Doe",
"createdAtTS": 1590268931
"email": "john.doe@gmail.com",
"fav_movies": [
"Beautiful Mind",
"Shutter Island"
]
}
Scan - Scan operation has to read every items on the table and apply filter to filter out items that doesn’t match the filter. It is super flexible but it consumers lots of capacity units so it’s so efficent to perform scan query on large tables.
Query - Query operation allows to lookup on the table without perform entire table scan, but you need to specify primary key and filter based on sort key. It is more efficent than Scan operation.
DynamoDB maintains continuous backups of your table for the last 35 day
Manual Backup
Encryption comes default with DynamoDB
Global Tables - Table needs to be empty and Enabled Streams Enable
DynamoDB has full integration with CloudWatch
DynamoDB has two read/write capacity modes: Provisioned throughput (default) and on-demand mode. When using on-demand mode, DynamoDB automatically scales to handle performance demands and bills a per-request charge. When using provisioned throughput mode, each table is configured with read capacity units (RCU) and write capacity units (WCU).
DynamoDB is highly resilent and replicates data across multiple AZs in a region. When you receive a HTTP 200, a write has been completed and is durable. This doesn’t mean it’s been written to all AZs - this generally occurs within a second.
An eventually consistent read will request data, preferring speed. It’s possible the data received may not relect a recent write. Eventual consistency is the default for read operations in DDB.
A strong consistency read ensures DynamoDB returns the most up-to-date copy of data - it takes longe rbut is sometimes required for application that require consistency.
When enabled, streams provide an ordered list of changes that occur to items within a DynamoDB table. A stream is a rolling 24-hour window of changes. Streams are enabled per table and only contain data from the point of being enabled.
Every stream has an ARN that identifies it globally across all tables, accounts, and regions.
Streams can be configured with one of four view types:
Streams can be integrated with AWS Lambda, invoking a function whenever items are changed in a DynamoDB table (a DB trigger)
Indexes provide an alternative representation of data in a table, which is useful for application with varying query demands. Indexes come in two forms: Local Secondary Indexes (LSI) and Global Secondary Indexes (GSI). Indexes are intracted with as though they are table, but they are just an alternate representaiton of data in an existing table.
Local secondary indexes must be created at the same time as creating a table. They use the same partition key but an altneative sort key. They share the RCU and WCU values for the main table. With using LSI efficient queries can be performed based on alternative sort key. You can create upto 5 LSI per table.
Global secondary indexes can be created at any point after the table is created. They can use different partition and sort keys. They have their own RCU and WCU values. You can create upto 20 GSI per table.
Indexes can have certain projected attributes.
DynamoDB Accelerator (DAX) is an in-memory cache designed specifically for DynamoDB. Results delivered from the DAX are available in microseconds rather than in the single-digit millisecond available from DynamoDB.
DAX maintains two distinct caches: the item cache and the query cache. The item cache is populated with results from the GetItem and BatchGetItems and has a five minute default TTL. The query cache stores results of Query and Scan operations and caches based on the parameters specified.
ElasticCache is a managed in-memory data store supporting the Redis or Memcached engines.
ElastiCache is used for two common use cases:
Generally, ElastiCache is used with key value databases or to store simple sessions data but it can be used with SQL datbase engines.