How to optimize read-write operations in cloud Firestore?

后端 未结 2 551
长发绾君心
长发绾君心 2021-01-23 11:54

I am currently writing a react + Firebase project for learning purpose, and I am wondering which approach should I take to read from firebase efficiently.

Say I have this

2条回答
  •  孤街浪徒
    2021-01-23 12:43

    You listed quite a few good options. We use pagination in our app to limit the read queries and also to improve the load speed. For example, we only show 50 items per page and load more on click or scroll (infinite scroll) If the data doesn't change often, you can cache it on the frontend, but this introduces a whole lot of additional problems :).

提交回复
热议问题