In caso di aumenti rapidi del traffico, la modalità Datastore tenta di eseguire automaticamente lo scaling per soddisfare la domanda in aumento. Quando la modalità Datastore viene scalata, la latenza inizia a diminuire.
Gli hot spot (elevati tassi di lettura, scrittura ed eliminazione per un intervallo ristretto di entità)
limitano la capacità di scalabilità della modalità Datastore. Esamina la progettazione per la scalabilità e identifica i punti critici della tua applicazione.
Concorrenza, ad esempio a causa dell'aggiornamento troppo frequente di una singola entità o delle transazioni.
lettura, scrittura
Riduci la frequenza di scrittura per le singole entità.
Ad esempio, le query con più filtri di uguaglianza (==)
ma non supportate da indici composti possono comportare query di unione dinamica lente.
Per migliorare le prestazioni, aggiungi indici compositi per queste query.
Consulta
Ottimizzazione degli indici.
Letture di grandi dimensioni che restituiscono molte entità.
lettura
Utilizza
cursori di query
per suddividere le letture di grandi dimensioni.
Troppe eliminazioni recenti.
read Questo influisce notevolmente sulle operazioni che elencano i tipi in un database.
Se la latenza è causata da un numero eccessivo di eliminazioni recenti,
il problema dovrebbe risolversi automaticamente dopo un po' di tempo. Se il problema persiste, contatta l'assistenza.
Espansione dell'indice, in particolare per le proprietà array.
Le seguenti situazioni possono aumentare gli errori ABORTED:
Un'entità che riceve troppi aggiornamenti al secondo.
Concorrenza dovuta a transazioni sovrapposte.
Aumenti di traffico che superano la regola 500-50-5 o che presentano hot spot.
ABORTED
Too much contention on these datastore entities. Please try again.
Oppure
ABORTED
Aborted due to cross-transaction contention. This occurs when multiple
transactions attempt to access the same data, requiring Datastore mode
to abort at least one in order to enforce serializability.
Per risolvere il problema:
In caso di aumenti rapidi del traffico, la modalità Datastore tenta di eseguire automaticamente lo scaling per soddisfare la domanda in aumento. Quando la modalità Datastore viene scalata, la latenza inizia a diminuire.
Gli hot spot limitano la capacità della modalità Datastore di eseguire l'upgrade. Consulta la sezione Progettazione per la scalabilità per identificare gli hot spot.
Le seguenti situazioni possono causare errori INVALID_ARGUMENT:
Tentativo di commit di un'entità con un valore della proprietà indicizzata superiore a 1500 byte. Questo limite si applica alla codifica UTF-8 del valore della proprietà.
Tentativo di commit di un'entità con valori di proprietà non indicizzati superiori a 1.048.487 byte (1 MiB - 89 byte). Questo limite si applica alla somma
dei valori delle proprietà in un'entità. Ad esempio, quattro proprietà di 256 KiB ciascuna superano il limite.
1500 byte (indicizzati) e 1.048.487 byte (non indicizzati) sono
limiti per i valori delle proprietà. Non puoi superare questi limiti e non sono quote che possono essere regolate.
INVALID_ARGUMENT: The value of property property-name is longer than 1500 bytes
o
INVALID_ARGUMENT: The value of property property_name is longer than 1048487 bytes
Per risolvere il problema:
Per i valori delle proprietà indicizzate, suddividi la proprietà in più proprietà. Se possibile, crea una proprietà non indicizzata
e sposta i dati che non devono essere indicizzati nella proprietà non indicizzata.
Per i valori delle proprietà non indicizzati, suddividi la proprietà in più proprietà o implementa la compressione per il valore della proprietà.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-05 UTC."],[[["\u003cp\u003eThis guide helps resolve issues with Firestore in Datastore mode, focusing on latency and error codes.\u003c/p\u003e\n"],["\u003cp\u003eIncreased latency can be caused by high traffic, contention, slow queries, large reads, recent deletes, or index fanout, each with specific resolutions.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eABORTED\u003c/code\u003e errors often result from too many updates to a single entity, contention from overlapping transactions, or traffic exceeding the 500-50-5 rule, with solutions that involve scaling and reducing write rates.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRESOURCE_EXHAUSTED\u003c/code\u003e errors are triggered by exceeding the free tier quota without billing enabled, which can be resolved by waiting for the daily reset or enabling billing.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eINVALID_ARGUMENT\u003c/code\u003e errors arise from exceeding property value limits for indexed or un-indexed values, and require splitting the property into multiple properties or implementing compression.\u003c/p\u003e\n"]]],[],null,["# Troubleshooting\n\nThis page shows you how to resolve issues with Firestore in Datastore mode.\n\nLatency\n-------\n\nThe table below describes possible causes of increased latency:\n\nError Codes\n-----------\n\nThis section lists issues that you might encounter and provides suggestions for\nhow to fix each of them.\n\n### DEADLINE_EXCEEDED\n\n```\nDEADLINE_EXCEEDED\n\nA deadline was exceeded on the server.\n```\n\nTo resolve this issue, see the [guide to troubleshooting latency](#latency).\n\n### ABORTED\n\nThe following situations can increase `ABORTED` errors:\n\n- An entity receiving too many updates per second.\n- Contention from overlapping transactions.\n- Traffic increases that exceed the 500-50-5 rule or encounter hot-spots.\n\n```\nABORTED\n\nToo much contention on these datastore entities. Please try again.\n```\n\nOr \n\n```\nABORTED\n\nAborted due to cross-transaction contention. This occurs when multiple\ntransactions attempt to access the same data, requiring Datastore mode\nto abort at least one in order to enforce serializability.\n```\n\nTo resolve this issue:\n\n- For rapid traffic increases, Datastore mode attempts to automatically scale to meet the increased demand. When Datastore mode scales, latency begins to decrease.\n- Hot-spots limit the ability of Datastore mode to scale up, review [designing for scale](./best-practices#designing_for_scale) to identify hot-spots.\n- Review [data contention in transactions](/datastore/docs/concepts/transactions#isolation_and_consistency) and your usage of transactions.\n- Reduce the write rate to individual entities.\n\n### RESOURCE_EXHAUSTED\n\nThe following situations can lead to `RESOURCE_EXHAUSTED` errors:\n\nYou exceeded the [free tier quota](/datastore/pricing#free_quota) and billing is not enabled\nfor your project. \n\n```\nRESOURCE_EXHAUSTED\n\nSome resource has been exhausted, perhaps a per-user quota, or perhaps the entire file system is out of space.\n```\n\nTo resolve this issue:\n\n- Wait for the daily reset of your free tier quota or [enable billing for\n your project](/billing/docs/how-to/modify-project#enable_billing_for_a_project).\n\n### INVALID_ARGUMENT\n\nThe following situations can cause `INVALID_ARGUMENT` errors:\n\n- Attempting to commit an entity with an **indexed** property value greater than 1500 bytes. This limit applies to the UTF-8 encoding of the property value.\n- Attempting to commit an entity with **un-indexed** property values greater than 1,048,487 bytes (1 MiB - 89 bytes). This limit applies to the sum of the property values in an entity. For example, four properties of 256 KiB each exceed the limit.\n\n1,500 bytes (indexed) and 1,048,487 bytes (un-indexed) are\n[limits](/datastore/docs/concepts/limits) for property values. You cannot\nexceed these limits and they are not quotas that can be adjusted. \n\n```\nINVALID_ARGUMENT: The value of property property-name is longer than 1500 bytes\n```\n\nor \n\n```\nINVALID_ARGUMENT: The value of property property_name is longer than 1048487 bytes\n```\n\nTo resolve this issue:\n\n- For indexed property values, split the property into multiple properties. If possible, create an un-indexed property and move data that doesn't need to be indexed into the un-indexed property.\n- For un-indexed property values, split the property into multiple properties or implement compression for the property value."]]