Skip to content

refac: Redisson 제거#319

Merged
Zy0ung merged 6 commits intodevfrom
epic/count-refac
Jun 26, 2025
Merged

refac: Redisson 제거#319
Zy0ung merged 6 commits intodevfrom
epic/count-refac

Conversation

@Zy0ung
Copy link
Contributor

@Zy0ung Zy0ung commented Jun 26, 2025

기능 설명

작업 내용

추천 중복 방지 로직 정비

Redis Set 자료구조를 이용해 추천 중복을 방지합니다.

Key 형식: recommend:users:{콘텐츠타입}:{콘텐츠ID}

추천 시, 해당 Set에 사용자 ID를 추가하고, 이미 존재할 경우 예외를 발생시킵니다.
추천 취소 시, 사용자 ID를 Set에서 제거하고 Hash의 추천 수를 -1 처리합니다.

게시글 삭제 시 캐시 정리 기능 추가
게시글 삭제와 동시에 관련 Redis 캐시(Key) 를 명시적으로 삭제합니다.

삭제 대상:
조회수/댓글수/추천수를 담고 있는 Hash: count:{content Type}:{contentId}
추천자 목록을 담고 있는 Set: recommend:users:{content Type}}:{contentId}

비교 Test 코드는 계속 실행될 필요가 없어보여 주석처리 했습니다!

테스트코드
100명의 서로 다른 유저가 동시에 추천 요청
결과 측정: 최종 추천 수가 100인지 확인 -> 둘다 추천수 100
전체 처리 시간 측정: Redisson 사용할때 1881 ms -> Redisson 제거 후 733ms

수정 사항

추가 작업 예정

테스트

  • 단위 테스트 확인
  • 빌드 테스트 확인
  • 비정상 입력 시 오류 메시지 확인
  • AWS에 서버 올라가는지 / Swagger 확인

@Zy0ung Zy0ung requested review from Kyoungwoong and dong3058 June 26, 2025 07:52
@Zy0ung Zy0ung self-assigned this Jun 26, 2025
Copy link
Contributor

@Kyoungwoong Kyoungwoong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다

@dong3058
Copy link

고생많으셨습니다.

@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
8 Security Hotspots
0.0% Coverage on New Code (required ≥ 80%)
E Reliability Rating on New Code (required ≥ A)
D Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@Zy0ung Zy0ung merged commit c9615c7 into dev Jun 26, 2025
2 of 3 checks passed
@Zy0ung Zy0ung deleted the epic/count-refac branch June 26, 2025 13:00
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.

3 participants