Firestore limit

2020-04-16 06:27发布

Firestore offers 50000 documents read operations as part of its free bundle.

However, in my application, the client is fetching a collection containing price data. The price data is created over time. Hence, starting from a specific timestamp, the client can read up to 1000 documents. Each document represents one timestamp with the price information. This is means that if the client refreshes his/her web browser 50 times, it will exhaust my quota immediately. And that is just for a single client. That is what happened. And got this error:

Error: 8 RESOURCE_EXHAUSTED: Quota exceeded

The price data are static. Once they have been written, it is not supposed to change. Is there a solution for this issue or I should consider other database other than Firestore?

2条回答
何必那么认真
2楼-- · 2020-04-16 06:56

The error message indicates that you've exhausted the quota that is available. On the free plan the quota is 50,000 document reads per day, so you've read that number of documents already.

Possible solutions:

  • Upgrade to a paid plan, which has a much higher quota.
  • Wait until tomorrow to continue, since the quota resets every day.
  • Try in another free project, since each project has its own quota.
查看更多
混吃等死
3楼-- · 2020-04-16 06:59

If you have a dataset that will never-ever (or rarely) change, why not write it as JSON object in the app itself. You could make it a separate .js file and then import for reading to make your table.

Alternatively - is there a reason your users would ever navigate through all 1,000 records. You can simulate a full table even with limiting to calls to say 10 or so and then paginate to get more results if needed.

查看更多
登录 后发表回答