Skip to content

Conversation

@anxi01
Copy link
Owner

@anxi01 anxi01 commented Jan 27, 2025

AS-IS

  • 리프레시 토큰을 MySQL에 관리

TO-BE

  • 리프레시 토큰을 Redis에서 관리

사용 이유

  • Redis는 Key-Value 형태의 NoSQL이며, 적은 메모리로 저장 가능
  • O(1) 시간 복잡도로 빠른 조회 가능
  • In-Memory DB라 빠른 접근 가능
  • TTL 설정 가능

배포 Docker YML

  redis:
    container_name: zerozero_redis
    image: redis:6.0.9
    ports:
      - '6379:6379'
    volumes: 
      - redis_data:/data
    networks:
      - zerozero_network
    restart: always

networks:
  zerozero_network:
    driver: bridge

volumes:
  redis_data:

고려 지점

  • Redis Template와 Redis Repository가 있는데 Redis Repository을 이용함.
    • Redis Template를 사용해 Configuration까지 설정할 필요를 못느낌.
    • 추후 캐싱 처리 기능 구현 시 도입 시 변경 가능성 존재

@anxi01 anxi01 self-assigned this Jan 27, 2025
@anxi01 anxi01 force-pushed the fix/redis-refreshtoken branch from df114c2 to e0647b9 Compare January 27, 2025 10:27
@anxi01 anxi01 linked an issue Jan 27, 2025 that may be closed by this pull request
@anxi01 anxi01 linked an issue Jan 27, 2025 that may be closed by this pull request
@anxi01 anxi01 merged commit fabf716 into dev Jan 27, 2025
@anxi01 anxi01 deleted the fix/redis-refreshtoken branch January 27, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: RefreshToken의 경우 Redis를 통해 관리한다

2 participants