Blog

5 Things You Can’t Do With Firebase (But Can With Backendless)

by on May 22, 2018

Backendless and Firebase, both being mobile backend as a service (MBaaS) platforms, present different capabilities for mobile app creation.

Here is a list of the Backendless features which either are not supported by Firebase or just exceed it in usability.

  1. Backendless Pro (the standalone, self-hosted version of the product) can be installed on the developer’s computer, a private data center or a public cloud. No matter where it’s installed, the product has no functional limitations whatsoever.
  2. With Backendless, you can fully customize permissions for users. You can also configure permissions for custom user roles, which is not supported by Firebase.
  3. Backendless allows you to develop the server-side algorithms and business logic (Cloud Code) without actually writing any code using Codeless Programming.
  4. Firebase does not support native aggregate functions in database queries. With Backendless, you can calculate average, sum, min and max values for a collection of objects without retrieving objects from the server. It is also possible to find the object count for all the records in the database or a subset of records. You can learn more about aggregate functions in Backendless here.

    For example, the aggregate function “sum” allows you to calculate the mathematical sum for a set of objects. For instance, you can take the Movie table from the presented database.DB
    Just run the following query to get the amount of topBoxOffice of all movies:

    GET https://api.backendless.com/<appid>/<REST API key>/data/Movie?props=Sum(totalBoxOffice)

    The output is an object with the sum property:

    [
       {
           "sum": 14507795640,
           "___class": "Movie"
       }
    ]
    

    Backendless also supports results grouping for a column. This column can either be found in the original or linked table. For example, the following query will display the sum of all orders, grouped by country:

    GET https://api.backendless.com/<app id>/<REST API key>/data/Orders?props=Sum(orderAmount)&groupBy=relatedCountry.countryName

    The output for this request is a collection of objects, any of which contains the total amount of orders for a particular country:

    [
     {
       "sum": 1324231,
       "countryName": "Italy",
       "___class": "Orders"
     },
     {
       "sum": 5675675,
       "countryName": "France",
       "___class": "Orders"
     },
     {
       "sum": 2342234,
       "countryName": "Ireland",
       "___class": "Orders"
     }
    ]

    You can also add a filter to the grouped objects using the having condition. The following query will return only groups of countries with the total amount of orders > 10000. The output for this request is a collection of objects, any of which contains the total amount of orders for a particular country:

    GET https://api.backendless.com/<app id>/<REST API key>/data/Orders?props=Sum(orderAmount)&groupBy=relatedCountry.countryName&having=Sum(orderAmount)>10000
  5. Since Firebase uses JSON document as a database, it becomes extremely difficult (or in many cases impossible) to create relations between objects. Backendless makes it convenient to manage the relations (create, modify, delete) both via Backendless Console and with the API. In Firebase, you need to duplicate the data for each element, which causes synchronization problems for the identical objects that have one-to-many relations.

It is worthwhile to point out the following:

  1. Backendless allows you to import data from Parse. Importing data from external databases is now available as well.
  2. Firebase, unlike Backendless, does not allow you to make complex queries on the server; only basic filtering is supported. For more details see: backendless.com/docs/rest/doc.html#data_search_with_subquery.
  3. Backendless Console is way more convenient and has far more functionality than Firebase’s user interface.
  4. Backendless support is beyond comparison.
  5. Backendless version 5 is available now! New features are described here.

 

Leave a Reply