Repository navigation
feat(auction): 경매 목록·상세 조회 캐시 적용 - #245
Merged
Merged
Conversation
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.
What changed and why
1초 몰림 부하 테스트에서 경매 상세 조회는 앱 CPU가 100%까지 올랐고(8,000건, 초당 약 318건), 목록 조회는 DB 연결 대기로 응답 중앙값이 5초였습니다. 같은 데이터를 요청마다 다시 읽지 않도록 목록·상세에 앱 메모리 캐시를 적용했습니다.
AuctionQueryCache추가 (Caffeine)경매 ID + 세대 번호를 키로 사용하고,AuctionChangedEvent커밋 후 세대 번호를 올려 다음 조회부터 새 값을 읽습니다. 경매 삭제는revision이 오르지 않아 세대 번호를 사용합니다.상태 + 페이지 + 크기를 키로 1초 보관합니다.serverTime은 캐시와 상관없이 응답 시각을 넣습니다.입찰, SSE
snapshot(), 결과 조회, 내 입찰 조회, 주최자 수정 응답은 캐시를 쓰지 않습니다.Affected domain and invariants
경매 조회만 변경했습니다. 입찰, 크레딧, 종료 트랜잭션과 잠금 순서는 바꾸지 않았고, 경매 불변식에 영향을 주는 쓰기 경로도 변경하지 않았습니다.
Tests
AuctionQueryCacheTest: 14개 중 7개 실패 확인bash tools/harness/harness-check.sh: PASS, 테스트 105개 통과FULL=1 bash tools/harness/harness-check.sh: PASS, 테스트 891개 통과AuctionQueryCacheTest가 검출: 커밋 전 무효화, 세대 번호 미증가,serverTime미갱신, 동시 조회 미병합, 목록 키 페이지 누락, 목록·상세 만료 누락부하 테스트 재측정(AU-2, AU-3)은 머지 뒤 진행합니다.
Contract / documentation updates
docs/contracts/api/auction.md: 목록은 최대 1초 지연될 수 있고, 상세는 경매 변경 커밋 후 바로 반영되며 닉네임 변경은 최대 1초 지연될 수 있음을 추가했습니다.docs/domains/auction/transactions.md: 조회 캐시 동작을 추가했습니다.docs/domains/auction/load-test.md: 관련 코드 경로를 고쳤습니다.build.gradle: Caffeine 의존성과 테스트용 캐시 비활성화 설정을 추가했습니다.application.yml:restless.auction.query-cache설정을 추가했습니다.Remaining risks
Closes #241