5

While reading the official docs I found that Cloud Firestore allows a lot more concurrent connections but the number of writes per second per database is limited to 10k. If I have 20k concurrent users and my application is write heavy(like a social media platform) so there's a possibility of exceeding the write limit, what should be my strategy to handle this situation? If I use multiple databases and my traffic keeps on increasing and reaches around 100k, does that mean I'll have to have 10 different databases by then?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Deb
  • 85
  • 1
  • 2
  • 10

2 Answers2

5

Your question is kind of broad for Stack Overflow. But the general strategy is, if you think you might generate more sustained writes per second than Firestore allows, is to throttle those writes using some service that can smooth out traffic, such as Cloud Tasks. That could limit the rate of invocation of a server endpoint such as Cloud Functions that actually writes the data. Another option is to perform the writes to a store that can handle the load, such as Realtime Database, or Cloud Memorystore, the periodically mirror those changes back to Firestore.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
0

Update: As of Oct 17, 2022, the 10,000 writes per second per database limit has been removed - firestore release notes. However, other limits like 1 write per second per document still apply. See the docs for a comprehensive list.

tsb5555
  • 321
  • 3
  • 13