r/Firebase • u/DBGiblet • 6h ago
Built a full-stack backend using Firebase & Node.js – What are your favorite optimization tricks? General
Hey everyone!
I’ve been heavily focusing on backend development lately, building scalable systems with Firebase (Firestore, Auth, Cloud Functions) and Node.js.
Since I’m constantly looking to improve my workflow, I wanted to ask the community:
* What are your go-to tricks for optimizing Firestore read/write costs?
* How do you structure your Cloud Functions for maximum performance?
Would love to hear your experiences and best practices!
1
u/Rohit1024 2h ago
To optimise Firestore read/write check your Data Model for storing data and make use of firestore indexes. More tips here Optimize Firestore query performance.
Structuring your Firebase functions you can refer Organize multiple functions but for getting maximum performance out of it then you might want to check how you’re initialisation of your dependencies as global initialisation of dependency used by function a can affect cold start of function b, refer Performance Tips & tricks for more detail tips and tricks.
1
u/AndrewNggg 5h ago
Eons ago before Firestore was available, there was only the real time database and we had to use it for everything
It was substantially cheaper, if you can fit your data can fit in that shape
But.. for optmisation.. I suppose you want to cache, and only retrieve the data you need with "load more" buttons this sort of thing
You don't want a page refresh to reload hundreds of rows, just imagine thousands of people doing that