Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[회원] RefreshToken DB -> Redis 마이그레이션 작업 #184

Closed
4 tasks done
Hchanghyeon opened this issue Nov 22, 2023 · 0 comments · Fixed by #189
Closed
4 tasks done

[회원] RefreshToken DB -> Redis 마이그레이션 작업 #184

Hchanghyeon opened this issue Nov 22, 2023 · 0 comments · Fixed by #189
Assignees
Labels
리팩토링 [refactor] 실행 결과는 동일하고, 코드 구조만 변경한다. 신규 기능 [feat] 새로운 기능을 추가한다.

Comments

@Hchanghyeon
Copy link
Member

Hchanghyeon commented Nov 22, 2023

📝 개요

  • DB에 저장하던 RefreshToken을 Redis로 마이그레이션 한다.
  • 마이그레이션 필요성
    • 클라이언트가 RefreshToken이 만료되었을 때 로그아웃 API를 서버로 날리지 못하기 때문에 DB에 계속 무한정으로 남아있는 현상
      • Redis의 TTL 기능으로 클라이언트가 RefreshToken이 만료되었을 때 자동으로 Redis에서 삭제 가능
    • 로컬 캐시로도 가능하지만 Prod 환경에서 2대의 서버가 돌아가기 때문에 정합성 일치 문제로 사용 불가능하여 별도의 Redis 서버를 구축

✅ 작업 예정 목록

  • build.gradle에 Redis 의존성 추가
  • CacheConfig에 Redis 연결 설정 추가
  • RefreshToken Redis에 저장하는 기능 구현
  • 테스트 코드 수정 및 사용하지 않는 코드 삭제

📀 관련 데이터 (화면, 테이블, API 등)

화면

테이블 명

  • refresh_token 테이블 삭제 예정

API endpoint

  • POST /members
  • GET /auth/login
  • POST /auth/refresh
  • DELETE /auth/logout
@Hchanghyeon Hchanghyeon added 신규 기능 [feat] 새로운 기능을 추가한다. 리팩토링 [refactor] 실행 결과는 동일하고, 코드 구조만 변경한다. labels Nov 22, 2023
@Hchanghyeon Hchanghyeon added this to the 5차 스프린트 milestone Nov 22, 2023
@Hchanghyeon Hchanghyeon self-assigned this Nov 22, 2023
@github-project-automation github-project-automation bot moved this to 시작 전 in Pickple-back Nov 22, 2023
@Hchanghyeon Hchanghyeon moved this from 시작 전 to 진행 중 in Pickple-back Nov 22, 2023
@Hchanghyeon Hchanghyeon changed the title [회원] RefreshToken DB -> Redis로 마이그레이션 작업 [회원] RefreshToken DB -> Redis 마이그레이션 작업 Nov 22, 2023
@Hchanghyeon Hchanghyeon linked a pull request Nov 22, 2023 that will close this issue
4 tasks
@Hchanghyeon Hchanghyeon moved this from 진행 중 to 코드 리뷰 in Pickple-back Nov 22, 2023
@github-project-automation github-project-automation bot moved this from 코드 리뷰 to 완료 in Pickple-back Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
리팩토링 [refactor] 실행 결과는 동일하고, 코드 구조만 변경한다. 신규 기능 [feat] 새로운 기능을 추가한다.
Projects
Status: 완료
Development

Successfully merging a pull request may close this issue.

1 participant