Firebase / Firestore alternatives – solutions for data sync
Tags: database, sync, firebase, edgecomputing
Published: 2021-11-11 12:15:38

Syncing Data is hard. Every developer who has tried building their own solution knows this. Because of today’s growing data volumes, [data sync is all the more relevant](https://objectbox.io/what-is-data-synchronization-how-to-keep-data-in-sync/). Even with JSON / REST still being a good way to transfer data, the need for out-of-the-box solutions cannot be ignored. That's why this article will present you with the Data Sync solutions that might serve as good Firebase / Firestore alternatives.

## Table Of Contents
* [Introduction](#chapter-1)
    - [What is Firebase?](#chapter-11)
    - [What is the difference between Firebase and Firestore?](#chapter-12)
* [A bit more about Firebase](#chapter-2)
    - [Firebase advantages](#chapter-21)
    - [Firebase disadvantages](#chapter-22)
* [Firebase alternatives](#chapter-3)
    - [List of alternatives](#chapter-31)
    - [Comparison matrix](#chapter-32)
* [ObjectBox Data Sync](#chapter-4)



## Introduction to Firebase and Data Sync <a name="chapter-1"></a>

While being one of the most popular solutions for data sync, Firebase has its own drawbacks. The biggest one is a lack of local data storage and offline access to it. This is where Edge Computing comes in, driving the [shift from the cloud to the edge](https://objectbox.io/what-drives-edge-computing/). We have already discussed the [available edge database solutions](https://objectbox.io/sqlite-alternatives/) that benefit from an offline-first approach. But what about syncing data on the edge? Right now, only a handful of Edge Data Sync solutions exist for Mobile and IoT developers. In this review of Firebase alternatives, we limit ourselves to a selection of the most well-known cloud-based Data Sync solutions. In addition, we include all the edge / offline Data Sync options that we know of.

### What is Firebase? <a name="chapter-11"></a>

Firebase is a development platform from Google that allows building mobile or web applications without needing to take care of the backend. Its backend cloud service, [(M)BaaS](https://en.wikipedia.org/wiki/Mobile_backend_as_a_service), handles aspects like data synchronization, scalability, network, infrastructure challenges etc. The services offered on the platform go well beyond Data Sync (e.g. analytics, crashlytics), but we will look at Firebase from the Data Sync perspective only. Together with Parse and Couchbase, Firebase was one of the first three Data Sync solutions available on the market. All of them started in 2011. Three years later, in 2014, Firebase was acquired by Google and Parse was acquired by Facebook. Later, the Parse platform was open sourced and the server was shut down.  All three are still in use today.

### What is the difference between Firebase and Firestore? <a name="chapter-12"></a>

Firebase is a development platform, and Cloud Firestore is one of the two cloud-based databases offered as a part of the platform, alongside their Realtime Database. So while Firebase stands for a wide collection of services, Firestore is a particular part of the offering.

## A bit more about Firebase <a name="chapter-2"></a>
 
Let us first have a look at the benefits and drawbacks of using Firebase. Then, we will compare Firebase with available alternatives, like Couchbase, Parse and ObjectBox, in a comprehensive matrix.

### What are the Firebase advantages? <a name="chapter-21"></a>
* Google:
    - large team that supports and maintains the product
    - very low risk of the company failing; however, Google has a reputation of discontinuing products / services, so there is no guarantee.
* Backend as a service (ease of use)
* The Firebase Realtime Database has its own advantages:
    - for pure online use cases rather fast
    - great if you do not have a strong DB background
* Pay as you go, price scales with usage

### What are the Firebase disadvantages? <a name="chapter-22"></a>
* Purely cloud based
* Google:
    - vendor lock-in - no migration tools, prevents you from making your app portable
    - you cannot access your data as it is hosted on the Firebase server
* Less flexibility: You cannot optimize the backend to match your app’s needs
* The Firebase Realtime Database has its own drawbacks:
    - the whole DB is a huge JSON file
    - limited querying capabilities
    - no way to efficiently filter data
    - easily disorganized, hard to navigate and search
* Cost insecurities, hard to impossible to predict
* Less iOS support (stronger focus on Android)
* Doesn’t work in countries that don’t allow Google
* User privacy concerns[^1]

## Firebase alternatives: A look at out-of-the-box data sync solutions <a name="chapter-3"></a>

Most of the options for handling [data synchronization as described here](https://objectbox.io/what-is-data-synchronization-how-to-keep-data-in-sync/), are cloud-based backend services ((M)BaaS), platform services (PaaS) or database services (DBaaS). This usually means that Data Sync is not the primary product, but only one forms one part of a whole offering. However, we solely focus on that here.

### What are the Firebase alternatives for data sync? <a name="chapter-31"></a>
* [Cloudant Sync](https://en.wikipedia.org/wiki/Cloudant) - a Cloud database based on CouchDB
* [Couchbase server & Sync Gateway](https://en.wikipedia.org/wiki/Couchbase_Server) - a NoSQL, document database
* [Mongo Realm Sync](https://en.wikipedia.org/wiki/Realm_(database)) - Cloud DB and Cloud Sync
* [ObjectBox Sync](https://objectbox.io/sync/) - an object-oriented embedded NoSQL DB, offering offline and cloud sync
* [Parse](https://en.wikipedia.org/wiki/Parse_(platform)) - a cloud sync solution that works with a self-hosted server
* [Syncstudio](https://www.dbsyncstudio.com/buy/) - a relational database with a cloud-based sync
* [Zumero](https://zumero.com/) - a cloud-based replication of SQL data for Mobile

### Data Sync solutions comparison matrix – Firebase and its alternatives <a name="chapter-32"></a>

| Solution name | Data Sync | Database | Cloud | License |
| ------------- | ------------- | --------- | ------------- | ------------- | --------- |
|**Cloudant Sync** | Two-way cloud data replication | Couch DB: NoSQL, distributed JSON document database | CouchDB <> cloud service | Proprietary (CouchDB is Apache 2.0)|
|**Couchbase server & Sync Gateway** | Sync needs a Couchbase Server | Edge: Couchbase Lite; Server: Couchbase. NoSQL, document database | Always needs Couchbase Server (originally Membase) | Apache 2.0, delayed open source|
|**Firebase[^4]**| Cloud Sync via Google servers | Cloud: Firebase Realtime DB (document store); Edge: Caching only (Firestore) | hosted only | proprietary |
|**Mongo Realm Sync** | Sync (in Alpha); only via Mongo Cloud | Cloud: MongoDB (NoSQL document store), Edge: Mongo Realm (Embedded NoSQL) | hosted service | Server Side Public License (SSPL) |
|**ObjectBox Sync** | Offline Sync, on-premise Sync, Cloud Sync, p2p Sync is planned | Object-oriented embedded NoSQL DB | Self-hosted / on-premise; hosted service upon request only | Bindings - Apache 2.0, proprietary core |
|**Parse** | Cloud Sync, self-hosted or via a provider that offers Parse hosting | Can use MongoDB (NoSQL document store), or PostgreSQL[^3] | Only Cloud, only self-hosted or via a provider that offers Parse hosting | open source, BSD|
|**Syncstudio** | Sync[^2] | Edge: SQLite or MSSQL (including LocalDB or Express); Server: Microsoft SQL | SQL Server; Sync / replication works via cloud only | proprietary, 4 licenses available: Community/Free, Subscription, Perpetual and Royalty Free|
|**Zumero** | Sync | Edge: SQLite; Server: Microsoft SQL | SQL Server; Sync / replication works via cloud only | proprietary, annual license scaling with the number of devices|

Check out a more [detailed Firebase alternatives matrix](https://objectbox.io/firebase-and-firebase-alternatives-a-look-at-data-sync-solutions/), which also includes information about the supported platforms and programming languages of each solution.
 
Note: the term “Data Sync” is not standardized. Even though most developers know what it is and the term is used by a number of big companies, the reality is not that straightforward. If we have missed any other important solutions, let us know about them. Apart from that, if there are inaccuracies in our reasoning, please feel free to point them out. We appreciate your feedback.


## Why you should choose ObjectBox as your Data Sync solution <a name="chapter-4"></a>

ObjectBox is a high-performance NoSQL edge database that is fully ACID-compliant. It is built for efficient data on and across restricted and occasionally connected devices, taking care of keeping data in sync reliably. ObjectBox is optimized for economic resource use on edge devices running mobile, desktop, server, and IoT applications. Its developer tools are easy to use and quick to implement, because they were built with the developer experience in mind. You don’t need to take care of the boilerplate code for resilient connectivity, synchronizing data, and tedious DB optimizations. We strive to make the whole experience with us as seamless as possible: from implementation to maintenance, avoiding undesired problems, and data loss. This doesn’t only reduce stress, but also costs and time to market. We are dedicated to bringing joy and delight to Mobile and IoT application developers.


[^1]: “Firebase has been claimed to be used by Google to track users without their knowledge. On July 14, 2020, a lawsuit was filed accusing Google of (…) logging what the users are looking at in many types of apps, despite the user following Google’s own instructions to turn off the web and app activity collected by the company.” (https://en.wikipedia.org/wiki/Firebase)anced settings.
[^2]: [Microsoft Sync Framework](https://en.wikipedia.org/wiki/Microsoft_Sync_Framework) (renamed Sync Framework Toolkit at some point) is a legacy open source product which MS no longer supports
[^3]: [PostgreSQL vs Postgres](https://www.enterprisedb.com/blog/postgres-vs-postgresql)
[^4]: There are many Cloud Sync alternatives to Firebase, we added the more prominent options and any service that also serves Edge Computing