0

I'm redesigning my website using React as the frontend and Firestore for the database.

The database has 300+ "recommenders" and 2500+ books.

Each time I load the home page, it goes through all 300+ "recommenders" (and they all have 5 or so data points like name, twitter profile link, image, etc...) and this is a lot of reads. It does the same when I click on "top books" and that's even worse. It quickly kills my limit of 50k reads per day.

But the website (almost) never changes. I only add a new recommender once a month or so. So it shouldn't crawl through the database every time I hit refresh... the data doesn't change.

I'm a bit new to this topic. But is there a way to take a "snapshot" of the database and have the client read from that instead?

I've heard in other situations people use memcached but I'm not sure that solves the problem or if I can use it with Firebase. A tutorial or link to solve this problem would be helpful.

Richard Reis
  • 219
  • 2
  • 10
  • Assuming that the changes are as infrequent as you say they are you could separate the firestore database from the app and just export the json data from firestore. Then the app just needs to read from the json file instead of killing your read limit. Would be a fast approach. – Tim Wilson Nov 07 '19 at 19:13
  • I just marked it as a duplicate since this kind of question was already asked. The best way for solving this is to load data in smaller chunks even if your data is most of the time static. – Alex Mamo Nov 07 '19 at 19:17

0 Answers0