Skip to main content

Redis Cache Setup

Overview

Redis serves as a critical component for:

  • Session management
  • Real-time features
  • Caching layer
  • Performance optimization

Deployment Options

Cloud Provider Options

Google Cloud Memorystore

  1. Enable and Configure
    • Go to Google Cloud Console
    • Enable Memorystore for Redis API
    • Create new Redis instance:
      • Choose Basic tier for standard workloads
      • Select region (same as your GKE cluster)
      • Set memory capacity (minimum 1GB)
      • Enable authentication (recommended)
    • Configure VPC network and authorized networks

Redis Cloud

  1. Create account at Redis Cloud
  2. Create new subscription:
    • Fixed plan (minimum 1GB)
    • Choose region
    • Enable password protection
  3. Create database with default settings

Digital Ocean Redis

  1. Access Digital Ocean Console
  2. Create Database > Redis
  3. Configure:
    • Choose smallest plan
    • Select datacenter
    • Enable eviction policy
tip

Managed services provide:

  • Automatic backups
  • High availability
  • Security patches
  • Performance monitoring

Requirements

Minimum Specifications

  • Redis 6.0 or higher
  • 1GB memory
  • Network access from platform
  • Password protection enabled
  • Persistence enabled
  • Automatic backups
  • Monitoring setup
  • Eviction policies configured

Information Collection

Validation

Test your Redis connection:

# Get the Memorystore instance connection details
REDIS_HOST=$(gcloud redis instances describe [INSTANCE_ID] \
--region=[REGION] --format='get(host)')
REDIS_PORT=$(gcloud redis instances describe [INSTANCE_ID] \
--region=[REGION] --format='get(port)')

# Test connection using redis-cli
redis-cli -h $REDIS_HOST -p $REDIS_PORT ping

Troubleshooting

Common issues and solutions:

  1. Connection Failures

    • Verify credentials
    • Check network/firewall rules
    • Confirm TLS settings
    • Validate endpoint format
    • For Memorystore: verify VPC peering
  2. Performance Issues

    • Monitor memory usage
    • Check eviction policies
    • Review connection limits
    • Verify resource allocation
    • For Memorystore: check instance tier

Next Steps

  1. ✅ Set up Redis instance
  2. ✅ Configure security settings
  3. ➡️ Proceed to S3 Compatible Storage Setup
Need Help?

Contact [email protected] if you encounter any issues.