Cloud Firestore Enterprise edition with MongoDB compatibility is now available!
Learn more.
Resolve latency issues
Stay organized with collections
Save and categorize content based on your preferences.
Relevant to Cloud Firestore Enterprise edition only.
|
This page shows you how to resolve latency issues with Cloud Firestore with MongoDB compatibility.
Latency
The following table describes possible causes of increased latency:
Latency cause |
Types of operations affected |
Resolution |
Sustained, increasing traffic.
|
read, write |
For rapid traffic increases, Cloud Firestore with MongoDB compatibility attempts to automatically
scale to meet the increased demand. When Cloud Firestore with MongoDB compatibility
scales, latency begins to decrease.
Hot-spots (high read, write, and delete rates to a narrow document range)
limit the ability of Cloud Firestore with MongoDB compatibility to scale. Review
Avoid hot-spots
and identify hot-spots in your application.
|
Contention, either from updating a single document too
frequently or from transactions. |
read, write |
Reduce the write rate to individual documents.
Reduce the number of documents updated in a single write transaction.
|
Large reads that return many documents. |
read |
Use pagination to split large reads.
|
Too many recent deletes. |
read This greatly affects
operations that list collections in a database. |
If latency is caused by too many recent deletes,
the issue should automatically resolve after some time. If the issue does
not resolve, contact support. |
Index fanout, especially for array fields and embedded document fields. |
write |
Review your indexing of array fields and embedded document fields. |
Large writes. |
write |
Try reducing the number of writes in each operation.
For bulk data entry where you don't require atomicity, use
parallelized individual writes.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-25 UTC.
[null,null,["Last updated 2025-08-25 UTC."],[],[],null,["\u003cbr /\u003e\n\n\n|--------------------------------------------------------|\n| *Relevant to Cloud Firestore Enterprise edition only.* |\n\n\u003cbr /\u003e\n\nThis page shows you how to resolve latency issues with Cloud Firestore with MongoDB compatibility.\n\nLatency\n\nThe following table describes possible causes of increased latency:\n\n| Latency cause | Types of operations affected | Resolution |\n|-----------------------------------------------------------------------------------------|---------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Sustained, increasing traffic. | read, write | For rapid traffic increases, Cloud Firestore with MongoDB compatibility attempts to automatically scale to meet the increased demand. When Cloud Firestore with MongoDB compatibility scales, latency begins to decrease. Hot-spots (high read, write, and delete rates to a narrow document range) limit the ability of Cloud Firestore with MongoDB compatibility to scale. Review [Avoid hot-spots](https://cloud.google.com/firestore/mongodb-compatibility/docs/understand-reads-writes-scale#avoid_hotspots) and identify hot-spots in your application. |\n| Contention, either from updating a single document too frequently or from transactions. | read, write | Reduce the write rate to individual documents. Reduce the number of documents updated in a single write transaction. |\n| Large reads that return many documents. | read | Use pagination to split large reads. |\n| Too many recent deletes. | read This greatly affects operations that list collections in a database. | If latency is caused by too many recent deletes, the issue should automatically resolve after some time. If the issue does not resolve, [contact support](https://firebase.google.com/support). |\n| Index fanout, especially for array fields and embedded document fields. | write | Review your indexing of array fields and embedded document fields. |\n| Large writes. | write | Try reducing the number of writes in each operation. For bulk data entry where you don't require atomicity, use parallelized individual writes. |"]]