[#39] 쿠폰 중복 발급 검증을 API 레이어로 이동 및 캐시-DB 2단계 조회 개선#40
Merged
SinJeongEun merged 2 commits intomainfrom Mar 26, 2026
Merged
Conversation
1. 쿠폰 발급 요청 시 컨트롤러에서 사전 중복 검증 수행
2. isIssued → checkCouponIssueStatus 리네이밍
3. 캐시 miss 시 DB fallback 조회 후 캐시 갱신(cache warming) 추가
4. issueCoupon에서 중복 검증 로직 제거 (컨트롤러로 이동)
…실행하도록 변경 - Redis 실패 시 예외를 전파하지 않고 로깅 처리 - 큥이기 때문에 consumer에 동일유저의 요청이 중복올 수 있음. comsumer에서도 발급유저조회 추가
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.
: redis는 캐시로 사용하고있다. redis save 실패되더라고, 추후 쿠폰발급조회api 에서 cache aside
=> 우선 두 트랜잭션을 분리하지 않겠다. redis 실패되더라도, 유저1에게 중복 발행되지는 않기 때문.