How roldophe/redis-caching works
This Spring Boot demo exposes user CRUD over REST, with service-layer caching backed by Redis and user persistence in H2. The documented flow is client request → user API → service operations → cache or repository/database; create, update, delete, lookup-by-ID/email, and cache clearing are distinct capabilities. README examples document cache behavior and repository use, but Java sources were not sampled, so controller-to-service and configuration wiring are left unverified where necessary.
Main entry points: UserService.java User Service · UserController.java User Controller · UserRepository.java User Repository · application.yaml Application Settings
Components 10
REST API
- User Controller
src/main/java/com/example/redis_caching/controller/UserController.java
User Operations
- User Service
src/main/java/com/example/redis_caching/service/UserService.java - User Entity
src/main/java/com/example/redis_caching/entity/User.java - Sample Data Loader
src/main/java/com/example/redis_caching/config/DataInitializer.java
Persistence and Cache
- User Repository
src/main/java/com/example/redis_caching/repository/UserRepository.java - H2 Database
- Redis Cache
- Redis Configuration
src/main/java/com/example/redis_caching/config/RedisConfig.java - Application Settings
src/main/resources/application.yaml
Other components
- API Client
Connections 6
- API Client → User Controller: calls REST API
README.md - User Controller → User Service: delegates operations
- User Service → User Repository: queries and saves
README.md - User Repository → H2 Database: persists users
README.md - User Service → Redis Cache: caches results
README.md - Application Settings → Redis Cache: sets cache TTL
README.md