Menu pages for a food delivery app
Your task
Design how a food delivery app serves restaurant menu pages. There are 30,000 restaurants; a menu has 50 to 300 items with names, photos, prices and options, and owners edit their menus a few times a day. Separately, items sell out and come back many times a day, and a sold-out item must show as unavailable within 30 seconds. The app serves about 6 million menu views a day, peaking at 300 a second at dinner time, and the menu database, which assembles each menu from several tables on every view, is starting to struggle. Describe what you cache, where, for how long, and how edits and sold-out changes reach users quickly.
It covers
- Cache invalidation
- Versioned keys
- Stampede protection