Feat(Bid) : 레디스에 재고 등록 및 제거 할 때 발생할 수 있는 데이터 유실 방지를 위해 Outbox 패턴 적용 #124
Merged
Feat(Bid) : 레디스에 재고 등록 및 제거 할 때 발생할 수 있는 데이터 유실 방지를 위해 Outbox 패턴 적용 #124
Conversation
Contributor
|
Redis 메모리 관리명령을 DB 에 넣어놓는 방식은 신기하네요 |
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.
변경 된 내용
레디스에 재고 등록 및 제거 시 데이터 유실에 대한 대처가 없음 그러므로 Outbox를 사용하여 데이터 유실을 방지하고자 함
Redis에 재고를 등록하던 로직을Outbox에 등록하고, 이후 스케줄러에 의해Outbox에서 꺼내서 Redis에 등록하도록 수정end()로 인해 판매 경쟁이 종료되었을 때,Redis에서 관리되는 재고 정보를 제거하기 위한 레디스 명령을Outbox에 등록하고, 이후 스케줄러에 의해Outbox에서 꺼내어Redis에서 제거하도록 수정Outbox Handler클래스 추가 (SaveStockHandler,ClearStockHandler)Outbox핸들러 클래스들을Factory클래스에 등록참고사항
Winner정보와 멱등 정보를 등록할 때는Outbox패턴을 사용하면DB 부하를 그대로 받게 되므로 이 경우는
Outbox패턴이 아닌 다른 방식으로 해결함