SNS ERD

SNS ERD는 작성, 반응, 팔로우 관계를 분리한다

게시글 작성, 댓글, 좋아요, 팔로우, 태그는 생명주기와 중복 규칙이 서로 다르므로 별도 관계로 모델링합니다.

Usercore
PKuser_id
ATTRnickname
PostN
PKpost_id
FKauthor_id
ATTRbody
CommentN
PKcomment_id
FKpost_id
FKuser_id
Likebridge
PKuser_id + post_id
FKuser_id
FKpost_id
Followself M:N
PKfollower_id + followee_id
FKfollower_id
FKfollowee_id
PostTagbridge
PKpost_id + tag_id
FKpost_id
FKtag_id
자기참조
Follow는 User가 User를 참조하는 관계입니다.
중복 방지
Like의 복합 PK로 한 사용자의 중복 좋아요를 막습니다.
태그
PostTag로 게시글과 태그의 M:N을 풉니다.