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] id 순서가 생성일을 보장하지 않는 문제를 해결한다. #1109

Open
Kimprodp opened this issue Feb 14, 2025 · 0 comments
Open

Comments

@Kimprodp
Copy link
Contributor

🔍 설명

  • 생성일을 기준으로 페이지네이션 응답을 하는 로직에서 현재 lasId를 기준으로 다음 요소를 찾고 응답하고 있습니다.
  • 엔티티의 생성일(createdAt)은 엔티티가 생성될 때 생성자를 통해 생성되고, id는 영속화 되는 시점에 결정됩니다.
  • 이렇게 id와 생성일의 결정 시점이 다르다면, 멀티 스레드 환경에서 트랜잭션의 처리 속도와 순서에 따라서 id의 순서가 생성일을 보장하지 않을 수 있습니다.
  • 이런 경우, 현재 구현 방식으로는 페이지네이션이 생성일에 따른 정렬된 응답 보장을 할 수 없습니다.
  • 따라서, 생성일을 영속화 되는 시점에 지정하여 id가 지정되는 시점을 동일하게 변경합니다.

🔥 할 일

  • 생성일을 영속화 시점에 설정되도록 변경

⏰ 예상 시간

  • 1h?

🐴 할 말

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant