7 Design Craigslist
This chapter covers
- Designing an application for where there are 2 distinct types of users.
- Considering geolocation routing to partition users by geography.
- Designing read-heavy vs write-heavy applications.
- Minor deviations during the interview.
We want to design a web application for classifieds posts. Craigslist is an example of a typical web application that may have over a billion users. It is partitioned by geography. We can discuss the overall system, which includes browser and mobile apps, a stateless backend, simple storage requirements, and analytics. More use cases and constraints can be added for an open-ended discussion. This chapter is also unique in that it is the only system in this book where we discuss a monolith architecture as a possible system design.
7.1 User stories and requirements
Let’s discuss the user stories for Craigslist. We distinguish 2 primary user types - viewer and poster.
A poster should be able to create and delete a post, and search her posts as she may have many, especially if they were programmatically generated. This post should contain the following information:
- Title.
- Some paragraphs of description.
- Price. Assume a single currency. Ignore currency conversions.
- Location.
- Up to 10 photos of 1 MB each.
- Video, though this may be added to a later iteration of our application.
A poster can renew her post every 7 days. She will receive an email notification with a click-through to renew her post.
A viewer should be able to: