KEVIN NELSON: Cloud Firestore is a serverless NoSQL document
database that simplifies storing, syncing,
and querying data for your mobile and web
apps at global scale.
You may have heard of that Cloud Firestore is
the next generation of Cloud Datastore,
but what does that mean?
What makes it different?
And what should you do if you're an existing Datastore customer?
I'm Kevin Nelson.
Find out answers to all those questions and more
in this video.
Let's get the question I always get asked first out of the way.
I want to start off by assuring Datastore users that all
your existing Datastore applications will continue
to work under Cloud Firestore running in Datastore mode.
You won't have to make any code changes
and you'll experience zero downtime when your service is
automatically upgraded after Cloud Firestore becomes
generally available.
So with that out of the way, let's do a quick review
of what Datastore is and then I'll
get into the new capabilities being
introduced in Cloud Firestore.
Google Cloud Datastore is a fully managed, NoSQL document
database, built for automatic scaling, high performance,
and ease of application development.
It was introduced with Google App Engine--
Google's original serverless development platform
that today, handles the toughest workloads
from some of the world's most popular apps.
Cloud Firestore builds on the features
and massive scalability of Datastore
while adding several important new features.
The first thing to understand is that Cloud Firestore
runs in two mutually exclusive modes--
Datastore mode and Native mode.
In Datastore mode, Cloud Firestore
runs all your existing Datastore applications
and eliminates some of Datastore's restrictions.
Cloud Firestore is built on an entirely new back end that
brings the best of Google Cloud's powerful cloud
infrastructure to existing Datastore applications.
This includes strong consistency,
automatic multi-region data replication,
atomic batch operations, and transaction support.
Perhaps even better, Cloud Firestore completely
eliminates the entity group transaction limits
that were present in Datastore.
Cloud Firestore has no entity groups
and therefore, no entity group limits.
You get all of these new capabilities and compatibility
with Datastore when running Cloud Firestore in Datastore
mode.
Cloud Firestore Native mode has all the advantages
of Datastore mode, but also contains
a number of new features that make
it easier to power native, mobile, and web apps, including
robust multi-device synchronization, full offline
support, and a comprehensive set of client libraries,
which support an integrated storage
solution across Google App Engine, Kubernetes,
and mobile devices.
You can learn more about this using the link to my left.
It's important to understand, though,
that Cloud Firestore Native mode isn't compatible with existing
Datastore applications.
You'll have to set up a new project with a new Cloud
Firestore database if you want to use Native mode.
In either mode, Cloud Firestore is a truly serverless database
service that eliminates the need to think
about spinning up virtual machines, data
replication, or scaling.
Should your app hit the first page of Techmeme
and suddenly grow from hundreds of QPS to millions,
Cloud Firestore will automatically
scale to handle that surge in traffic.
And congratulations.
The data model in Cloud Firestore Native mode
is similar to the Datastore data model,
but there are a few differences.
Data and Cloud Firestore is organized
into documents and collections, which
are similar to entities and kinds in Datastore.
At the highest level, a Cloud Firestore database
can have any number of collections, which contain
any number of documents.
A document contains a group of key value pairs
called fields in Firestore, similar to properties
in Datastore.
Documents can also contain sub-collections
of additional documents.
Notice the alternating pattern of collections and documents.
Your collections and documents must always
follow this pattern.
You cannot reference a collection in a collection
or a document within a document.
Managing indexes in Cloud Firestore
is also a little different than how
they're managed in Datastore.
Like Datastore, Cloud Firestore requires
an index for every query.
Firestore automatically creates an index
for every document field.
Compound queries require that you first
create a composite index that maps to the range
clause of your query.
These are easy to manage directly
from the Firestore console.
You'll even be prompted to create the composite index
the first time you attempt a query that
doesn't have an existing index.
When you create a new Cloud Firestore database,
you'll select which mode you want--
either Datastore mode or Firestore Native mode.
Consider this choice carefully because you
won't be able to change the mode once the database has
been created.
As I mentioned earlier, to take full advantage of all
of the new capabilities of Cloud Firestore like offline support
and device synchronization, existing Datastore users
will need to set up a new project with a new database
in Firestore Native mode.
This was a very basic introduction
to the Cloud Firestore data model.
You can learn more in my colleague Todd
Kerpelman's video series, Get to Know Cloud Firestore,
on the Google Cloud YouTube channel and online
at cloud.google.com/firestore.
There you can learn all about Cloud
Firestore's [? scheme-less ?] data model and advanced query
capabilities.
OK.
So now you're probably asking yourself,
Firestore sounds great, but what does
it really mean for my existing application using Datastore?
Great question.
During beta, Datastore customers-- or really, anyone--
can try out Firestore by creating a Firestore database
in a new project.
Select Firestore under the Storage options
in the GCP console.
If you want to move existing data into Firestore,
you can do so using the Managed Export and Import service.
Once Cloud Firestore has been launched
for general availability, all Datastore projects
will be automatically migrated to Firestore
running in Datastore mode.
The upgrade will be done automatically for you
with no downtime and no changes to your application.
Absolutely no action is required on your part.
Migrating all Datastore customers
will likely take a few months.
You'll be notified when your migration is
scheduled to begin.
If that time isn't inconvenient or you have a critical time
window where you don't want your application to possibly be
impacted by the automatic migration-- say Black Friday--
you'll be able to indicate preferences via a Google form.
But again, you shouldn't notice any differences
at all during or after migration.
So now you may be wondering whether your next project
should be built using Cloud Firestore in Datastore mode
or Native mode.
In general, we recommend building new applications
in Native mode so your app can take advantage of all
Firestore's capabilities.
But keep in mind that during the beta period,
Cloud Firestore won't have an SLA.
And Cloud Firestore in Native mode
may have some restrictions on the number
of concurrent connections and the maximum number of writes
per second.
Those caps may rise as we get closer to GA.
Refer to the documentation for the latest details.
So Cloud Firestore in Native mode
lets you take advantage of Firestore's full capabilities,
but may not be appropriate for large, mission critical,
enterprise applications until Cloud Firestore goes GA.
So to recap, Cloud Firestore is the next generation
of Datastore.
All existing Datastore databases will
be migrated to Cloud Firestore running
in Datastore mode beginning shortly
after general availability.
That migration will be automatic and seamless.
Firestore in Native mode adds powerful new capabilities
for web and mobile developers, like comprehensive client
libraries, offline support, and automatic device
synchronization.
I hope this video has given you a better idea about some
of the new capabilities of Firestore
and what it means for your existing Datastore
applications.
You can find lots more information about Firestore
on the Google Cloud YouTube channel and in the online docs.
You'll find those links right next to me.
Thanks for listening.
[MUSIC PLAYING]