现已推出具有 MongoDB 兼容性的 Firestore 企业版!
了解详情。
瞭解大規模的讀取與寫入
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
僅適用於 Cloud Firestore Enterprise 版。
|
請參閱這份文件,根據相關資訊做出明智決策,為應用程式設計高效能和高可靠性的架構。這份文件包含進階
Cloud Firestore主題。如果你才剛開始使用 Cloud Firestore,請參閱快速入門指南。為確保應用程式在資料庫大小和流量增加時仍能正常運作,請瞭解 Firestore 後端的讀取和寫入機制。您也必須瞭解讀取和寫入作業與儲存層的互動,以及可能影響效能的基礎限制。
如要瞭解應用程式架構的最佳做法,請參閱下列內容:
- 瞭解 API 要求的高階元件。
- 所有寫入作業都會以讀寫交易處理,確保 ACID 屬性。如果寫入作業涉及多個分割,可能需要二階段修訂程序。
- 根據預設,讀取作業會「強烈一致」,並使用時間戳記型方法來避免鎖定。
- 為維持高效能,請避免資源使用率不均,方法是將作業分散到索引鍵範圍內,並維持小型交易。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-29 (世界標準時間)。
[null,null,["上次更新時間:2025-08-29 (世界標準時間)。"],[],[],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."]]