Mega Bundle SALE is ON! Get ALL of our amazing iOS app codebases at 95% OFF discount 🔥

Firebase Database is a free backend infrastructure product, provided by Google, that serves as a backend for your mobile app. It can store an unlimited amount of unstructured data, that can be queried in real-time by mobile apps with only a few lines of code, due to the powerful SDKs provided by Google.

firebase server ios app templates swift

Any mobile app that relies on dynamic data needs a backend database, to store that data. For a shopping app, you would need to store your products, orders (customers and shipping addresses), payments, and product details. For a social media app, you would need to store all the content created by users (posts, comments, likes, etc). For a news reader app, you’d need a database to store your articles, comments, etc. You get the point.

The things get even more difficult because storing that data is not enough. You also need a way of serving the data in the database to the web or mobile clients (iOS/Android/Web apps). Not even this is enough though: you also need a way of keeping the clients in sync, up to date, with all the changes in your database (a.k.a real-time updates).

Achieving all of this requires a solid software infrastructure, that will take a very long time to build, and also could cost tens of thousands of dollars. This is where Firebase Database comes into play.

Firebase Database is a free backend infrastructure product, provided by Google, that serves as a backend for your mobile app. Its usability and scalability make it very powerful, and it should be the first server choice for someone trying to build an Android/iOS mobile app, especially for someone who doesn’t want to spend months and thousands of dollars for it. By adopting Firebase Database, you’ll take advantage of all its amazing features:

Data storage

The data in Firebase is being stored in JSON format. This is the universal HTTP data transfer format, used by all the mobile apps out there. Your data can have any structure you want. This is very convenient because it makes it very easy to import data from anywhere, be it from your WooCommerce online store, your WordPress MySQL database or your Excel spreadsheet. All you need to do is import a .json file in the Google Firebase dashboard. Here’s an example of how the data for our Firebase iOS Shopping App template is being stored:

firebase database swift ios mobile app

Firebase Database iOS/Android SDKs

This is by far the most powerful feature – integration with Swift and Java, for iOS and Android codebases. Google provides SDKs for all mobile clients. This basically means that you’ll fetch this data into your mobile app with only a few lines of code. This just saved you a few weeks of work, since it does everything for you: networking, API management, JSON parsing, performance analytics, etc. Here’s how easy we are querying the e-commerce products from the database pictured above:

firebase database shopping products fetch json ios swift 4 code

Bidirectional real-time updates

Not only the SDKs provide your classes and methods to easily fetch the data from the Firebase server, but it also provides you ways of writing and updating the data on your server, from the mobile app. This means that you can easily store anything you want (users, payments, orders, articles, comments, etc), by simply calling one of the APIs provided in the free Swift SDK.

Scalability and Security

Firebase is based on top of the enormous cloud computing infrastructure at Google. If there’s something Google knows how to do, is this: scalability. You can add millions of entries into your database, your app’s performance won’t decline (please make sure you paginate though :). Obviously, the whole communication between clients and server is being done through secure channels.

In conclusion, if you’ll ever think about building a mobile app, you should consider Firebase to be your backend server. Not only it’s free and saves you a lot of development time, but it also takes advantage of Google’s scalable and secure infrastructure. It’s hard to imagine you can create a more secure server that scales better than Google.

Categories: Mobile programming

2 Comments

Ray Johnson · May 16, 2018 at 10:38 pm

I wanted to share my experience with selecting a mobile backend for my app. I used to run my applications (I have several in the app store(s)) on Parse and was pretty happy with the backend until Facebook decided to shut down the service. After that I have evaluated all listed options and was not happy with any of them for various reasons. Firebase was not a good fit because the of their approach with JSON document being a database – I did a stress test with million nodes in the tree and the service was not performing well. AWS and Appery are quite complex and become expensive very quickly while Azure and CloudMine are quite limited in the capabilities. Kinvey is both limited and super expensive once you start doing something more serious in the app. In the end I chose Backendless (https://backendless.com) for my backend. The service has native SDKs for all major mobile and web platforms. The usability and developer experience is by far the best I have seen. The service has an extremely flexible server-side code model where I can deploy Java and JS server-side code to override default handling of the API and to create my own API services. My apps leverage social (Facebook, Twitter, Google) login, geolocation, file upload/download, push notifications (iOS, Android) and of course data persistence, which has really awesome support for complex relations. Check it out if you are looking for a flexible and very reasonably priced backend.

duybui · July 20, 2019 at 6:02 am

Thanks for your recommendation, Ray. And yeah, Backendless is also a good choice, like you said. In the future, there will be a lot of back-end services supporting us, and depending on the project’s purpose, we can choose which one is most appropriate.

Leave a Reply

Your email address will not be published. Required fields are marked *

Shopping Cart