Redis

Cheatsheet

Cheatsheet - CLI

CLI - Verify connection to Redis server

redis-cli -h $host -p $port ping

Use cases

Query Cache

API Gateway Cache for user sessions

Pub/Sub

Redis Pub/Sub (Publish/Subscribe) is a messaging pattern where clients can subscribe to channels, and other clients can publish messages to these channels. Clients that are subscribed to a channel receive all the messages published to that channel. This messaging pattern is useful for broadcasting messages to multiple clients.

Good for real-time notifications, chat apps, or any use case where speed and simplicity are key.

Think of it like: A group chat where everyone hears what’s said, but once it’s said, it’s gone forever.

Redis Streams

Cache-aside (Lazy-loading)

  • Improves read performance

Write-Behind (Write-Back)

Write-Through

Read-Replica

Resources

Managing Redis

Persistence

Spring Data Redis

Clients

Admin

Redis Insight

Redis Insight - Docker