I'm creating a mini-social network to a unique niche. Since I came across several problems in modeling, but what takes pisses me is the relationship with followers. Basically it will have a model like the followers of Twitter; if you can follow someone and that person does not follow you. I will share my modeling with you so they can see if it's something right thing to do. example:
tbl_users
tbl_relationship -> users1_id, users2_id, reciprocal: boolean
The idea is if User X
follows User Y
the relationship will be created, and if the User Y
return the user will receive reciprocal
field TRUE
. So would not generate redundancy in the database.
This thinking is correct? I got to see several examples by Google and all were leading to redundancies of data.
I'm doing this in PostgreSQL
and Rails 4
.