This article is more than 1 year old
Google backs up Firebase with a second realtime NoSQL silo
Cloud Firestore aspires to scale better
Google's twin fetish manifested itself in its Firebase platform-as-a-service offering on Tuesday through the introduction of a second realtime NoSQL database.
Firebase has been growing in popularity among mobile and web developers thanks in part to the Firebase Realtime Database, which provides a way to synchronize data across multiple clients more or less instantaneously.
This turns out to be a quite useful for games or social apps, where you want everyone to be on the same page, and isn't particularly easy to do when users may be located all over the world.
Realm offers something similar called the Realm Mobile Database.
And now Google has something similar too, Cloud Firestore, a doppelgänger with distinctions.
Google exhibits double vision fairly often. It backs up products they way people back up data. It has two cloud platforms (Google Cloud Platform and the mobile-oriented Firebase). It maintains two operating system (Android and ChromeOS, not to mention the nascent Fuchsia), two email services (Gmail and Inbox, incestuous though they may be), and two chat applications (Allo and Hangouts). It developed two programming languages (Go and Dart). And for a time, Google Video co-existed with YouTube.
Cloud Firestore has been designed to address the shortcomings of Firebase Realtime Database: data structuring, querying, and scaling.
Toward that end, it's more structured. Where Firebase stores data in a single JSON tree, Cloud Firestore relies on a hierarchical document model. Data gets stored as key-value pairs in objects called documents that are organized into collections, which can contain subcollections.
Under this arrangement, explains Google developer advocate Todd Kerpelman in a blog post on Tuesday, queries are shallow, meaning data can be queried without fetching unnecessary baggage – all of the linked sub-collections.
Realm – a database you may not have heard of but app devs have – touts cloudy platformREAD MORE
Cloud Firestore also promises easier querying. Where creating a query that combines multiple fields in Firebase Realtime Database requires an explicit act of creation, that generative step is either automatic or presented as an suggested index construction in Cloud Firestore.
Cloud Firestore also supports easier one-time fetch queries than Firebase Realtime Database, which is geared toward implementing listeners for streaming rather than discrete data grabs.
In addition, the new database has been designed to perform better with really large datasets, or so Kerpelman suggests.
"Firebase always had problems performing at scale," said Alexander Stigsen, cofounder and CEO of Realm, in a phone interview with The Register. "They obviously had to address that, and part of that was to make a whole new backend. In many ways, it's almost a step back. Firestore has higher latency, it's slower. But it will allegedly solve the scaling problems."
Stigsen said as he understood it, Firestore relies on Google's Spanner database. Google uses Spanner internally and with Google Cloud Platform.
Stigsen said Realm has the advantage of running anywhere, in Amazon, Google's, or Microsoft's clouds, or on-premises, which matters to enterprises.
Another point of differentiation between Firebase and Cloud Firestore is pricing: Firebase Realtime Database pricing is based on the amount of data downloaded and the amount of data stored. Such considerations factor into Cloud Firestore too, but its pricing is mainly determined by the number of reads and writes performed.
Cloud Firestore server SDKs are available for Go, Java, Node.js, and Python, with additional language support planned. Client SDKs are available for Android, iOS, and the web. ®