Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Cloud Firestore
plat_ios
plat_android
plat_web
plat_flutter
plat_cpp
plat_unity
plat_node
plat_java
plat_python
plat_go
Gunakan database cloud NoSQL kami yang fleksibel dan skalabel, yang dibangun
di infrastruktur Google Cloud, guna menyimpan dan menyinkronkan data untuk
pengembangan pada sisi klien dan sisi server.
Cloud Firestore adalah database yang fleksibel dan skalabel untuk pengembangan
seluler, web, dan server dari Firebase dan Google Cloud. Seperti
Firebase Realtime Database, database ini menjaga data Anda selalu sinkron di seluruh aplikasi klien melalui
pemroses real-time dan menawarkan dukungan offline untuk perangkat seluler dan web. Dengan demikian,
Anda dapat membangun aplikasi responsif yang tetap berfungsi, terlepas dari faktor latensi jaringan atau konektivitas
internet. Cloud Firestore juga menawarkan integrasi yang lancar dengan produk Firebase
dan Google Cloud lainnya, termasuk Cloud Functions.
Mulai
Kemampuan utama
Fleksibilitas |
Model data Cloud Firestore mendukung struktur data yang hierarkis dan fleksibel.
Simpan data Anda ke dalam dokumen yang tersusun dalam koleksi. Selain subkoleksi, dokumen dapat berisi objek bertingkat yang kompleks.
|
Pembuatan kueri yang ekspresif |
Di Cloud Firestore, Anda dapat menggunakan kueri untuk mengambil satu
dokumen tertentu atau mengambil semua dokumen dalam koleksi yang
sesuai dengan parameter kueri Anda. Kueri Anda dapat meliputi beberapa filter berantai dan menggabungkan filter dan pengurutan. Kueri juga diindeks secara default, sehingga performa kueri sebanding dengan ukuran set hasil, bukan set data.
|
Update realtime |
Seperti Realtime Database, Cloud Firestore menggunakan sinkronisasi data untuk memperbarui data di
perangkat yang terhubung. Namun, Cloud Firestore juga dirancang untuk membuat kueri pengambilan 1 kali yang sederhana secara efisien.
|
Dukungan offline |
Cloud Firestore menyimpan data yang digunakan secara aktif oleh aplikasi Anda ke dalam cache, sehingga aplikasi dapat menulis,
membaca, memproses, dan mengkueri data, meskipun perangkat sedang offline. Jika
perangkat kembali online, Cloud Firestore akan menyinkronkan semua perubahan lokal kembali
ke Cloud Firestore.
|
Dirancang untuk diskalakan |
Cloud Firestore menghadirkan yang terbaik dari infrastruktur Google Cloud yang canggih
untuk Anda: replikasi data multi-region otomatis,
jaminan konsistensi yang kuat, operasi batch atomik, dan dukungan transaksi
nyata. Kami merancang Cloud Firestore untuk menangani beban kerja database
terberat dari aplikasi terbesar di dunia.
|
Bagaimana cara kerjanya?

Cloud Firestore adalah database NoSQL yang dihosting di cloud dan dapat diakses langsung oleh aplikasi Apple, Android, dan
web Anda melalui SDK native. Cloud Firestore juga tersedia
di SDK native Node.js, Java, Python, Unity, C ++, dan Go, selain REST API dan
RPC API.
Dengan mengikuti model data NoSQL Cloud Firestore, Anda menyimpan data dalam dokumen yang
berisi pemetaan kolom
terhadap nilai. Dokumen ini disimpan dalam koleksi, yang merupakan container untuk dokumen Anda, yang dapat digunakan untuk mengatur data dan mem-build kueri. Dokumen mendukung berbagai
jenis data, dari string dan angka yang sederhana hingga
objek bertingkat yang kompleks. Anda juga dapat membuat subkoleksi dalam dokumen dan mem-build struktur data hierarkis yang dapat diskalakan sesuai dengan pertumbuhan database. Model data Cloud Firestore mendukung apa pun
struktur data yang paling cocok untuk aplikasi Anda.
Selain itu, pembuatan kueri di Cloud Firestore bersifat ekspresif, efisien, dan fleksibel.
Buatlah kueri dangkal untuk mengambil data pada tingkat dokumen tanpa perlu mengambil keseluruhan koleksi atau subkoleksi bertingkat. Tambahkan pengurutan, filter, dan batasan pada kueri atau kursor untuk memberi nomor halaman pada hasil Anda. Tambahkan pemroses realtime untuk menjaga data di aplikasi Anda tetap terkini, tanpa harus mengambil keseluruhan database setiap kali ada pembaruan.
Dengan menambahkan pemroses realtime ke aplikasi, Anda akan mendapatkan pemberitahuan tentang snapshot data setiap kali data yang diproses oleh aplikasi klien berubah. Hanya perubahan baru yang akan diambil.
Lindungi akses ke data Anda di Cloud Firestore dengan Firebase Authentication dan
Cloud Firestore Security Rules untuk Android, platform Apple, dan JavaScript, atau Identity
and Access Management (IAM) untuk bahasa sisi server.
Alur implementasi
|
Mengintegrasikan Cloud Firestore SDK |
Sertakan klien dengan cepat melalui Gradle, CocoaPods, atau script include. |
|
Melindungi data |
Gunakan Cloud Firestore Security Rules atau Identity and Access Management (IAM) untuk mengamankan
data Anda, masing-masing untuk
pengembangan seluler/web dan server. |
|
Menambahkan Data |
Buat dokumen dan koleksi di database Anda. |
|
Mendapatkan Data |
Buat kueri atau gunakan pemroses realtime untuk mengambil data dari database. |
Langkah berikutnya
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-08-17 UTC.
[null,null,["Terakhir diperbarui pada 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)."]]