现已推出具有 MongoDB 兼容性的 Firestore 企业版!
了解详情。
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
Cloud Firestore
plat_ios
plat_android
plat_web
plat_flutter
plat_cpp
plat_unity
plat_node
plat_java
plat_python
plat_go
ใช้ฐานข้อมูล NoSQL ระบบคลาวด์ที่ยืดหยุ่นและรองรับการปรับขนาดของเรา
บนโครงสร้างพื้นฐาน Google Cloud เพื่อจัดเก็บและซิงค์ข้อมูลสำหรับไคลเอ็นต์ และ
การพัฒนาฝั่งเซิร์ฟเวอร์
Cloud Firestore เป็นฐานข้อมูลที่ยืดหยุ่นและรองรับการปรับขนาดสำหรับอุปกรณ์เคลื่อนที่ เว็บ
และการพัฒนาเซิร์ฟเวอร์จาก Firebase และ Google Cloud ชอบ
Firebase Realtime Database ทำให้ข้อมูลในแอปไคลเอ็นต์ต่างๆ ซิงค์กันผ่าน
ผู้ฟังแบบเรียลไทม์และให้การสนับสนุนแบบออฟไลน์สำหรับอุปกรณ์เคลื่อนที่และเว็บ
สร้างแอปที่ปรับเปลี่ยนตามอุปกรณ์ซึ่งทำงานได้ไม่ว่าเวลาในการตอบสนองของเครือข่ายหรืออินเทอร์เน็ต
ได้ Cloud Firestore ยังมีการผสานรวมที่ราบรื่นกับ Firebase อื่นๆ ด้วย
และผลิตภัณฑ์ Google Cloud รายการ รวมถึง Cloud Functions
เริ่มใช้งาน
ความสามารถที่สำคัญ
ความยืดหยุ่น |
โมเดลข้อมูล Cloud Firestore รองรับโครงสร้างข้อมูลตามลำดับชั้นที่ยืดหยุ่น
เก็บข้อมูลของคุณไว้ในเอกสารที่จัดระเบียบเป็นคอลเล็กชัน เอกสาร
สามารถประกอบด้วยออบเจ็กต์ที่ฝังอยู่ที่ซับซ้อนนอกเหนือจากคอลเล็กชันย่อย
|
การค้นหาแบบชัดเจน |
ใน Cloud Firestore คุณสามารถใช้คำค้นหาเพื่อดึงข้อมูล
เอกสารที่ต้องการ หรือเพื่อเรียกเอกสารทั้งหมดในคอลเล็กชันที่
จับคู่พารามิเตอร์การค้นหาของคุณ คำค้นหาสามารถมีได้หลายรายการ
และรวมการกรองและการจัดเรียงเข้าด้วยกัน หมวดหมู่ดังกล่าวยังได้รับการจัดทำดัชนีโดยค่าเริ่มต้นด้วย
ประสิทธิภาพของการค้นหาจึงเป็นสัดส่วนกับขนาดของชุดผลลัพธ์ ไม่ใช่
ชุดข้อมูลของคุณ
|
การอัปเดตแบบเรียลไทม์ |
เช่นเดียวกับ Realtime Database Cloud Firestore ใช้การซิงค์ข้อมูลเพื่ออัปเดตข้อมูลบน
อุปกรณ์ใดก็ตามที่เชื่อมต่อ แต่โมเดลยังออกแบบมาให้ใช้งานง่าย และทำเพียงครั้งเดียว
ดึงข้อมูลการค้นหาอย่างมีประสิทธิภาพ
|
การสนับสนุนแบบออฟไลน์ |
Cloud Firestore จะแคชข้อมูลที่แอปของคุณใช้อยู่ เพื่อให้แอปเขียนได้
อ่าน ฟัง และค้นหาข้อมูลแม้อุปกรณ์จะออฟไลน์อยู่ เมื่อ
อุปกรณ์กลับมาออนไลน์อีก Cloud Firestore จะซิงค์ข้อมูลการเปลี่ยนแปลงในเครื่อง
ไปยัง Cloud Firestore
|
ออกแบบมาเพื่อปรับขนาด |
Cloud Firestore นำเสนอสิ่งที่ดีที่สุดของ Google Cloud
โครงสร้างพื้นฐาน: การจำลองข้อมูลหลายภูมิภาคโดยอัตโนมัติ แข็งแกร่ง
การรับประกันความสอดคล้อง การดำเนินการแบบกลุ่ม และธุรกรรมจริง
การสนับสนุน เราได้ออกแบบ Cloud Firestore เพื่อรองรับฐานข้อมูลที่ยากที่สุด
ที่หลากหลายจากแอปที่ใหญ่ที่สุดในโลก
|
วิธีการทำงาน

Cloud Firestore คือฐานข้อมูล NoSQL ที่โฮสต์ในระบบคลาวด์ซึ่ง Apple, Android และเว็บของคุณ
แอปเข้าถึงได้โดยตรงผ่าน SDK แบบเนทีฟ Cloud Firestoreยังว่างอยู่
ใน Node.js, Java, Python, Unity, C++ และ Go SDK แบบเนทีฟ นอกเหนือจาก REST และ
RPC API
คุณเก็บข้อมูลในเอกสารที่เป็นไปตามโมเดลข้อมูล NoSQL ของ Cloud Firestore
มีฟิลด์ที่แมปกับค่า เอกสารเหล่านี้เก็บอยู่ใน
ซึ่งเป็นคอนเทนเนอร์สำหรับเอกสารที่คุณสามารถใช้เพื่อ
จัดระเบียบข้อมูลและสร้างคำค้นหา เอกสารรองรับหลายประเภท
ประเภทข้อมูล จากสตริงพื้นฐานและตัวเลขเป็น
ออบเจ็กต์ที่ซับซ้อนและซ้อนหลายระดับ นอกจากนี้ คุณยังสามารถสร้างคอลเล็กชันย่อยภายใน
เอกสาร และสร้างโครงสร้างข้อมูลลำดับชั้นที่ปรับขนาด
ฐานข้อมูลก็ขยายใหญ่ขึ้น โมเดลข้อมูล Cloud Firestore รองรับค่าใดก็ตามที่
โครงสร้างข้อมูลทำงานได้ดีที่สุดสำหรับแอปของคุณ
นอกจากนี้ การค้นหาใน Cloud Firestore ยังชัดเจน มีประสิทธิภาพ และยืดหยุ่นอีกด้วย
สร้างการค้นหาแบบตื้นเพื่อดึงข้อมูลในระดับเอกสารโดยไม่ต้อง
เรียกทั้งคอลเล็กชันหรือคอลเล็กชันย่อยที่ซ้อนกันอยู่ เพิ่มการจัดเรียง
การกรอง และการจำกัดข้อความค้นหาหรือเคอร์เซอร์เพื่อ
ใส่เลขหน้าให้ผลลัพธ์ เพื่อให้ข้อมูลในแอปเป็นปัจจุบันอยู่เสมอโดยไม่ต้องเรียกข้อมูล
ฐานข้อมูลทั้งหมดทุกครั้งที่มีการอัปเดตเกิดขึ้น ให้เพิ่ม Listener แบบเรียลไทม์
การเพิ่ม Listener แบบเรียลไทม์ลงในแอปจะแจ้งให้คุณทราบผ่านสแนปชอตข้อมูลได้ทุกเมื่อ
ข้อมูลที่แอปไคลเอ็นต์กำลังฟังอยู่ โดยดึงข้อมูลเฉพาะ
การเปลี่ยนแปลง
ปกป้องข้อมูลของคุณใน Cloud Firestore ด้วย Firebase Authentication และ
Cloud Firestore Security Rules สำหรับ Android, แพลตฟอร์ม Apple และ JavaScript หรือ Identity
และ Access Management (IAM) สำหรับภาษาฝั่งเซิร์ฟเวอร์
เส้นทางการใช้งาน
|
ผสานรวม SDK Cloud Firestore รายการ |
รวมลูกค้าอย่างรวดเร็วผ่าน Gradle, CocoaPods หรือสคริปต์ ซึ่งรวมถึง |
|
รักษาความปลอดภัยให้ข้อมูลของคุณ |
ใช้ Cloud Firestore Security Rules หรือ Identity and Access Management (IAM) เพื่อรักษาความปลอดภัย
ข้อมูลการพัฒนาบนอุปกรณ์เคลื่อนที่/เว็บและเซิร์ฟเวอร์ตามลำดับ |
|
เพิ่มข้อมูล |
สร้างเอกสารและคอลเล็กชันในฐานข้อมูล |
|
รับข้อมูล |
สร้างการค้นหาหรือใช้ Listener แบบเรียลไทม์เพื่อดึงข้อมูลจาก
ฐานข้อมูล |
ขั้นตอนถัดไป
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-17 UTC
[null,null,["อัปเดตล่าสุด 2025-08-17 UTC"],[],[],null,["Cloud Firestore \nplat_ios plat_android plat_web plat_flutter plat_cpp plat_unity plat_node plat_java plat_python plat_go \nUse our flexible, scalable NoSQL cloud database, built\non Google Cloud infrastructure, to store and sync data for client- and\nserver-side development. \n\nCloud Firestore is a flexible, scalable database for mobile, web,\nand server development from Firebase and Google Cloud. Like\nFirebase Realtime Database, it keeps your data in sync across client apps through\nrealtime listeners and offers offline support for mobile and web so you can\nbuild responsive apps that work regardless of network latency or Internet\nconnectivity. Cloud Firestore also offers seamless integration with other Firebase\nand Google Cloud products, including Cloud Functions.\n\nCloud Firestore is available in two editions to meet different needs.\n[Learn about the editions](/docs/firestore/editions)\n\nKey capabilities\n\n|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Flexibility | The Cloud Firestore data model supports flexible, hierarchical data structures. Store your data in documents, organized into collections. Documents can contain complex nested objects in addition to subcollections. |\n| Expressive querying | In Cloud Firestore, you can use queries to retrieve individual, specific documents or to retrieve all the documents in a collection that match your query parameters. Your queries can include multiple, chained filters and combine filtering and sorting. |\n| Realtime updates | Like Realtime Database, Cloud Firestore uses data synchronization to update data on any connected device. However, it's also designed to make simple, one-time fetch queries efficiently. |\n| Offline support | Cloud Firestore caches data that your app is actively using, so the app can write, read, listen to, and query data even if the device is offline. When the device comes back online, Cloud Firestore synchronizes any local changes back to Cloud Firestore. |\n| Designed to scale | Cloud Firestore brings you the best of Google Cloud's powerful infrastructure: automatic multi-region data replication, strong consistency guarantees, atomic batch operations, and ACID transaction support. We've designed Cloud Firestore to handle the toughest database workloads from the world's biggest apps. |\n| MongoDB compatibility | Cloud Firestore offers a MongoDB-compatible API. You can use existing MongoDB application code, drivers, tools, and the open-source ecosystem of MongoDB integrations with Cloud Firestore in the [Enterprise edition.](/docs/firestore/enterprise/mongodb-compatibility-overview) |\n\nHow does it work?\n\nCloud Firestore is a cloud-hosted, NoSQL database that your Apple, Android, and\nweb\napps can access directly via native SDKs. Cloud Firestore is also available\nin native Node.js, Java, Python, Unity, C++ and Go SDKs, in addition to REST and\nRPC APIs.\n\nFollowing Cloud Firestore's document data model, you store data that\ncontain fields mapping to values. These documents are stored in\ncollections, which are containers for your documents that you can use to\norganize your data and build queries. Documents support many different\n[data types](/docs/firestore/manage-data/data-types), from simple strings and numbers, to\ncomplex, nested objects. You can also create subcollections within\ndocuments and build hierarchical data structures that scale as your\ndatabase grows. The Cloud Firestore [data model](/docs/firestore/data-model) supports whatever\ndata structure works best for your app.\n\nAdditionally, querying in Cloud Firestore is expressive, efficient, and flexible.\nCreate shallow queries to retrieve data at the document level without needing to\nretrieve the entire collection, or any nested subcollections. Add sorting,\nfiltering, and limits to your queries or cursors to\npaginate your results. To keep data in your apps current, without retrieving\nyour entire database each time an update happens, add realtime listeners.\nAdding realtime listeners to your app notifies you with a data snapshot whenever\nthe data your client apps are listening to changes, retrieving only the new\nchanges.\n\nProtect access to your data in Cloud Firestore with Firebase Authentication and\nCloud Firestore Security Rules for Android, Apple platforms, and JavaScript, or Identity\nand Access Management (IAM) for server-side languages.\n\nImplementation path\n\n|---|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| | Integrate the Cloud Firestore SDKs | Quickly include clients via Gradle, CocoaPods, or a script include. |\n| | Secure your data | Use Cloud Firestore Security Rules or Identity and Access Management (IAM) to secure your data for mobile/web and server development, respectively. |\n| | Add Data | Create documents and collections in your database. |\n| | Get Data | Create queries or use realtime listeners to retrieve data from the database. |\n\nNext steps\n\n- [Get started](/docs/firestore/quickstart) with Cloud Firestore --- set up your database, then add data and start reading it.\n- Learn more about the Cloud Firestore [data model](/docs/firestore/data-model).\n- Explore the [differences between Realtime Database and Cloud Firestore](/docs/firestore/rtdb-vs-firestore)."]]