Conversation
- 회원가입 시퀀스 다이어그램 (핵심 + 예외 플로우) - 내 정보 조회 시퀀스 다이어그램 (헤더 인증 포함) - 비밀번호 변경 시퀀스 다이어그램 (핵심 + 예외 플로우) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fix : 예제 테스트 코드 오류 해결을 위한 testcontainers 버전 업
Removed the version reference for User entity in requirements.
# Conflicts: # docs/design/브랜드_상품/01-requirements.md # docs/design/좋아요/01-requirements.md
[2주차] 설계 문서 제출 - 김평숙
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Important Review skippedToo many files! This PR contains 192 files, which is 42 over the limit of 150. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (24)
📒 Files selected for processing (192)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can use TruffleHog to scan for secrets in your code with verification capabilities.Add a TruffleHog config file (e.g. trufflehog-config.yml, trufflehog.yml) to your project to customize detectors and scanning behavior. The tool runs only when a config file is present. |
- ProductFacade.getProductDetail()에 @Cacheable("productDetail") 적용 - AdminProductFacade 수정/비활성화 시 @caching으로 productList + productDetail 동시 evict - CacheConfig: 캐시별 독립 serializer(productList/productDetail) + CacheErrorHandler 등록 - CacheErrorHandler: Redis 연결 실패 시 예외를 삼키고 DB 조회로 자동 폴백 - ProductDetailCacheIntegrationTest: 캐시 저장/히트/무효화 5개 케이스 검증 - docs: productDetail 캐시 설계 및 무효화 전략 문서화 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📌 Summary
like_count) 기반 좋아요 정렬을 구현하며, Redis 캐시로 반복 조회 부하를 줄인다.🧭 Context & Decision
문제 정의
brandId필터 + 좋아요 순 정렬을 지원해야 하나, 인덱스 없이 풀스캔 발생선택지와 결정
좋아요 수 관리
like_count): Product에 필드 추가, 이벤트로 동기화 → 선택캐시 무효화
likeCount변경(좋아요 등록/취소)은 evict 없이 TTL 소멸에 위임 — 빈번한 evict로 캐시 효과가 없어지는 것을 방지Redis 장애 대응
🏗️ Design Overview
변경 범위
domain/product,domain/like,application/product,configProductSortType,LikeEventListener,ProductDetailCacheIntegrationTest주요 컴포넌트 책임
Product:likeCount비정규화 필드 + 5개 복합 인덱스 정의LikeEventListener:AFTER_COMMIT+REQUIRES_NEW로likeCount비동기 동기화ProductFacade:@Cacheable("productDetail")— 상세 캐시 적재AdminProductFacade:@Caching— 수정/비활성화 시productList(allEntries) +productDetail(단건) 동시 evictCacheConfig: 캐시별 독립 serializer +CacheErrorHandler등록 (Redis 장애 → DB 폴백)✅ Checklist
🔖 Index
상품 목록 API에서 brandId 기반 검색, 좋아요 순 정렬 등을 처리했다
조회 필터, 정렬 조건별 유즈케이스를 분석하여 인덱스를 적용하고 전 후 성능비교를 진행했다
→ 성능 비교 결과:
docs/performance/index-optimization-plan.md참고❤️ Structure
상품 목록/상세 조회 시 좋아요 수를 조회 및 좋아요 순 정렬이 가능하도록 구조 개선을 진행했다
좋아요 적용/해제 진행 시 상품 좋아요 수 또한 정상적으로 동기화되도록 진행하였다
⚡ Cache
Redis 캐시를 적용하고 TTL 또는 무효화 전략을 적용했다
캐시 미스 상황에서도 서비스가 정상 동작하도록 처리했다
🔁 Flow Diagram
🔖 상품 목록 조회 (brandId 필터 + 좋아요 순 정렬)
sequenceDiagram autonumber participant Client participant ProductFacade participant Redis participant ProductRepositoryImpl participant DB Client->>ProductFacade: GET /api/v1/products?brandId=1&sort=likes_desc ProductFacade->>Redis: GET productList::1_likes_desc_0_20 alt 캐시 히트 Redis-->>ProductFacade: ProductListPage else 캐시 미스 ProductFacade->>ProductRepositoryImpl: findAll(brandId=1, LIKES_DESC, statuses, pageable) Note over ProductRepositoryImpl: BooleanBuilder(brandId) + ORDER BY like_count DESC<br/>idx_product_brand_status_like 인덱스 사용 ProductRepositoryImpl->>DB: SELECT ... WHERE brand_id=1 ORDER BY like_count DESC DB-->>ProductFacade: Page<Product> ProductFacade->>Redis: SET productList::1_likes_desc_0_20 (TTL 5분) end ProductFacade-->>Client: ApiResponse<ProductListPage>❤️ 좋아요 등록 → likeCount 동기화
⚡ 상품 상세 캐시 + Redis 장애 폴백
sequenceDiagram autonumber participant Client participant ProductFacade participant CacheErrorHandler participant Redis participant DB Client->>ProductFacade: GET /api/v1/products/{productId} alt Redis 정상 ProductFacade->>Redis: GET productDetail::{productId} alt 캐시 히트 Redis-->>ProductFacade: ProductDetailInfo else 캐시 미스 ProductFacade->>DB: SELECT product + brand + options + images DB-->>ProductFacade: result ProductFacade->>Redis: SET productDetail::{productId} (TTL 5분) end else Redis 장애 Redis--xCacheErrorHandler: RedisConnectionFailureException CacheErrorHandler-->>ProductFacade: 예외 삼킴 (warn 로그) ProductFacade->>DB: SELECT product + brand + options + images DB-->>ProductFacade: result end ProductFacade-->>Client: ApiResponse<ProductDetailInfo>