Skip to content

Conversation

@Do-oya
Copy link
Member

@Do-oya Do-oya commented Oct 21, 2025

📌 Issue


🧐 현재 상황

  • 무턱대고 캐시하면 일관성 문제가 생기므로 먼저 “어떤 데이터, 얼마나 최신해야 하는가”를 합의해야 합니다.

🎯 목표

  • 달성하고자 하는 목표를 설명해주세요.

🛠 작업 내용

  • 작업 할 내용을 입력해주세요.

  • Redis 캐시 대상 및 TTL 정책 수립


🚀 기타 사항

  • 추가적인 내용을 작성해주세요.(참고 자료, 협업 내용)

Summary by CodeRabbit

문서

  • 캐시 도입 전략 Phase 1 문서 추가
    • 캐시 적용 대상 데이터 선정 및 TTL/일관성 정책 정의
    • 캐시 키 설계 및 무효화 전략 (도메인 이벤트 기반)
    • 모니터링 메트릭 정의 (히트율, 미스율, 지연시간 등)
    • 향후 단계별 이행 계획 포함

- DB 및 Elasticsearch 부하를 줄이기 위한 캐시 도입 1단계 분석 문서 추가
- 게시글 상세, 공개 목록, 검색 결과 등 캐시 후보 데이터와 TTL/일관성 정책 정의
- 캐시 키 설계 및 무효화 전략 초안 포함
- Redis 모니터링 지표 및 오픈 이슈 제시
- 배포 및 확장성을 고려한 단계별 도입 제안 작성
@Do-oya Do-oya self-assigned this Oct 21, 2025
@Do-oya Do-oya added the 📃 Docs 문서 작성 및 수정 (README.md 등) label Oct 21, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 21, 2025

Walkthrough

캐시 도입 전략 Phase 1을 정의하는 새로운 문서 추가. 캐시 대상 데이터 선정, TTL 정책, 일관성 정책, 캐시 키 설계, 무효화 전략, 모니터링 메트릭, 미해결 이슈 및 다음 단계를 기술합니다.

Changes

Cohort / File(s) 변경 사항
캐시 전략 문서
\.docs/cache-strategy.md
새 파일 추가: Redis 캐시 도입 Phase 1 상세 가이드 (대상 선정, TTL/일관성 정책, 캐시 키 설계, 도메인 이벤트 기반 무효화 규칙, 모니터링 메트릭, 로드맵)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐰 캐시의 길을 밝히는 문서,

TTL과 일관성의 춤을 춘다네.

도메인 이벤트가 무효화를 부르고,

Redis는 데이터를 품에 안는다.

Phase 1의 첫 발을 내딛으며, 🚀

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "Redis 캐시 대상 및 TTL 정책 수립" (Establishing Redis cache targets and TTL policy) is directly related to the primary change in the pull request. The documentation file introduced outlines Phase 1 of a cache introduction strategy, detailing cache targets, TTL policies, consistency policies, and related strategies. The title clearly and specifically summarizes the main deliverable of this pull request, making it easily understandable for teammates reviewing the history.
Linked Issues Check ✅ Passed The pull request directly addresses the primary objective of issue #160 by establishing Redis cache targets and TTL policy through comprehensive documentation. The added documentation file ("캐시 도입 1단계 – 대상 선정 및 TTL/일관성 정책") outlines specific cache candidates, per-item TTLs, consistency policies, invalidation strategies, cache key design, and monitoring metrics. This documentation represents the core agreement needed to prevent consistency issues from indiscriminate caching, which was the main rationale stated in issue #160.
Out of Scope Changes Check ✅ Passed The pull request introduces a single documentation file focused entirely on Redis cache strategy, targets, and TTL policies. All changes are directly aligned with the scope of issue #160, which specifically requests the establishment of cache targets and TTL policy to prevent consistency issues. The documentation covers the agreed-upon criteria for what data should be cached and at what freshness levels, which is precisely what the linked issue aimed to define.
Description Check ✅ Passed The pull request description generally follows the provided template structure and includes the key sections: Issue (linking to #160), Current Situation (explaining the motivation), and Work Content (with one checked task). However, the Goal section remains unfilled with placeholder text, and the Other Matters section is also not completed. Despite these gaps, the description provides sufficient context about the change's purpose and includes proper linking to the related issue, allowing reviewers to understand the intent and scope of the documentation.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs#160-RedisTTL

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
.docs/cache-strategy.md (2)

8-16: Markdown 형식: 테이블 앞뒤로 빈 줄 추가

테이블이 이전 텍스트와 바로 붙어있습니다. Markdown 린팅 규칙(MD058)에 따라 테이블 위아래에 빈 줄을 추가하세요.

 ## 2. 캐시 후보 데이터
+
 | 구분 | 엔드포인트/질의 | 데이터 형태 | 요청 패턴 | 최신성 요구 | 비고 |

25-35: Markdown 형식: 코드 블록에 언어 지정

코드 블록이 언어를 명시하지 않았습니다. MD040 규칙에 따라 언어를 지정하세요.

 ## 4. 키 설계 초안
-```
+```yaml
 post:detail:{postId}
 post:list:public:{page}:{size}
 post:list:category:{category}:{page}:{size}
 post:search:{hash(keyword,title,content,...)}:{page}:{size}
 post:stats:{postId}
-```
+```
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2dd5375 and 62092ef.

📒 Files selected for processing (1)
  • .docs/cache-strategy.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
.docs/cache-strategy.md

9-9: Tables should be surrounded by blank lines

(MD058, blanks-around-tables)


26-26: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
.docs/cache-strategy.md (1)

1-66: 잘 정리된 1단계 캐시 전략 문서입니다.

다음과 같은 점에서 우수합니다:

  • 명확한 목표 설정 (DB/ES 부하 완화, 응답시간 목표, 확장 가능성)
  • 각 캐시 후보에 대한 특성과 최신성 요구 정의
  • 도메인 이벤트 기반 무효화 전략 구체화
  • 모니터링 지표 사전 정의
  • 오픈 이슈 명시 및 의사결정 포인트 명확화

제안 사항:

  1. 섹션 2의 "사용자 프로필" 행에서 "캐시 대상 제외"라고 명확히 한 이유(강한 일관성 요구)가 좋은 판단입니다. 향후 다른 후보들이 추가될 때도 같은 기준을 적용하는 것을 권장합니다.
  2. 섹션 3의 "이벤트 무효화" 정책은 견고하나, 섹션 7에서 언급한 "Kafka 메시지 기반 비동기 갱신"과의 연계 타이밍을 1단계 PoC 단계에서 검증하시기 바랍니다.
  3. 섹션 6 모니터링 지표에 "95/99 percentile 응답 시간"을 포함한 점은 좋으나, 캐시 히트율 목표(예: 80% 이상)도 함께 정의하면 1단계 성공 기준이 더 명확할 것 같습니다.

@Do-oya Do-oya merged commit 5f3300c into dev Oct 21, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📃 Docs 문서 작성 및 수정 (README.md 등)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redis 캐시 대상 및 TTL 정책 수립

2 participants