BackEnd

redisson-spring-boot-starter VS spring-boot-starter-data-redis

Raconer 2025. 6. 5. 16:33
728x90

Spring Boot에서 Redis를 연동할 때 흔히 사용하는 두 가지 라이브러리가 있습니다

  • spring-boot-starter-data-redis
  • redisson-spring-boot-starter

설명

  spring-boot-starter-data-redis redisson-spring-boot-starter
설명 Spring 공식이 제공하는 Redis 통합 스타터로, 기본적인 Key-Value 저장소 기능을 제공 Redisson은 Redis/Valkey를 위한 고급 Java 클라이언트로, Redis의 기능을 확장하여 Java 객체 기반으로 쉽게 사용할 수 있도록 지원
주요 특징 • RedisTemplate, StringRedisTemplate을 통한 low-level 조작
• @RedisHash + RedisRepository를 통한 도메인 매핑
• Lettuce (기본), Jedis 클라이언트 선택 가능
• 기본 자료구조 조작: opsForValue, opsForHash, opsForZSet, etc.
• 분산 락, 세마포어, CountDownLatch, Pub/Sub 큐 등 고급 기능 지원
• RMap, RLock, RQueue, RTopic 등 Java 스타일 객체 제공
• Netty 기반 논블로킹 클라이언트 (비동기 API 제공)
• Cache TTL, Local Cache, Cluster 구성 등 다양한 옵션 내장
제한 사항 • 분산 락, 세마포어, 큐 등 고급 동시성 기능은 미제공
• 직접 구현 필요
• 비동기 API나 고급 컬렉션 기능은 없음
• 데이터 접근이 JPA 스타일이 아닌 Redisson 전용 API 필요
• Spring Repository 연동은 미지원 (직접 service 단에서 사용)
• 기본 RedisTemplate과는 통합되지 않음

차이점

  spring-boot-starter-data-redis redisson-spring-boot-starter
목적 Key-Value 저장소 연동 고급 동시성 제어, 분산 객체
API 스타일 Spring Repository, Template Java 객체 기반 API (RMap, RLock)
고급 동기화 기능 지원 미지원 지원 (RLock, RCountDownLatch 등)
클라이언트 Lettuce or Jedis Redisson(Netty 기반)
비동기/Reactive API 일부 제한적 지원 기본 지원 (CompletableFuture 등)
캐시 및 TTL 제어 expire() 수동 설정 개별 항목 TTL 지원, Local Cache 가능

  상황
spring-boot-starter-data-redis * 단순한 캐시, 세션 저장, 조회 성능 개선 용도
* RedisRepository 사용한 간단한 CRUD 구조
redisson-spring-boot-starter * 분산 락, 큐, 세마포어, 이벤트 처리 등 동시성 제어 필요
* 클러스터 환경에서 고급 캐시 TTL, 비동기 작업 필요

참고

• 🔗 Redisson 공식 문서: https://redisson.pro/docs/integration-with-spring/#spring-boot-starter
• 🔗 Baeldung - https://www.baeldung.com/spring-data-redis-tutorial

728x90