Getting started / Add-Ons /
ElastiCache (Redis)

ElastiCache (Redis)

Overview

ElastiCache provides managed Redis caching clusters for your application. Tapitalee automatically provisions Amazon ElastiCache Redis instances in your AWS account, offering high-performance in-memory data storage for caching, session management, and real-time analytics.

Purpose and Benefits

  • High-Performance Caching: In-memory data store with sub-millisecond latency
  • Session Storage: Persistent session management across application restarts
  • Data Structures: Rich data types including strings, hashes, lists, sets, and sorted sets
  • Scalability: Easy scaling with cluster mode and read replicas
  • Persistence: Optional data persistence with snapshots and append-only files
  • Integration: Automatic environment variable injection for seamless app connectivity

CLI Usage

Create ElastiCache Redis Cluster

Create an ElastiCache Redis cluster

tapit create elasticache engine=redis name=cluster_name [variable=REDIS_URL] [size=cache.t4g.micro] [cache_eviction=yes] [serverless=yes] [--ignore-existing]

Parameters

  • engine: Cache engine: redis (required)
  • name: Name for the Redis cluster
  • variable: Environment variable name for the connection URL (default: REDIS_URL)
  • size: ElastiCache node size (default: cache.t4g.micro, ignored if serverless)
  • cache_eviction: Enable cache eviction when memory is full (yes/no)
  • serverless: Use serverless Redis (yes/no)
  • --ignore-existing: Skip creation if a resource with the same name already exists (useful for idempotent scripts)

Examples

# Basic Redis cluster
tapit create elasticache engine=redis name=cache

# Redis with custom configuration
tapit create elasticache engine=redis name=sessionstore variable=SESSION_REDIS_URL size=cache.r7g.large

# Redis without eviction (for persistent data)
tapit create elasticache engine=redis name=datastore cache_eviction=no

List and Show ElastiCache Clusters

List all add-ons attached to the app with their state and configuration

tapit list addons [-w|--wait]

Parameters

  • -w|--wait: Wait until all add-ons reach a stable state (fully ready or fully deleted); exits non-zero if any add-on is in a failed state

Show detailed information about a specific add-on

tapit show addon name=addon_name

Parameters

  • name: Name of the add-on to show (required)

Delete ElastiCache Cluster

Delete an add-on and all its associated AWS resources

tapit delete addon name=addon_name

Parameters

  • name: Name of the add-on to delete (required)

Warning: This permanently deletes the Redis cluster and all cached data. Consider creating a backup if you have important data.

Environment Variables

When you create an ElastiCache cluster, Tapitalee stores the connection details as a Secret Variable in the app’s Variables section. A secure password is automatically generated and embedded in the connection URL.

  • REDIS_URL (or custom variable name): Complete Redis connection string, stored as a Secret variable under the app’s Variables

Because it is stored as a Secret variable, the value is only visible to team members with sufficient privileges, and is injected into your application containers at runtime as an environment variable.

Connection String Format

redis://:password@hostname:6379[/database_number]

Security

  • Encryption: Data encryption in transit is enabled by default
  • Access Control: Only your Tapitalee application containers can access Redis by default
  • VPC Security: Redis instances are isolated within your VPC
  • Credentials: A secure password is automatically generated and stored as a Secret variable in the app’s Variables section, embedded in the REDIS_URL connection string

Instance Types and Performance

Burstable Performance (T4g)

  • cache.t4g.micro: 2 vCPUs, 0.5 GB RAM - Development/testing
  • cache.t4g.small: 2 vCPUs, 1.5 GB RAM - Small applications
  • cache.t4g.medium: 2 vCPUs, 3.2 GB RAM - Medium workloads

Memory Optimized (R7g)

  • cache.r7g.large: 2 vCPUs, 13.1 GB RAM - Memory-intensive caching
  • cache.r7g.xlarge: 4 vCPUs, 26.3 GB RAM - High-performance applications
  • cache.r7g.2xlarge: 8 vCPUs, 52.6 GB RAM - Large-scale caching

Compute Optimized (C7g)

  • cache.c7g.large: 2 vCPUs, 3.4 GB RAM - CPU-intensive workloads
  • cache.c7g.xlarge: 4 vCPUs, 6.8 GB RAM - High-performance computing

Cache Eviction Policies

With Eviction (cache_eviction=yes)

  • By default, Redis removes least recently used keys when memory limit is reached
  • Ideal for: caching, session storage, and temporary data

Without Eviction (cache_eviction=no)

  • This sets the redis noeviction policy, which will return errors when memory limit is reached
  • This guarantees existing data won’t be lost if you hit the memory limit
  • Ideal for: Persistent data, queues, data that shouldn’t be lost

Serverless Mode

Serverless ElastiCache offers fast provisioning and pay-per-use pricing (starting at $6.50/month for 100MB). However, there are important compatibility considerations:

  • Clustered Redis: Serverless mode uses Redis Cluster mode, which distributes data across multiple shards
  • Not compatible with Sidekiq: Sidekiq requires non-clustered Redis because it uses features (like KEYS and SCAN across the entire keyspace) that don’t work correctly in cluster mode
  • Best for: Simple caching use cases where cluster mode compatibility is not required
  • Not recommended for: Background job processors (Sidekiq, Resque), or applications that rely on single-node Redis commands