1. Data Model
instagram的数据应该有很多图片,以及用户的数据。因为数据比较一致,用关系型数据库mysql这种好一些。
user table
id: primary key, int, auto increasing (serial)
name: string
email: string
location: string
photo table (一对多)
id: primary key, int, auto increasing (serial)
url: string (store in S3)
caption: string
location: string
user_id: foreign key, referencing user.id
follower table (多对多)
follower_id: foreign key, referencing user.id
followee_id: foreign key, referencing user.id