Comprendere le letture e le scritture su larga scala
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Pertinente solo per la versione Enterprise di Cloud Firestore.
Leggi questo documento per prendere decisioni informate sull'architettura delle tue applicazioni
per ottenere prestazioni e affidabilità elevate. Questo documento include argomenti avanzati
Cloud Firestore. Se hai appena iniziato a utilizzare Cloud Firestore,
consulta la guida rapida. Per assicurarti che le tue applicazioni continuino a funzionare bene man mano che le dimensioni e il traffico del database aumentano, è utile comprendere il meccanismo di lettura e scrittura nel backend di Firestore. Devi anche comprendere l'interazione delle operazioni di lettura e scrittura con il livello di archiviazione e i vincoli sottostanti che potrebbero influire sulle prestazioni.
Per scoprire alcune best practice prima di progettare la tua applicazione, leggi
quanto segue:
Tutte le scritture
vengono gestite come transazioni di lettura/scrittura per garantire le proprietà ACID. Se una scrittura
coinvolge più suddivisioni, potrebbe richiedere una procedura di commit in due fasi.
Le letture,
per impostazione predefinita, sono "fortemente coerenti" e utilizzano un approccio basato su timestamp per
evitare i blocchi.
Per mantenere un rendimento elevato, devi evitare gli hotspot
distribuendo le operazioni nell'intervallo di chiavi e mantenendo le transazioni di piccole dimensioni.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Mancano le informazioni di cui ho bisogno","missingTheInformationINeed","thumb-down"],["Troppo complicato/troppi passaggi","tooComplicatedTooManySteps","thumb-down"],["Obsoleti","outOfDate","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Problema relativo a esempi/codice","samplesCodeIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-06 UTC."],[],[],null,["\u003cbr /\u003e\n\n\n|--------------------------------------------------------|\n| *Relevant to Cloud Firestore Enterprise edition only.* |\n\n\u003cbr /\u003e\n\nRead this document to make informed decisions on architecting your applications\nfor high performance and reliability. This document includes advanced\nCloud Firestore topics. If you're just starting out with Cloud Firestore,\nsee the [quickstart guide](/docs/firestore/enterprise/create-and-query-database)\ninstead. To make sure that your applications continue to perform well as your\ndatabase size and traffic increase, it helps to understand the mechanics of\nreads and writes in the Firestore backend. You must also understand the\ninteraction of your read and writes with the storage layer and the underlying\nconstraints that may affect performance.\n\nTo learn about some best practices before architecting your application, read\nthe following:\n\n- Understand the [high level components](https://cloud.google.com/firestore/mongodb-compatibility/docs/understand-reads-writes-scale#understand_the_high_level_components) of an API request.\n- All [writes](https://cloud.google.com/firestore/mongodb-compatibility/docs/understand-reads-writes-scale#understand_the_life_of_a_write) are handled as read-write transactions to ensure ACID properties. If a write involves multiple splits, it may require a two-phase commit process.\n- [Reads](https://cloud.google.com/firestore/mongodb-compatibility/docs/understand-reads-writes-scale#understand_the_life_of_a_read), by default, are \"strongly consistent\" and use a timestamp-based approach to avoid locks.\n- To maintain high performance, you should [avoid hotspots](https://cloud.google.com/firestore/mongodb-compatibility/docs/understand-reads-writes-scale#avoid_hotspots) by distributing operations across the key range and keeping transactions small."]]