DB

[Redis] Spring Boot Redis 기본 설정

Raconer 2024. 2. 24. 16:44
728x90

🔧 Spring Boot Redis 기본 환경

✅ 환경 정보

항목 내용
Spring Boot 3.2.3
Java 17
Build Tool Gradle

📦 의존성 설정 (build.gradle)

dependencies {
    // Spring Boot 기본 스타터
    implementation 'org.springframework.boot:spring-boot-starter'
    implementation 'org.springframework.boot:spring-boot-starter-web'

    // Redis 연동
    implementation 'org.springframework.boot:spring-boot-starter-data-redis'

    // Spring Session with Redis
    implementation 'org.springframework.session:spring-session-data-redis'
}

추가 참고:
spring-boot-starter-data-redis는 내부적으로 Lettuce 클라이언트를 기본으로 사용합니다.
필요시 Redisson 등으로 변경할 수도 있습니다.


📘 Redis 클라이언트 요약

클라이언트 설명
Lettuce 비동기/논블로킹 방식, Netty 기반, Spring 기본 내장
Jedis 블로킹 방식, 멀티스레드 환경 부적합
Redisson 고급 기능 지원 (분산 Lock, Map, Queue 등), 상용에서도 자주 사용

📚 참고 예제

GitHub: Redis Study Repository

위 저장소에는 Spring Boot + Redis를 활용한 실습 코드와 설명이 정리되어 있습니다.

728x90

'DB' 카테고리의 다른 글

[Redis] Pub/Sub을 이용한 채팅방 구현  (0) 2024.03.01
[Redis]리더 보드란?  (0) 2024.03.01
[Redis] Data Type (Sorted Sets, Bitmaps, HyperLogLog)  (0) 2024.02.23
[Redis] Data Type (Strings, Lists, Sets, Hashes)  (0) 2024.02.23
[Redis] Redis란?  (0) 2024.02.20