✨ feat: 최근 게시글을 redis에 캐싱할 때, comments 데이터가 포함되도록 추가 #455
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
recent로 최근 게시글을 가져올 때, comments 값에 대한 일관성이 보장되어야 하는가?
예를 들어서 어떤 인기 블로그 글이 올라온지 1초만에 댓글이 달리고
지구 반대편 인터넷이 느린 곳에 사는 사람이 recent를 늦게 받으면 댓글 수와 redis에 캐싱된 값이 다를 수는 있겠더라고요.
하지만 예시와 같은 극단적인 상황이 거의 생기지 않을 것 + 댓글 수가 다르다고 치명적인 문제는 발생하지 않을 것, 두 가지의 이유로 Redis와 MySQL을 확인하며 최신 글의 comments 동기화에 대한 필요성이 없다고 느꼈습니다.
그리고 트렌드 포스트의 sse는 Redis에 feedId만 캐시하고 mysql에서 값을 가져오기 때문에 동기화 문제는 없을 것이라 생각했습니다.
📋 작업 내용
📷 스크린 샷(선택 사항)