Redis Articles
Articles covering Redis integration patterns with Spring Boot including caching, session management, and Pub/Sub.
-
How to Write Integration Tests with PostgreSQL, Kafka, and Redis Using Spring Boot Testcontainers
A practical guide to writing multi-container integration tests that simultaneously launch PostgreSQL, Kafka, and Redis using Spring Boot 3.1+'s @ServiceConnection, plus speeding up CI with reuse configuration.
-
How to Implement JWT Refresh Tokens with Spring Security
A guide to issuing, rotating, and revoking access tokens and refresh tokens in Spring Boot, including Redis persistence and reuse detection.
-
How to Implement Idempotency (Idempotency-Key) in Spring Boot REST APIs - Preventing Double Charges and Double Clicks
Explains how to implement the Idempotency-Key header approach in Spring Boot to prevent double charges and double execution caused by double-clicks in payment APIs. Covers implementation code using OncePerRequestFilter and Redis, lock control for concurrent requests, TTL design, and production operation considerations from a practical perspective.
-
How to Use Redis with Spring Boot - Implementation Patterns for Session Management, Caching, and Pub/Sub
Learn how to solve common issues such as sessions not being shared across multiple instances and switching the backend of @Cacheable using Redis. This article covers connection configuration for spring-boot-starter-data-redis, session externalization with Spring Session, RedisCacheManager, and Pub/Sub implementation, with code examples for each use case.
-
How to Use Spring Boot Caching - Easy Performance Improvement with @Cacheable
A practical guide covering Spring Cache Abstraction mechanics, how to use @Cacheable, @CacheEvict, and @CachePut, switching between Caffeine and Redis, and measuring hit rates with Micrometer, all with hands-on code. For beginner to intermediate developers who want to improve response latency from duplicate DB or external API calls with just a few annotations.