Skip to content

refactor: KeywordExtractor 클래스 개선#2204

Closed
Soundbar91 wants to merge 15 commits intorefactor/2201-send-keyword-notificationfrom
refactor/2202-keyword-extractor
Closed

refactor: KeywordExtractor 클래스 개선#2204
Soundbar91 wants to merge 15 commits intorefactor/2201-send-keyword-notificationfrom
refactor/2202-keyword-extractor

Conversation

@Soundbar91
Copy link
Copy Markdown
Collaborator

@Soundbar91 Soundbar91 commented Mar 30, 2026

🔍 개요


🚀 주요 변경 내용

배치 조회 삭제

image
  • ArticleKeyword를 100개 단위로 페이징 조회 (총 N개, 쿼리 N / 100 + 1번 발생)
  • 이로 인해 ArticleKeywordUserMap 쿼리도 N / 100 + 1번 발생
  • 기능이 출시된지 1년 6개월이 지난 시점에서 ArticleKeywords의 데이터는 158개, ArticleKeywordUserMap의 데이터는 432개
  • 데이터가 소규모이며 배치 조회가 아닌 한 번에 모두 조회하는 것이 DB I/O를 줄이면서 코드도 개선할 수 있다고 판단

KeywordMatchResult 클래스 추가

  • Map 자료구조, Stream 라이브러리 사용으로 인해 로직을 파악하기 어렵다고 판단
  • 도메인 객체 KeywordMatchResult를 추가하여 개선
    • (articleId, userId)가 같은 경우 동일 인스턴스로 판단
    • 집합에 데이터가 없다면 추가, 있다면 기존 로직(단어의 길이에 따라 키워드 업데이트)를 통해 인스턴스 수정

💬 참고 사항


✅ Checklist (완료 조건)

  • 코드 스타일 가이드 준수
  • 테스트 코드 포함됨
  • Reviewers / Assignees / Labels 지정 완료
  • 보안 및 민감 정보 검증 (API 키, 환경 변수, 개인정보 등)

@Soundbar91 Soundbar91 self-assigned this Mar 30, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8eb3c7f7-2686-4a96-ab9a-27b982d1d8ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/2202-keyword-extractor

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.

@github-actions github-actions bot added 공통 백엔드 공통으로 작업할 이슈입니다. 리팩터링 리팩터링을 위한 이슈입니다 labels Mar 30, 2026
@Soundbar91 Soundbar91 marked this pull request as draft March 30, 2026 07:08
@Soundbar91 Soundbar91 closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

공통 백엔드 공통으로 작업할 이슈입니다. 리팩터링 리팩터링을 위한 이슈입니다

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant