Problem and Solutions
Good option in Firestore [closed] ?
By M.K. Verma · 4 May 2022
![Good option in Firestore [closed] ?](/_next/image?url=https%3A%2F%2Fserveapi.trimwebsolutions.com%2Fuploads%2Flegacy%2Fblog%2F16516678611651667861.jpg&w=3840&q=65)
General NoSQL philosophy:
- DO Repeat Yourself
Static or mostly static data SHOULD be repeated where convenient (such as a User's name for display, or in your case regions and districts). There should be ONE "source of truth" record for such data, but since the data is static you can add it to things like Blog Posts, Comments, etc so it's already available for display and queries. Try to have everything you need to display or find a "thing" in a single document representing that "thing".
- DON'T design your queries to fit your database structure
Design your database structure to fit your intended queries Think about how you want to "ask questions" from your database - and design your structure to make it easy to query your data the way you want to use it.