3 ms·
I just want to point out to people who are new to Firebase that you can query your Firestore collections. Also, Firestore Queries are cached by default, so if y
by reimertz 7y ago
I just want to point out to people who are new to Firebase that you can query your Firestore collections.
Also, Firestore Queries are cached by default, so if you try and fetch data that hasn’t changed, you shouldn’t have to pay for that read.
db.collection(‘Payments’).where(‘id’, ‘==’, ‘payment 1’).onSnapshot(console.log) // 1 read, then cached
Whereas specifying a document and then manually get it always counts as a read. Example;
db.collection(‘Payments’).doc(‘payment 1’).get() // always counted as a read
It's funny.
I've had multiple discussions with people who build apps using Firebase and then not being able to scale to 1000 concurrent people without the BE falling apart. I want to tell them that they've done something wrong, but since none of my apps haven't reached those kind of usage levels, I really don't know.
I think Firebase comes with a lot of power, and as long as so plan to scale, design your database model, have proper security rules and cache as much as you can, you can probably host a 1M concurrent users without getting scaling problems. Cost though, ooh yeez. :)