DEV Community

Discussion on: Why I switched away from Google Firestore

Collapse
 
sergiochumacero profile image
sergio-chumacero

Your user/reviews example is more of a problem of poor design. With NoSQL one would store the username and profile pic together in the review document (denormalization), so no N+1 problem here. Now, on username change, you would need to update each comment made by the user. Using queries, you would only access and be charged for the resulting documents and not all of the reviews. We can then expect this upfront write cost to be quickly amortized by the many more subsequent reads: A username may change his username twice a year, but we need to retrieve the reviews on each page visit. Using SQL, we would need costly joins on each page visit.