Other_databases
Chapter 25: Other AWS Database Services
Section titled “Chapter 25: Other AWS Database Services”Specialized Database Solutions
Section titled “Specialized Database Solutions”25.1 Overview
Section titled “25.1 Overview”AWS offers specialized database services for specific use cases beyond traditional relational and NoSQL databases.
AWS Database Services+------------------------------------------------------------------+| || +------------------------+ || | AWS Databases | || +------------------------+ || | || +--------+--------+--------+--------+--------+ || | | | | | | || v v v v v v || +------+ +------+ +------+ +------+ +------+ +------+ || |DocumentDB| |Neptune| | Timestream| | Keyspaces| | QLDB | || | | | | | | | | | | || |MongoDB | |Graph | |Time | |Cassandra| |Ledger| || |compat | |DB | |series| |compat | | | || +------+ +------+ +------+ +------+ +------+ +------+ || |+------------------------------------------------------------------+25.2 Amazon DocumentDB
Section titled “25.2 Amazon DocumentDB”Overview
Section titled “Overview” Amazon DocumentDB+------------------------------------------------------------------+| || Purpose: MongoDB-compatible document database || || Architecture || +----------------------------------------------------------+ || | | || | Application | || | | | || | v | || | +------------------+ | || | | Cluster Endpoint | | || | +------------------+ | || | | | || | +--------+--------+--------+ | || | | | | | || | v v v | || | +----------+ +----------+ +----------+ | || | | Primary | | Replica | | Replica | | || | | Instance | | Instance | | Instance | | || | +----------+ +----------+ +----------+ | || | | | | | || | v v v | || | +------------------------------------------+ | || | | Cluster Volume | | || | | (Storage Layer) | | || | +------------------------------------------+ | || | | || +----------------------------------------------------------+ || || Features: || - MongoDB 3.6, 4.0, 5.0 compatible || - Fully managed || - Automatic storage scaling (up to 64 TB) || - Up to 15 read replicas || - High availability (Multi-AZ) || - Point-in-time recovery || |+------------------------------------------------------------------+Use Cases
Section titled “Use Cases” DocumentDB Use Cases+------------------------------------------------------------------+| || 1. Content Management Systems || +----------------------------------------------------------+ || | - Document storage | || | - Flexible schema | || | - Rich queries | || +----------------------------------------------------------+ || || 2. User Profiles || +----------------------------------------------------------+ || | - Varying attributes | || | - Nested documents | || | - Fast lookups | || +----------------------------------------------------------+ || || 3. Catalog Management || +----------------------------------------------------------+ || | - Product catalogs | || | - Category hierarchies | || | - Search and filter | || +----------------------------------------------------------+ || |+------------------------------------------------------------------+25.3 Amazon Neptune
Section titled “25.3 Amazon Neptune”Overview
Section titled “Overview” Amazon Neptune+------------------------------------------------------------------+| || Purpose: Graph database for connected data || || Architecture || +----------------------------------------------------------+ || | | || | Graph Data Model | || | +----------------------------------------------------+ | || | | | | || | | (Person) --knows--> (Person) | | || | | | | | | || | | works_at works_at | | || | | v v | | || | | (Company) (Company) | | || | | | | || | +----------------------------------------------------+ | || | | || | Query Languages: | || | - Gremlin (Apache TinkerPop) | || | - SPARQL (RDF) | || | - openCypher (Neo4j compatible) | || | | || +----------------------------------------------------------+ || || Features: || - Optimized for graph queries || - Millisecond latency || - Up to 15 read replicas || - Multi-AZ deployment || - Bulk data import || |+------------------------------------------------------------------+Use Cases
Section titled “Use Cases” Neptune Use Cases+------------------------------------------------------------------+| || 1. Social Networks || +----------------------------------------------------------+ || | - Friend connections | || | - Recommendations | || | - Social graphs | || +----------------------------------------------------------+ || || 2. Fraud Detection || +----------------------------------------------------------+ || | - Transaction patterns | || | - Relationship analysis | || | - Anomaly detection | || +----------------------------------------------------------+ || || 3. Knowledge Graphs || +----------------------------------------------------------+ || | - Entity relationships | || | - Semantic queries | || | - Information discovery | || +----------------------------------------------------------+ || || 4. Network/IT Operations || +----------------------------------------------------------+ || | - Network topology | || | - Impact analysis | || | - Root cause analysis | || +----------------------------------------------------------+ || |+------------------------------------------------------------------+25.4 Amazon Timestream
Section titled “25.4 Amazon Timestream”Overview
Section titled “Overview” Amazon Timestream+------------------------------------------------------------------+| || Purpose: Time-series database for IoT and analytics || || Architecture || +----------------------------------------------------------+ || | | || | Data Flow: | || | | || | IoT Devices | || | +----------+ | || | | Sensors | | || | +----------+ | || | | | || | v | || | Ingestion | || | +----------+ | || | | Kinesis | | || | | IoT Core | | || | +----------+ | || | | | || | v | || | Timestream | || | +------------------------------------------+ | || | | Memory Store (Recent Data) | | || | | - Fast writes | | || | | - Point queries | | || | +------------------------------------------+ | || | | | || | v (Auto-migration) | || | +------------------------------------------+ | || | | Magnetic Store (Historical Data) | | || | | - Cost-optimized | | || | | - Long-term retention | | || | +------------------------------------------+ | || | | || +----------------------------------------------------------+ || || Features: || - Serverless, auto-scaling || - Built-in time-series functions || - Automatic data tiering || - SQL query support || - Scheduled queries || |+------------------------------------------------------------------+Use Cases
Section titled “Use Cases” Timestream Use Cases+------------------------------------------------------------------+| || 1. IoT Applications || +----------------------------------------------------------+ || | - Sensor data | || | - Device metrics | || | - Real-time monitoring | || +----------------------------------------------------------+ || || 2. Application Monitoring || +----------------------------------------------------------+ || | - Performance metrics | || | - Log analysis | || | - Error tracking | || +----------------------------------------------------------+ || || 3. Financial Data || +----------------------------------------------------------+ || | - Stock prices | || | - Trading data | || | - Market analysis | || +----------------------------------------------------------+ || |+------------------------------------------------------------------+25.5 Amazon Keyspaces
Section titled “25.5 Amazon Keyspaces”Overview
Section titled “Overview” Amazon Keyspaces+------------------------------------------------------------------+| || Purpose: Managed Apache Cassandra service || || Architecture || +----------------------------------------------------------+ || | | || | Cassandra-compatible API | || | +----------------------------------------------------+ | || | | | | || | | Application | | || | | | | | || | | v | | || | | +------------------+ | | || | | | Cassandra Driver | | | || | | +------------------+ | | || | | | | | || | | v | | || | | +------------------+ | | || | | | Keyspaces | | | || | | | (Serverless) | | | || | | +------------------+ | | || | | | | || | +----------------------------------------------------+ | || | | || +----------------------------------------------------------+ || || Features: || - Cassandra Query Language (CQL) || - Serverless, pay-per-request || - Automatic scaling || - Multi-AZ replication || - Point-in-time recovery || - Static columns, secondary indexes || |+------------------------------------------------------------------+25.6 Amazon QLDB
Section titled “25.6 Amazon QLDB”Overview
Section titled “Overview” Amazon QLDB (Quantum Ledger Database)+------------------------------------------------------------------+| || Purpose: Managed ledger database || || Architecture || +----------------------------------------------------------+ || | | || | Ledger Structure | || | +----------------------------------------------------+ | || | | | | || | | Block 1 | | || | | +----------------------------------------------+ | | || | | | Transaction 1 | Transaction 2 | ... | | | || | | +----------------------------------------------+ | | || | | | | | || | | v (Hash chain) | | || | | Block 2 | | || | | +----------------------------------------------+ | | || | | | Transaction 3 | Transaction 4 | ... | | | || | | +----------------------------------------------+ | | || | | | | | || | | v | | || | | Block N | | || | | +----------------------------------------------+ | | || | | | ... | | | || | | +----------------------------------------------+ | | || | | | | || | +----------------------------------------------------+ | || | | || +----------------------------------------------------------+ || || Features: || - Immutable transaction log || - Cryptographically verifiable || - SQL-like query language (PartiQL) || - No central trusted authority || - Complete audit trail || |+------------------------------------------------------------------+Use Cases
Section titled “Use Cases” QLDB Use Cases+------------------------------------------------------------------+| || 1. Financial Transactions || +----------------------------------------------------------+ || | - Transaction history | || | - Audit trail | || | - Compliance records | || +----------------------------------------------------------+ || || 2. Supply Chain || +----------------------------------------------------------+ || | - Product tracking | || | - Chain of custody | || | - Provenance | || +----------------------------------------------------------+ || || 3. Healthcare || +----------------------------------------------------------+ || | - Medical records | || | - Prescription history | || | - Patient data access logs | || +----------------------------------------------------------+ || || 4. Legal/Regulatory || +----------------------------------------------------------+ || | - Contract history | || | - Compliance evidence | || | - Regulatory submissions | || +----------------------------------------------------------+ || |+------------------------------------------------------------------+25.7 Practical Configuration
Section titled “25.7 Practical Configuration”DocumentDB with Terraform
Section titled “DocumentDB with Terraform”# ============================================================# DocumentDB Cluster# ============================================================
resource "aws_docdb_cluster" "main" { cluster_identifier = "main-docdb" engine = "docdb" engine_version = "5.0.0"
master_username = "admin" master_password = var.db_password
# Storage storage_encrypted = true kms_key_id = aws_kms_key.docdb.arn
# Backup backup_retention_period = 7 preferred_backup_window = "03:00-05:00"
# Network db_subnet_group_name = aws_docdb_subnet_group.main.name vpc_security_group_ids = [aws_security_group.docdb.id]
# Deletion protection deletion_protection = true skip_final_snapshot = false final_snapshot_identifier = "main-docdb-final"
tags = { Name = "main-docdb" }}
resource "aws_docdb_cluster_instance" "main" { count = 2 identifier = "main-docdb-${count.index + 1}" cluster_identifier = aws_docdb_cluster.main.id instance_class = "db.r6g.large"
tags = { Name = "main-docdb-instance-${count.index + 1}" }}
resource "aws_docdb_subnet_group" "main" { name = "main-docdb-subnet" subnet_ids = var.private_subnet_ids
tags = { Name = "main-docdb-subnet-group" }}Neptune with Terraform
Section titled “Neptune with Terraform”# ============================================================# Neptune Cluster# ============================================================
resource "aws_neptune_cluster" "main" { cluster_identifier = "main-neptune" engine = "neptune" engine_version = "1.2.0.0"
# Storage storage_encrypted = true kms_key_arn = aws_kms_key.neptune.arn
# Network db_subnet_group_name = aws_neptune_subnet_group.main.name vpc_security_group_ids = [aws_security_group.neptune.id]
# Backup backup_retention_period = 7 preferred_backup_window = "03:00-05:00"
# IAM DB authentication iam_database_authentication_enabled = true
tags = { Name = "main-neptune" }}
resource "aws_neptune_cluster_instance" "main" { count = 2 identifier = "main-neptune-${count.index + 1}" cluster_identifier = aws_neptune_cluster.main.id instance_class = "db.r5.large"
tags = { Name = "main-neptune-instance-${count.index + 1}" }}Keyspaces with Terraform
Section titled “Keyspaces with Terraform”# ============================================================# Keyspaces Keyspace# ============================================================
resource "aws_keyspaces_keyspace" "main" { name = "main_keyspace"}
# ============================================================# Keyspaces Table# ============================================================
resource "aws_keyspaces_table" "users" { keyspace_name = aws_keyspaces_keyspace.main.name table_name = "users"
# Schema column { name = "user_id" type = "uuid" }
column { name = "name" type = "text" }
column { name = "email" type = "text" }
column { name = "created_at" type = "timestamp" }
# Partition key partition_key { name = "user_id" }
# Clustering key (optional) clustering_key { name = "created_at" order_by = "DESC" }
# Capacity mode capacity { read_capacity_units = 100 write_capacity_units = 100 }
# Or use on-demand # capacity { # throughput_mode = "PAY_PER_REQUEST" # }
# Default TTL default_time_to_live = 86400 # 24 hours
# Encryption encryption { type = "AWS_OWNED_KMS_KEY" }}25.8 Database Selection Guide
Section titled “25.8 Database Selection Guide” AWS Database Selection Guide+------------------------------------------------------------------+| || Use Case | Recommended Database || ----------------------------|----------------------------------|| Relational data | RDS, Aurora || Document storage | DocumentDB, DynamoDB || Key-value, simple | DynamoDB || Graph relationships | Neptune || Time-series data | Timestream || Wide-column (Cassandra) | Keyspaces || Ledger/audit trail | QLDB || In-memory caching | ElastiCache || ----------------------------|----------------------------------|| Need SQL? | RDS, Aurora, DocumentDB, QLDB || Need ACID? | RDS, Aurora, DocumentDB, QLDB || Need flexible schema? | DynamoDB, DocumentDB || Need complex queries? | RDS, Aurora, Neptune || Need low latency? | DynamoDB, ElastiCache || |+------------------------------------------------------------------+25.9 Exam Tips
Section titled “25.9 Exam Tips”- DocumentDB: MongoDB-compatible, document storage
- Neptune: Graph database, Gremlin/SPARQL/openCypher
- Timestream: Time-series, auto-tiering (memory to magnetic)
- Keyspaces: Cassandra-compatible, serverless
- QLDB: Ledger database, immutable, cryptographically verifiable
- DocumentDB: Up to 64 TB storage, 15 read replicas
- Neptune: Optimized for graph traversals
- Timestream: Built-in time-series functions
- Keyspaces: CQL support, pay-per-request
- QLDB: No blockchain overhead, centralized ledger
Next Chapter
Section titled “Next Chapter”Chapter 26: AWS KMS - Key Management Service
Last Updated: February 2026