Let's summarise our Non-Functional Requirements first before moving to technologies and work out our capacity estimation.
Non-Functional Requirements
We can see our system is READ Heavy. Which will impact our system.
1. RegistrationAPI
2. LoginAPI
3. TweetAPI (CRUD for tweets)
You’re right that retrieving multiple tweets will need to be optimized, likely with pagination (e.g., ?limit=20&offset=40).
4. TwitterInteractionAPI
I'll focus on Users already being authenticated and using Twitter
Explain how the request flows from end to end in your high level design. Also you could draw a sequence diagram using the diagramming tool to enhance your explanation...
Client interacts with system.
CDN serves our static assets.
Request is directed to API Gateway (Load Balancer, Authenticates/Authorises requests, rate limits before redirecting to a service that hosts the APIs).
API checks cache, if cache key exists returns data, if not queries Cassandra.
In summary, every technology choice and architectural decision is accompanied by trade-offs concerning consistency, availability, performance, and complexity. The design choices made aim to create a scalable, efficient, and user-friendly platform that meets the needs of a social media application
Addressing these potential failure scenarios and bottlenecks is essential for ensuring the system remains reliable, performant, and user-friendly. Continuous monitoring, testing, and refinement of the architecture can greatly mitigate the risks associated for each scenario.
If you'd like to dive deeper into any specific scenario or discuss further mitigation strategies, feel free to ask!
What are some future improvements you would make? How would you mitigate the failure scenario(s) you described above?