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

[BE] issue467: 스터디 목록 조회 커서 기반 페이징 #468

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

Conversation

tco0427
Copy link
Collaborator

@tco0427 tco0427 commented Oct 31, 2022

요약

스터디 목록 조회에 대해서 커서 기반의 페이징으로 변경한다.

세부사항

현재 offset 기반의 페이징의 경우 예를 들어 50,000 ~ 50,005 번째의 5개의 데이터를 조회해오기 위해서는 DB 디스크에서 50,005 개의 데이터를 모두 읽어와야하며 디스크를 읽을 때 랜덤I/O 가 발생해 성능상 문제가 많습니다.
이를 해결하기 위한 방법인 커서 기반의 페이징을 적용하여 50,000 ~ 50,005 번째의 5개의 데이터를 조회해오더라도 필요한 데이터인 5개만 디스크로 부터 읽어올 수 있도록 개선합니다.
우선은 가장 빈번한 조회가 일어나는 메인 페이지의 study 목록 조회에 대해서 적용합니다.

참고 : 커서 기반 페이지네이션 (Cursor-based Pagination) 구현하기
참고 : Faster Pagination in Mysql – Why Order By With Limit and Offset is Slow?

프런트 팀원과 이야기한 결과, 페이징 조건이 많아질 수도 있고 이럴 때 마다 매 요청시마다 이 값들을 전부 보내는 것은 비효율적이므로 특정값을 부여한 cursor 라는 하나의 값만을 활용할 수 있도록 계산한 예정입니다. (자세한 내용은 위에 링크를 참고해주세요!)

close #467

@tco0427 tco0427 self-assigned this Oct 31, 2022
@2022-moamoa
Copy link

2022-moamoa bot commented Oct 31, 2022

Passed

Analysis Details

0 Issues

  • Bug 0 Bugs
  • Vulnerability 0 Vulnerabilities
  • Code Smell 0 Code Smells

Coverage and Duplications

  • Coverage No coverage information (69.80% Estimated after merge)
  • Duplications No duplication information (0.30% Estimated after merge)

Project ID: woowacourse-teams_2022-moamoa_AYKvd_z4VbW_bWBvgn13

View in SonarQube

@tco0427 tco0427 linked an issue Nov 1, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BE] 스터디 목록 조회에 커서 기반 페이징을 적용
1 participant