Chapter 61 · Amazon Elasticache
Subchapter 61.48
references/setup/serverless-vs-node.mdMarkdown13 KBView on GitHub
These constraints override all other guidance. Never recommend serverless for these workloads.
Vector search MUST use node-based Valkey 8.2 or above (recommend 9.0). Serverless does not support vector search. Any workload requiring vector similarity (semantic cache, RAG, conversational memory with vector retrieval, recommendations via embeddings, semantic search) MUST be deployed on a node-based Valkey 8.2 or above cluster (recommend 9.0). Do NOT suggest serverless as a fallback or future option for vector search.
Global Datastore MUST use node-based clusters. Multi-Region replication via Global Datastore is not available on serverless. Any workload requiring cross-Region reads or disaster recovery via Global Datastore MUST use a node-based deployment.
ElastiCache Serverless supports Valkey 7.2+, Redis OSS 7.1+, and Memcached 1.6.22+. Regional availability may vary; check the ElastiCache pricing page (opens in a new tab) or the AWS Region Table before selecting a deployment model.
Default to serverless unless one of the hard routing rules or node-based requirements below applies.
| Factor | Serverless | Node-Based |
|---|---|---|
| Setup time | 1-5 minutes | 5-15 minutes |
| Capacity planning | Automatic | Manual (choose node type, count) |
| Scaling | Instant, automatic | Manual or auto-scaling policies |
| Maintenance windows | None (zero downtime) | Required for patching |
| Pricing model | Pay per GB stored + ECPUs consumed | Pay per node-hour (reserved or on-demand) |
| Minimum cost | ~$6/month (Valkey) | Depends on node type |
| In-transit encryption (TLS) | Always on (cannot disable) | Optional (recommended) |
| Authentication | RBAC/IAM only (no AUTH tokens) | RBAC/IAM and AUTH tokens (legacy) |
| Best for | Variable/unpredictable traffic, new projects, getting started | Predictable high-throughput, cost optimization at scale |
python3 scripts/price_calculator.py --mode node --node-type <type> --nodes <N> --show-ri-options for current estimates)These constraints are inherent to the serverless deployment model and cannot be changed. Verify each one against the workload requirements before choosing serverless.
ssl=True in valkey-py, tls: {} in ioredis, --tls in valkey-cli). If the application cannot use TLS, use node-based instead.CacheUsageLimits.DataStorage.Maximum. Maximum per-slot storage is 32 GiB.CacheUsageLimits.ECPUPerSecond.Maximum lets you set a lower ceiling for cost control, but cannot exceed 15,000,000. Per-slot throughput ranges from 30,000 to 90,000 ECPU/s.CreateServerlessCacheSnapshot for on-demand snapshots. Restore via create-serverless-cache --snapshot-arns-to-restore. Automatic daily snapshots are not enabled by default; set SnapshotRetentionLimit > 0 to enable them.Serverless bills in ElastiCache Processing Units (ECPUs). How commands are charged:
Use scripts/command_classifier.py with INFO commandstats output for ECPU estimation of an existing workload. Note: the classifier uses heuristic approximations; actual ECPU consumption may differ. For precise billing, use CloudWatch ECPU metrics on a running serverless cache.
| Metric | What it tells you |
|---|---|
ElastiCacheProcessingUnits (Sum) | Total ECPUs consumed per period. Primary cost driver. |
ThrottledCmds (Sum) | Commands rejected due to ECPU limit. Any value > 0 needs action. |
SuccessfulReadRequestLatency (p99) | Read latency. Baseline is single-digit ms; spikes suggest hot keys or large payloads. |
SuccessfulWriteRequestLatency (p99) | Write latency. Same baseline expectations as reads. |
BytesUsedForCache | Storage consumed. Drives the storage component of the bill. |
CurrConnections | Active connections against the 65K limit. |
If ThrottledCmds > 0 sustained across multiple minutes, raise the ceiling:
aws elasticache modify-serverless-cache \
--serverless-cache-name <name> \
--cache-usage-limits '{"ECPUPerSecond": {"Maximum": <higher-value>}}' \
--region <region>Before increasing, check whether expensive commands (SORT, large LRANGE, unoptimized Lua scripts) are inflating ECPU consumption. Optimizing command patterns is cheaper than raising limits.
{tag} to colocate related keys on the same slot when using multi-key commands.Proper connection pooling is critical given the 65K per-cache connection limit (documented above). For per-library pool configuration and code examples, see ../monitoring/client-tuning-and-diagnostics.md (Connection Pooling section).
Key serverless-specific guidance:
CurrConnections in CloudWatch. Alert at 50K to leave headroom for spikes.SnapshotRetentionLimit > 0. The default is 0 (disabled).CreateServerlessCacheSnapshot for on-demand logical snapshots of serverless caches.SnapshotRetentionLimit controls how many days automatic snapshots are kept (0 disables, max 35 days). Set via --snapshot-retention-limit on create-serverless-cache or modify-serverless-cache.export-serverless-cache-snapshot API to export a snapshot to S3, then copy the S3 object to the target region. For long-term retention beyond 35 days, consider node-based clusters which support copy-snapshot --target-bucket for S3 export.For workloads over ~50 GB with steady traffic, run scripts/price_calculator.py --mode serverless --data-gb <N> --ops-per-sec <N> and --mode node --node-type <type> --nodes <N> --show-ri-options to compare. Reserved node-based instances can be cheaper at scale, but serverless eliminates operational overhead.