[refactor] Redis, QueryDSL를 이용한 투표 기능 동시성 처리 및 성능 개선 #160
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#️⃣연관된 이슈
📝작업 내용
[투표 기능]
Redis의 분산 락과 캐싱을 활용하여 투표 생성 시 성능을 최적화하였습니다. 락을 사용하여 동시 투표를 방지하고, 캐싱을 통해 불필요한 DB 조회를 최소화하여, 실시간 투표 성능을 개선하였습니다.
[투표 결과 조회 기능]
기존 방식은 유저 목록을 조회 후 각 사용자에 대한 투표 정보를 가져오는 과정에서 여러 번의 DB 호출이 있었고,
여행 계획에 속한 모든 유저를 조회한 후, 각 사용자의 투표 정보를 조회하는 방식이므로 N+1 문제가 발생할 가능성이 높았지만,
이를 QueryDSL 를 통해 DB 호출 횟수를 한 번으로 줄였고, 필요한 데이터만 추출함과 동시에 실시간 조회 성능도 개선할 수 있었습니다.
스크린샷 (선택)
💬리뷰 요구사항(선택)