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

Feed 설계 #26

Closed
gru3530 opened this issue Feb 5, 2025 · 1 comment
Closed

Feed 설계 #26

gru3530 opened this issue Feb 5, 2025 · 1 comment
Assignees
Labels

Comments

@gru3530
Copy link
Collaborator

gru3530 commented Feb 5, 2025

#16 을 참고하여 Fan-out 모델을 사용하여 feed를 작성한다

@gru3530 gru3530 moved this to Todo in stargram Feb 5, 2025
@gru3530 gru3530 added this to stargram Feb 5, 2025
@gru3530 gru3530 moved this from Todo to In Progress in stargram Feb 24, 2025
@gru3530
Copy link
Collaborator Author

gru3530 commented Feb 25, 2025

정책

사용자 구분 및 fanout 적용방식

  • 사용자 유형(UserTypeEnum)은 일반 유저(REGULAR)와 인플루언서(INFLUENCER)로 구분한다.
  • DB(User 테이블)에는 UserTypeEnum을 String 형태로 저장한다.

인플루언서의 게시물 저장

  • 인플루언서가 게시물을 작성(postFeed)하면 DB와 Redis에 동시 저장한다.
  • 하나라도 저장에 실패하면 트랜잭션을 롤백하여 데이터 불일치를 방지한다.
  • Redis의 데이터 유지 기간은 7일로 설정한다.

일반 유저의 게시물 저장

  • 일반 유저의 게시물은 DB에만 저장한다.
  • 팔로워의 피드에는 Push Model을 적용한다

데이터 조회 정책

  • 인플루언서 게시물은 Redis에서 우선 조회하고, 없으면 MySQL에서 조회한다.
  • 일반 유저 게시물은 MySQL에서 직접 조회한다.

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

No branches or pull requests

2 participants