[refactor] Kafka 이용한 Stat 비동기 업데이트 적용#192
Open
dlsrks1021 wants to merge 4 commits into
Open
Conversation
1 task
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.
🛰️ Issue Number
🪐 작업 내용
기존 Stat 업데이트는 Redis-MySQL의 동시 쓰기 방식으로 동작했습니다.
이는 기존 Redis 적용 때 말씀드린 것처럼 유저 수의 증가에 따라 MySQL 부하를 줄 수 있고, 그에 따라 응답 시간이 증가할 수 있다는 단점이 있습니다.
이를 위해 이번 PR에서는 Kafka를 적용해 MySQL 업데이트는 비동기 배치 작업으로 수행할 수 있도록 했습니다.
간단한 동작 방식은 아래와 같습니다.
Stat update -> Kafka Producer -> [topic:stat-changes] -> Kafka Consumer -> MySQL
// 추가로 google java style action의 오류 문제를 JDK 버전 설정으로 해결했습니다.
📚 Reference
#111 [refactor] 랭킹 조회 Redis 적용
✅ Check List