Requirements to consider when choosing a database:
https://lh6.googleusercontent.com/QLqVJrcAs_lhDXFFNh0lDOTi0Hzce3CSBT3gg_-DkAL8AzOAw3zMqdTvYBYrn56sPCX69OdI53M7LrmmwCzwnQwddyr6a_xkT34ircWY5e6qpvqynhPssDljTf-88q6AUW3DWvmG
https://lh4.googleusercontent.com/uorqfDEHiOhC-sLAi852kyqPYahb6rHa6mpbk-7E92seTC_yDDPVU4TLlnf3D833wAMpxNYbIwaGv4l8lC9FEMy3iR3BjfXo3j1FTyPopmU6VBnU5tDX7Sst3w29WRvfp9rshIeL
https://lh3.googleusercontent.com/Cwd-bVlDsXdoI5c7hoz91zHUuWfM2uuOFrPjov9p26p6dLjZCdeNlEB_xm7EnEtdjft4tbCeG-ozrRRLX8OIbQf5oiZCD6tTbPxqXWygKIammcrkCGZLDZrsi8TnB1Y7qnpLKVtJ
To maintain full control over the database system → Install DB system on EC2 instance (unmanaged).
Database Instance → Isolated database environment, can contain multiple databases. Pick instance class (type of EC2 instance) and instance storage (type of storage used). Also choose DB engine (SQL only) to run.
Billing → DB instance hours, storage, I/O request, provisioned IOPS, backup storage, and data transfer IN/OUT (💵).
Multi-AZ deployment → Uses Primary/Standby replication (synchronous replication). It can do automatic failover, and it provides more durability and availability. Might generate a bit more latency due to the replication.
Read replicas → Uses asynchronous replication (for read heavy apps). Enhanced performance, availability, and security.
Maintenance Window → Opportunity to modify, upgrade instances or engines. Multi-AZ deployments reduce impact of maintenance.
Enhanced Monitoring → Enables metrics from RDS child processes
(includes threads), RDS processes
, OS processes
from an agent in the instances.
Automated Backups → Point-in-time recovery of the instance. Automatic daily full snapshots and transaction logs. Stored in S3.
Automatic Scaling → Automatically scales storage capacity in response to growing workloads, without downtime.
Database Snapshots → User-initiated, back up DB state as frequently as you want. Stored in S3.
Encryption → Can use SSL for data in transit. Encryption at rest using keys in KMS.
rds.force_ssl
(default false
).RDS Proxy → Fully managed, highly available DB proxy that pools and shares DB connections.
RDS Events → Operational events triggered, no data-modifying events.
Blue/Green Deployments → Copies a production (blue) database into a separate, synchronized staging (green) environment. You can make changes to the staging environment and then promote that one to production.
Optimized Writes → Can get up to 2x write throughput by writing only once when flushing to durable storage.
Optimized Reads → Can speed up query processing by up to 50% by using NVMe-based instance storage.
Trusted Language Extensions → Help build extensions in PostgreSQL (supported only in PostgreSQL).
Compliance → HIPAA and PCI compliant.
Use cases and requirements:
https://lh4.googleusercontent.com/lxUHVcnXtBzG7ZRydGXwuAh4X4Lo3DfjV3muuu9vd8vKuYEZUKht-005SLah-4m3fsPPuv6zMSyNt0zPBeYAakiXFTsDyNYxfyQXLcPvEFGCweUmpTZGPL7y41kcVeNaLtuWhlH8
https://lh4.googleusercontent.com/8-KQ4DMTEMdwqpvUtp0h4MMluNWYkjX1OKuQyE000R-hPcwMF93Sr4aHBedvYvdF5ZGHNTHCr0KqgTs0SgRQsf_aWilJxc6p5yYWWUjaeIxc24R0UIDWd5G1RUgXrARKKgwtN3sg
https://lh4.googleusercontent.com/LR2lgpuoV7YrnS6kfYl_VDaP9jWDFecP_E0JVAdk4r0p2nnhrwnyeu56vsu5MFRjekf2D4pAVIMWJVjIBCpW6Av-ZxjoJ76TnmlKMCVpVBod52CfMk4a87WIA2as7ZkPz7qw4VGR
Each family has a different purpose and best use case:
Storage is EBS-backed, so the EBS storage types can be used:
Billing per hour → Billed time is per hour used.
Database characteristics → Physical capacity (engine, size, memory class).
DB type → Instance types (on demand, reserved instances).
Number of DB instances → Provision more instances for peak loads.
Provisioned storage → No charge for backups of active databases, charged for backups of terminated databases.
Additional storage → Backup storage in addition to provisioned storage.
Requests → Number to/from request.
Deployment type → Single/multi AZ.
Data transfer → Inbound is free, outbound cost is tiered.
DynamoDB is a non-relational (key/value) database with virtually unlimited storage, low-latency queries, and scalable read/write throughput (can be provisioned or automatic scaling). Some characteristics are:
Features:
Recommendation is to have compound keys with partition keys that have a high-cardinality attributes (such as IDs) (source). Not following this can result in “hot” partitions, leading to throttling.