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.
#️⃣연관된 이슈
📝작업 내용
Util(service) class를 통해 캐싱을 제어할지 아니면 @Cacheable @CacheEvict과 같은 어노테이션을 사용하여 캐싱을 할지 고민했다.
Util로 관리하면 일관성이 유지되고 TTL 설정, 데이터 삭제 등도 직접 제어할 수 있어 관리 측면에서 일관성이 있고 정책을 직접 조정할 수 있는 점에서 유지보수가 용이하다.
어노테이션을 사용하면 단순하고 빠르고 간단하게 캐싱을 적용할 수 있으며 AOP 방식으로 동작하여 비즈니스 로직과 캐싱 로직이 분리되어 코드 복잡도를 낮추고 유지보수할 코드량이 줄어든다는 점에서 유지보수가 용이하다.
-> 처음에 Util로 작성하였으나 단순한 조회 캐싱이 될 것으로 예상하여 어노테이션 방식의 캐싱을 사용하게 되었다.
최종적으로 작성하고 보니 redis 자료구조 선택의 한계로 인해 세밀한 조작이 어려워 Util로 관리하는 것이 좋을 것 같다.