For an upcoming project I'm using a cloud database (Firebase Firestore). It works great, but my concern are potential high costs in case of high traffic to the site.To keep the costs down, my idea is to avoid fetching data from Firebase directly in my frontend (React) app and instead:- create Node scripts that will pull data from Firebase and save it to local JSON files on my server every 15 minutes- create a basic Express.js API that will serve those local JSON data to my frontend appsIs anyone doing something similar? My data doesn't update often, so making read requests to Firebase every 15 minutes is fine and would be a huge cost saver compared to making read requests for every single visitor.My main question for the Node community, is it a good idea for my custom Express API to use "fs" to read json files and serve them? It seems redundant to use a local database as well, but I'd do it if it would be better for performance in case of high traffic.
Submitted December 28, 2018 at 06:09AM by reacttricks
No comments:
Post a Comment