I am developing an Uber Eats like app for a project. Clients(restaurants) add Menus and menu items(products) into the cloud firestore database. Users (app users who search for restaurants and menu items) can search for restaurants and menu items in their nearby locations. Currently I am saving all the products that clients are uploading in a single collection. (Products collection). When the user tries to search menu items by location I have used
.where("location", isEqualTo:location)
My concern is when the products collection gets bigger over time (expecting up to 15000 products) would the query time and write and reads count go up and slows down the app?
What would be the best way to store products, which can be efficiently queried by its location?