refactor: 지출 도메인 리팩토링#53
Merged
Merged
Conversation
… feat/50-expense-refactor-3 # Conflicts: # Backend/src/main/java/com/luckyseven/backend/domain/budget/entity/Budget.java # Backend/src/main/java/com/luckyseven/backend/domain/expense/service/ExpenseService.java
johnhuh619
approved these changes
May 20, 2025
johnhuh619
left a comment
Collaborator
There was a problem hiding this comment.
확인했습니다. 이번 리팩토링도 많이 배워갑니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#️⃣연관된 이슈 번호
📝작업 내용
1. 지출 내역 리스트 조회 시 문제점 파악
->
HikariCP 커넥션 풀의 기본 설정(10개)을 초과해 최대 37개 요청이 대기-> 캐시가 있었다면 대기 없이 응답 가능했을 부분에서 병목 발생
->
LEFT JOIN,페이징등으로 쿼리 자체의 비용도 높음2. 개선
@CacheEvict로는 특정 키 하나만 지우거나, allEntries=true로 전체를 날리는 것만 가능캐시 적용 후 성능 (k6 부하 테스트)
결과
응답 시간 대폭 단축 (평균 55.9→20.0 ms, p95 214.2→89.8 ms)
RPS 증가 (732→2,000)
커넥션 풀 대기 해소 (Pending Threads 감소)
🧪 테스트 여부
💬리뷰 요구사항
Budget에 락을 걸면Team도 락이 걸려서 골치아파서 조금 봐야할거 같습니다.