Skip to content
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

refactor: 많이 조회한 게시글 키워드 구조 변경 #1061

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

seongjae6751
Copy link
Contributor

@seongjae6751 seongjae6751 commented Nov 20, 2024

🔥 연관 이슈

🚀 작업 내용

  1. 스케줄러 리팩토링:
  • ArticleService의 코드가 너무 방대해짐에 따라 ArticleService와 ArticleSyncService로 나눴습니다.
    • ArticleService는 비즈니스 로직 호출만 담당하고, 각 동기화 작업은 ArticleSyncService로 이동하여 독립적으로 관리하게 했습니다.
  1. 많이 검색한 키워드 로직 리팩토링:
  • 초기 코드:
    • 중복된 로직과 단일 메서드 내의 복잡한 가중치 계산으로 인해 유지보수성이 떨어졌습니다.
  • 리팩토링 후
    • RedisKeywordTracker를 도입해서 Redis의 Sorted Set과 Key-Value Store를 이용해 인기 검색 키워드의 가중치를 관리하고, 많이 검색된 키워드를 실시간으로 추적하게 했습니다.
  1. 객체지향 설계 및 Strategy 패턴 적용:
  • Strategy 패턴을 적용하여 인기 키워드 조회 시 Redis와 MySQL 병합 전략을 동적으로 선택할 수 있도록 설계했습니다.
    • Redis에 상위 키워드가 부족한 경우, MySQL에서 자동으로 보충하는 구조로 구현했습니다.

💬 리뷰 중점사항

@seongjae6751 seongjae6751 self-assigned this Nov 20, 2024
@github-actions github-actions bot added the 리팩터링 리팩터링을 위한 이슈입니다 label Nov 20, 2024
Copy link

github-actions bot commented Nov 20, 2024

Unit Test Results

353 tests   352 ✔️  1m 48s ⏱️
  45 suites      1 💤
  45 files        0

Results for commit dc7f1a5.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@20HyeonsuLee 20HyeonsuLee left a comment

Choose a reason for hiding this comment

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

연관 이슈가 잘못 연결되어 있는 것 같아요~

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.

2 participants