Google Cloud Datastore is a highly scalable, managed NoSQL database hosted on the Google Cloud Platform. It provides a durable, highly available data store for applications, which handles aspects like scaling, replication, and sharding fully automatically.
Google Cloud Datastore provides convenient SQL-like queries, supports ACID transactions, and enables indexing to improve query performance.
Google has released Firestore, a new version of Datastore with several improvements and additional features. Existing Datastore users can access these features by cheating a database using “Firestore in Datastore” mode. In future, existing Datastore databases will be automatically upgraded to Firestore.
Related content: Read our guides to Cloud Firestore and Google Cloud NoSQL options
In this article:
Google Cloud Datastore is a NoSQL database designed for high performance, auto-scaling, and easy software development. It includes the following features:
Firestore is a newer version of Datastore and is backward compatible with Datastore (except for its new features). New features added in Firestore include:
Firestore provides two modes:
Google provides an automated migration path for upgrading traditional Datastore to Firestore in Datastore.
A few important notes when using Firestore in Datastore mode:
Related content: Read our guide to Google Cloud migration tools
The following best practices will help you use your database more effectively whether you migrate to Firestore in Datastore mode or continue using Cloud Datastore.
Don’t update a single Datastore entity group too quickly. Google recommends that Datastore users design applications not to require more than one update per second to each entity group. Entities without a parent or children constitute whole entity groups. Rapidly updating an entity creates problems for Datastore writes, such as high latency and timeouts.
Replication and sharding are useful for hotkeys in Datastore. Replication allows you to read portions of a key range at higher rates. Sharding lets you write to key range portions at higher rates, breaking up entities into smaller parts.
Avoid common sharding mistakes such as:
Use the following practices to manage your Datastore index:
Bigtable regularly rewrites tables, removing deleted entries and reorganizing data to make writes and reads more efficient (i.e., compaction). Deleting large numbers of entities in a small key range makes queries slower before Bigtable completes the compaction process.
Avoid using timestamp values for indexed fields to specify entities’ expiration times - retrieving the expired entities would require querying the indexed field. Sharder queries help improve performance by prepending fixed-length strings to expiration timestamps, making locating entities with the same timestamp easier.
Alternatively, use a generation number prepended to the entities’ timestamp - this is a regularly updated global counter. This approach makes it easier to sort entities. Undeleted expired entities should have incremented generated numbers - queries must address new generations to ensure optimal performance.
NetApp Cloud Volumes ONTAP, the leading enterprise-grade storage management solution, delivers secure, proven storage management services on AWS, Azure and Google Cloud. Cloud Volumes ONTAP capacity can scale into the petabytes, and it supports various use cases such as file services, databases, DevOps or any other enterprise workload, with a strong set of features including high availability, data protection, storage efficiencies, Kubernetes integration, and more.
In particular, Cloud Volumes ONTAP helps in addressing database workloads challenges in the cloud, and filling the gap between your cloud-based database capabilities and the public cloud resources it runs on. Learn more in these Cloud Volumes ONTAP Databases Case Studies.