This page requires JavaScript to display.
B
Unpacking...
← Cloud Platforms
Cloud Platforms

Other AWS Databases

Purpose-built databases: DocumentDB, ElastiCache and MemoryDB, Neptune, Timestream, Keyspaces and OpenSearch, with examples and a guide to choosing.

Contents
1. Purpose-Built Databases on AWS 2. DocumentDB 3. ElastiCache & MemoryDB 4. Neptune for Graph Problems 5. Timestream, Keyspaces & OpenSearch 6. Choosing a Database 7. Common Interview Questions

1. Purpose-Built Databases on AWS

AWS offers a database for each data model. Data engineers often extract from these, feed them as serving layers, or choose between them in design discussions.

ServiceModelTypical use
RDS / AuroraRelationalTransactions, ERP/CRM back-ends
DynamoDBKey-value / documentHigh-scale apps, pipeline state, serving
DocumentDBDocument (MongoDB-compatible API)JSON document apps migrating from MongoDB
ElastiCache (Valkey, Redis OSS, Memcached)In-memory key-valueCaching, sessions, leaderboards, rate limiting
MemoryDBDurable in-memory (Valkey/Redis compatible)Primary database needing microsecond reads with durability
NeptuneGraph (Gremlin, openCypher, SPARQL)Fraud rings, recommendations, knowledge graphs
KeyspacesWide-column (Cassandra-compatible)Cassandra workloads without managing clusters
TimestreamTime seriesIoT, metrics and telemetry with time-based queries
OpenSearch ServiceSearch and log analytics (also vectors)Full-text search, log analytics, vector search for RAG
RedshiftColumnar warehouseAnalytics and BI

2. DocumentDB

from pymongo import MongoClient

client = MongoClient("mongodb://app:<password>@docdb-cluster.cluster-xyz.ap-south-1.docdb.amazonaws.com:27017/"
                     "?tls=true&tlsCAFile=global-bundle.pem&replicaSet=rs0&readPreference=secondaryPreferred"
                     "&retryWrites=false")
orders = client["shop"]["orders"]
orders.create_index([("customer_id", 1), ("order_ts", -1)])
recent = list(orders.find({"customer_id": "C1"}).sort("order_ts", -1).limit(10))

3. ElastiCache & MemoryDB

import redis, json

r = redis.Redis(host="risk-cache.xxxxxx.aps1.cache.amazonaws.com", port=6379, ssl=True)

def get_risk_score(account_id: str) -> dict:
    cached = r.get(f"risk:{account_id}")
    if cached:
        return json.loads(cached)  # cache hit: microseconds
    score = load_from_feature_store(account_id)  # cache miss: slower source
    r.setex(f"risk:{account_id}", 300, json.dumps(score))  # expire after 5 minutes
    return score

4. Neptune for Graph Problems

// openCypher: accounts sharing a device with a known fraudulent account (fraud ring detection)
MATCH (bad:Account {flagged: true})-[:USED]->(d:Device)<-[:USED]-(other:Account)
WHERE other <> bad
RETURN d.device_id, collect(DISTINCT other.account_id) AS linked_accounts
LIMIT 50;

Graph databases shine when the question is about relationships several hops deep (rings, networks, lineage). Load data in bulk from S3 with the Neptune bulk loader.

5. Timestream, Keyspaces & OpenSearch

ServiceKey ideas
TimestreamMeasures with dimensions and timestamps; memory store for recent data and magnetic store for history; SQL with time-series functions (binning, interpolation). Timestream for InfluxDB offers managed InfluxDB
KeyspacesServerless Cassandra Query Language (CQL); partition keys and clustering columns like Cassandra; on-demand or provisioned capacity
OpenSearch ServiceIndexes documents for full-text search and aggregations; OpenSearch Serverless removes cluster sizing; k-NN vector indexes support semantic search and RAG; ingest via Firehose or OpenSearch Ingestion

6. Choosing a Database

If you need…Use
Relational integrity, joins, transactionsRDS / Aurora
Predictable single-digit ms at any scale by keyDynamoDB
Microsecond reads, cachingElastiCache (MemoryDB if it must be durable)
Flexible JSON documents with MongoDB driversDocumentDB
Multi-hop relationship queriesNeptune
Time-stamped metrics and telemetryTimestream
Full-text, log or vector searchOpenSearch Service
Large-scale analyticsRedshift, or Athena on S3

7. Common Interview Questions

QuestionShort answer
What is "purpose-built databases"?Choosing the database whose data model and access patterns fit each workload, instead of one database for everything
ElastiCache vs MemoryDB?ElastiCache is a cache (may lose data); MemoryDB is a durable in-memory primary database with a multi-AZ transaction log
When would you use a graph database for fraud?To find rings and shared attributes (devices, addresses, cards) across many hops, which is slow and complex with relational joins
Is DocumentDB the same as MongoDB?It is MongoDB-API-compatible but a different implementation; most drivers and many features work, but compatibility must be tested