Menggunakan Firestore dalam mode Datastore (Datastore)
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Firestore adalah database dokumen NoSQL yang dibangun untuk penskalaan otomatis, performa tinggi, dan kemudahan pengembangan aplikasi. Ini adalah versi terbaru Datastore dan memperkenalkan beberapa peningkatan pada Datastore.
Karena Firestore dalam mode Datastore (Datastore)
dioptimalkan untuk kasus penggunaan server dan untuk App Engine, sebaiknya gunakan
Datastore untuk database yang akan digunakan terutama oleh
aplikasi App Engine. Firestore dalam mode Native paling berguna untuk kasus penggunaan notifikasi real-time dan seluler. Untuk mengetahui informasi selengkapnya tentang mode Firestore, lihat Memilih antara Mode Native dan mode Datastore.
Dokumen ini menjelaskan cara menggunakan
Library Klien Cloud untuk menyimpan dan
mengambil data dalam database mode Datastore.
Prasyarat dan penyiapan
Siapkan lingkungan dan project Anda untuk memahami cara
aplikasi disusun di App Engine. Tuliskan dan simpan project ID Anda karena
Anda akan membutuhkannya untuk menjalankan aplikasi contoh yang dijelaskan dalam dokumen ini.
Membuat cloning repositori
Download (membuat clone) contoh:
Mengedit konfigurasi project dan menetapkan dependensi
Kode aplikasi
Menggunakan index.yaml file
Aplikasi contoh melakukan kueri. Kueri mode
Datastore yang lebih rumit memerlukan satu atau beberapa
indeks, yang harus Anda tentukan dalam
index.yaml file
yang Anda upload bersama aplikasi Anda. File ini dapat dibuat secara manual, atau
dibuat secara otomatis saat menguji aplikasi Anda secara lokal.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-11 UTC."],[[["\u003cp\u003eFirestore in Datastore mode is a NoSQL document database optimized for server use cases and App Engine, making it ideal for applications primarily used within App Engine.\u003c/p\u003e\n"],["\u003cp\u003eFirestore in Native mode is better suited for mobile applications and those requiring real-time notifications, offering a different set of functionalities compared to Datastore mode.\u003c/p\u003e\n"],["\u003cp\u003eUsing Datastore mode queries often requires defining indexes in an \u003ccode\u003eindex.yaml\u003c/code\u003e file, which can be created manually or generated automatically during local testing of your application.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use the Datastore mode emulator for local development and testing of applications, allowing for a simulated environment before deployment.\u003c/p\u003e\n"],["\u003cp\u003eComprehensive information on Datastore mode, including optimizations and core concepts, can be found in the Firestore in Datastore mode documentation.\u003c/p\u003e\n"]]],[],null,["# Use Firestore in Datastore mode (Datastore)\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nGo Java Node.js PHP Python Ruby .NET Custom\n\nFirestore is a NoSQL document database built for automatic scaling,\nhigh performance, and ease of application development. It is the newest version\nof Datastore and introduces several improvements over\nDatastore.\nBecause [Firestore in Datastore mode (Datastore)](/datastore/docs)\nis optimized for server use cases and for App Engine, we recommend using\nDatastore for databases that will be used primarily by\nApp Engine apps. Firestore in Native mode is most useful for\nmobile and real-time notification use cases. For more information about\nFirestore modes, see [Choosing between Native Mode and\nDatastore mode](/datastore/docs/firestore-or-datastore).\n\nThis document describes how to use the\n[Cloud Client Libraries](/datastore/docs/reference/libraries) to store and\nretrieve data in a Datastore mode database.\n\nPrerequisites and setup\n-----------------------\n\n- [Set up your environment and project](/appengine/docs/flexible/setting-up-environment) to understand how apps are structured in App Engine. Write down and save your project ID, because you will need it to run the sample application described in this document.\n\nClone the repository\n--------------------\n\nDownload (clone) the sample:\n\n\u003cbr /\u003e\n\nEdit project configuration and set dependencies\n-----------------------------------------------\n\n\u003cbr /\u003e\n\nApplication code\n----------------\n\n\nUsing `index.yaml` files\n------------------------\n\nThe sample app performs queries. More elaborate Datastore mode queries require one or more [indexes](/datastore/docs/concepts/indexes), which you must specify in an [`index.yaml` file](/appengine/docs/flexible/configuring-datastore-indexes-with-index-yaml) that you upload along with your app. This file may be created manually, or generated automatically while testing your app locally.\n\nLocal testing\n-------------\n\nIf you need to develop and test your application locally, you can [use the\nDatastore mode emulator](/datastore/docs/tools/datastore-emulator).\n\nFor more information\n--------------------\n\nFor complete information on Datastore mode, including\noptimizations and concepts, see the\n[Firestore in Datastore mode documentation](/datastore/docs/overview)."]]