-
Notifications
You must be signed in to change notification settings - Fork 0
[Seminar] 7주차 과제 #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
chaeyuuu
wants to merge
33
commits into
main
Choose a base branch
from
seminar/#7
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[Seminar] 7주차 과제 #11
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
- 상세 조회: articleId를 키로 개별 캐싱 - 전체 목록 조회: 'all' 키를 사용해 전체 목록 캐싱
- @CacheEvict 를 사용해 새 글 작성 시 articleList 캐시 삭제
- ObjectMapper에 날짜 처리 설정 추가 - ArticleListResponseDto record -> dto로 변경
- 목록 조회 시 최초 1회만 DB에 접근하고 이후 캐시 사용하는지 - 게시글 생성 시 기존 목록 캐시 초기화 확인
- validateAge 메서드 내 예외 문제 해결 - 날짜 형식 오류와 나이 제한 오류가 각각 정확한 에러 코드를 던지도록 해결
6 tasks
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.
🔥Pull requests
closed #10
👷 과제 구현
필수과제
선택과제
구현한 내용에 대해서 설명해주세요
댓글 기능
게시물 DTO 분리
게시물 검색 API
Redis 캐시 도입
대용량 데이터 처리
테스트 코드 작성
구현하며 고민했던 내용을 적어주세요 (사소한 것도 좋아요)
캐시 무효화 전략 (@CacheEvict vs 수동 호출)
: 댓글 수정 및 삭제 파라미터에는 articleId가 별도로 없어서 캐시를 어떻게 무효화할지 고민하였습니다.
Redis vs Caffeine
: Redis와 Caffeine 둘 중 어느 것을 사용할지 고민하였습니다.
이번 프로젝트에서는 실제 서비스 운영 환경에서는 여러 대의 서버를 사용하는 것을 고려하여 Redis를 선택했습니다. 만약 서버가 단일 인스턴스이고 이 과제 하나로 끝난다면 Caffeine을 도입했을 것 같은데, 요구사항에서도 Redis를 도입하라고 되어있어서 선택하였습니다.
Redis 테스트 코드 작성 시 발생한 문제
: 기존에 ArticleListResponseDto는 record 형식으로 구현되어있었습니다. record는 빈 객체라는 개념이 없기에 Jackson에서 올바르게 읽지 못하는 문제가 발생했습니다. 이를 위해 class + @NoArgsConstructor 로 변경하였습니다.
테스트 코드 작성
시간 상 모든 테스트 코드 로직을 작성하지 못했지만 실제 비지니스 오류를 발견하면서 테스트 코드의 중요성을 느꼈습니다 👀
🚨 참고 사항
마지막 과제!! 고생 많으셨습니다 🤶🏻💚 메리크리스마스