A Twitter like application where user can tweet and have followers
System shall provide capability for
- user to follow other user
- user to create tweet
- user to login to the system
- user to signup at the system
- user to see most recent 100 tweets from people they follow after login
- Our service needs to be highly available.
- Acceptable latency of the system is 200ms for timeline generation.
- Consistency can take a hit (in the interest of availability); if a user doesn’t see a tweet for a while, it should be fine.
- 10K total user, each person tweets 10 message a day
- new tweets/day: 100k tweet a day
- each user follow 200 people, DAU: 10K
- assume on average a user visits their timeline two times a day. On each page if a user sees 100 tweets.
- 10K DAU * (2 * 100)=>2000k =2M/day
- Assume each tweet has 140 characters and we need two bytes to store a character without compression.
- Assume we need 30 bytes to store metadata with each tweet
- Total storage we would need: 31 MB/day
- 100k * (280 + 30) bytes => 31000 KB/day = 31 MB/day
- 100k tweet a day * 280 bytes per tweet / 86400 second = 0.32KB/s
- Server
- Springboot, webmvc, spring security
- Consumer (calling application)
- Springboot rest template
- Infrastructure
- AWS EC2, RDS, S3, loadbalancer security group, autoscale group
- Deployment
- Maven, AWS elasticbeanstalk
- Testing
- Mockito, Springboot test
- UI
- swagger