Skip to content

feat: sorted set 추가#32

Merged
kooks7 merged 1 commit intomainfrom
feat/sorted-set
May 26, 2025
Merged

feat: sorted set 추가#32
kooks7 merged 1 commit intomainfrom
feat/sorted-set

Conversation

@kooks7
Copy link
Copy Markdown
Contributor

@kooks7 kooks7 commented May 16, 2025

PR 의 종류는 어떤 것인가요?

  • 버그 수정
  • 새로운 기능
  • 리팩토링
  • 문서 수정
  • 워크플로우 수정

수정이 필요하게된 이유가 무엇인가요? (Jira 이슈가 있다면 링크를 연결해주세요)

콜로소에서 인기순으로 게시물(포트폴리오)를 정렬하기 위해 sorted set을 추가합니다.

api docs: https://redis.io/docs/latest/develop/data-types/sorted-sets/

사용하고자 하는 flow

  1. 포트폴리오(게시 포스트)를 기간 약 24개월 이내 (데이터량이 많으면 기간을 줄일려고 함)
  2. 포트폴리오 데이터와 counter 데이터를 join 합니다. (targaet = favorite)
  3. redis sorted set으로 추가합니다.
  4. 프론트에서는 redis 데이터를 페이지네이션 해서 가져옵니다.
  5. redis에 데이터가 없을시 최신순으로 조회해서 가져옵니다.

무엇을 어떻게 변경했나요?

코드 변경을 이해하기 위한 배경지식이 필요하다면 설명 해주세요.

디펜던시 변경이 있나요?

어떻게 테스트 하셨나요?

테스트 코드

코드의 실행결과를 볼 수 있는 로그나 이미지가 있다면 첨부해주세요.

@kooks7 kooks7 self-assigned this May 16, 2025
@day1-dev-adm day1-dev-adm added the enhancement New feature or request label May 16, 2025
Copy link
Copy Markdown
Contributor

@j-zzi j-zzi left a comment

Choose a reason for hiding this comment

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

LGTM👍👍👍👍👍

{ score: 300, value: 'baz' },
]);

const result = await sortedSet.range({ start: 0, stop: 2, withScores: true });
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Score없이 조회하면 withScores가 false여야하는 거 아닐지요?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

테스트가 이상하네요..ㅎㅎ

@kooks7 kooks7 force-pushed the feat/sorted-set branch from 5789737 to 8e8d844 Compare May 20, 2025 00:56
Copy link
Copy Markdown

@elegantcoder elegantcoder left a comment

Choose a reason for hiding this comment

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

좋습니다. 수고하셨어요.

@kooks7 kooks7 merged commit 1eed931 into main May 26, 2025
1 check passed
@kooks7 kooks7 deleted the feat/sorted-set branch May 26, 2025 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants