Design a backend system for searching nearby restaurants.
Users open a mobile app and want to find restaurants near their current location. The system should support queries such as:
-
Find restaurants within a radius, for example within 1 km or 5 km.
-
Rank results by a combination of distance, relevance, rating, popularity, and availability.
-
Filter by attributes such as cuisine type, price range, opening hours, delivery/pickup availability, and minimum rating.
-
Return results with low latency for a high-traffic consumer app.
Describe the APIs, data model, geospatial indexing strategy, ranking approach, caching strategy, scalability plan, and how you would handle updates such as restaurant location changes, opening-hour changes, and temporary closures.