Firebase: Start up your base or fire up your own servers?
Tags: firebase, opinion, startup, technology
Published: 2021-06-30 13:17:54

_This article was originally published on [Applozic Blog](https://www.applozic.com/blog/firebase-start-up-your-base-or-fire-up-your-own-servers/)._

If you clicked this article because of the word "Firebase", you have probably been a part of a mobile application development lifecycle at some point in your life. Some of the services offered by Firebase like <a rel="noreferrer noopener" href="https://firebase.google.com/docs/cloud-messaging" target="_blank">Firebase Cloud Messaging (FCM)</a>, <a rel="noreferrer noopener" href="https://firebase.google.com/docs/dynamic-links/" target="_blank">Firebase Dynamic Links</a>, <a rel="noreferrer noopener" href="https://firebase.google.com/docs/remote-config/" target="_blank">Firebase Remote Config</a> have become synonymous with the features they implement in your applications. At my current organization, [Applozic](https://www.applozic.com), FCM is used for [push notifications for Android applications](https://dev.to/applozic/applozic-android-sdk-tutorial-4-push-notifications-4a2h)</a> built on our platform. At a global level, Firebase is currently among one of the top app development platforms relied upon by developers across the globe.

<p>That said, Firebase's offerings in the Backend-as-a-Service(BaaS) space are not the be all, end all in terms of application development. In this article, I would like to explore some of the features as well as shortcomings application developers have encountered with Firebase, and whether your application might be better suited with your own backend solution.</p>


<h2>What is Firebase?</h2>


<blockquote class="wp-block-quote"><p>Firebase helps you develop high-quality apps, grow your user base, and earn more money. Each feature works independently, and they work even better together.</p><cite>https://firebase.google.com/use-cases</cite></blockquote>

<p>Firebase is a mobile application development platform from Google with powerful features for developing, handling, and enhancing highly functional and versatile web, Android, and iOS platform applications. </p>

<p>Firebase categorizes its services and by creating solutions of these three main problems for developers:</p>

<ul><li><a rel="noreferrer noopener" href="https://firebase.google.com/products-build" target="_blank">Build</a> : Accelerate and scale app development without managing infrastructure</li><li><a rel="noreferrer noopener" href="https://firebase.google.com/products-release" target="_blank">Release &amp; Monitor</a> : Release applications with confidence and monitor their performance and stability in realtime. </li><li><a rel="noreferrer noopener" href="https://firebase.google.com/products-engage" target="_blank">Engage</a> : Boost engagement with rich analytics, A/B testing, and messaging campaigns</li></ul>

<h2>Firebase's ideal customer</h2>

<p>Firebase Use Cases page has some interesting application use-cases which cover some of their more popular offerings and how these services solved <a rel="noreferrer noopener" href="https://firebase.google.com/use-cases/onefootball" target="_blank">a business problem</a> or <a rel="noreferrer noopener" href="https://firebase.google.com/use-cases/fabulous" target="_blank">boosted the customer retention after onboarding</a>. Of course, these are the high visibility success stories where businesses were profitable and Firebase helped them take the next step in their development journey. You can find their showcase <a rel="noreferrer noopener" href="https://firebase.google.com/use-cases" target="_blank">use cases here.</a></p>

<p>To understand what type of customer would benefit the most from Firebase services, let's take a look at their <a rel="noreferrer noopener" href="https://firebase.google.com/pricing" target="_blank">current pricing plan</a>, and see how <strong>George </strong>(a fictional character) created an application using Firebase. </p>

<h2>Building the basics for your app</h2>

<p>George woke up from bed with a great idea for an app and wanted to implement the minimum viable product to make sure the idea gets implemented. Firebase offered George unique services with dedicated APIs that helped with the initial setup of creating a database, managing authentication, storage, messaging, testing, etc., without ever having to understand what is going on in the backend. </p>

<p>The phrase "pace over perfection" is best suited for use cases like this, where the priority is to get a feature implemented over worrying about the nitty-gritty of implementation and since George used only the Free plan, he was able to get an application shipped in minimum possible time. </p>

<figure class="wp-block-image size-large"><img src="https://www.applozic.com/blog/wp-content/uploads/2021/04/firebase-plans.png" alt="firebase pricing plans comparison" class="wp-image-1852"/><figcaption>Firebase pricing plans comparison</figcaption></figure>

<p>A month has passed since George released his app, and he is happy with its success. The app has over 10,000 downloads on mobile and people are using and re-using the app at a moderate level. Everything is great on the public side of the picture. </p>

<h3>Storage Constraints</h3>

<p>Behind the scenes though, the application is reaching its quotas on most of the services. George's app has a lot of inbuilt messaging capabilities and users are sending rich messages (GIFs, emoticons, and animated features) and attaching files in one to one conversations and that is fulfilling his Cloud Storage quota rapidly. </p>

<figure class="wp-block-image size-large"><img src="https://www.applozic.com/blog/wp-content/uploads/2021/04/image-2.png" alt="" class="wp-image-1854"/><figcaption>Free plan vs Paid plan for Firebase Cloud Storage</figcaption></figure>

<p>George considers moving his storage solution to a more cost efficient service like AWS S3, but finds out that due to a <a rel="noreferrer noopener" href="https://en.wikipedia.org/wiki/Vendor_lock-in" target="_blank">Vendor lock-in</a>, he cannot simply migrate from Google Cloud Storage without having to completely rebuild how the app functions. </p>

<h3>Security Constraints</h3>

<p>As the number of users increase, George wants to implement phone authentication as a security measure but finds that the quota for Firebase authentication has already reached its limit, and he needs to either scale up to the paid plan or not implement this feature. </p>

<figure class="wp-block-image size-large"><img src="https://www.applozic.com/blog/wp-content/uploads/2021/04/image-3.png" alt="" class="wp-image-1855"/><figcaption>Free plan vs Paid plan for Firebase Authentication</figcaption></figure>

<h3>Customization Constraints</h3>

<p>Seeing the increasing challenges in maintaining his app in a free to download version, George wants to implement a few exclusive features which then he can ship as a paid app for regular users. He wants to implement customized API calls that will utilize the Realtime Database(RTDB) to provide the users with accurate data. However, Firebase APIs are non-customizable and the quotas for the RTDBs are constraining the ability to onboard new users or implement new features. </p>

<figure class="wp-block-image size-large"><img src="https://www.applozic.com/blog/wp-content/uploads/2021/04/image-4.png" alt="" class="wp-image-1858"/><figcaption>Free plan vs Paid plan for Firebase RTDB</figcaption></figure>

<h3>Point of no return</h3>

<p>The time has arrived for George to make a decision regarding the app's future. To ensure his app keeps functioning, he has to take one of the following decisions:</p>

<ol><li>Move to the paid plan by sourcing investment and giving up partial/full control over his app. </li><li>Move to the paid plan by monetizing his app and asking users to pay to use the service.</li><li>Move away from Firebase services and create a robust backend and storage solution that can withstand scalability without causing disastrous financial repercussions. </li></ol>

<p>Solution 1 and 2 might be good for the short term if the practicality of cost can be solved by George. However, unless George is able to scale up his development efforts and gain a lot more users for his app, these solutions are not going to help in the long term.  </p>

<p>Solution 3, while being the most suitable for the long term, is not viable from the perspective of development or immediate implementation. </p>

<h2>So who exactly is the ideal customer for Firebase?</h2>

<ul><li>If you are just starting your app development journey, Firebase and its services are a great place to start implementing a minimum viable product. </li><li>If you are an Enterprise with oodles of funding and already use the Google Cloud platform, Firebase complements your application with robust APIs and services.</li><li>If you are somewhere in between, Firebase might not be the correct solution for you!</li></ul>

<h2>What developers say </h2>

<p>Multiple articles on blogs and users across social media sites like Reddit, Twitter have opined their  views on Firebase, and I have tried my best to summarize them here.</p>

<h3>Costs increase exponentially based on data usage</h3>

<p>As we saw in George's case, Firebase's current pricing plans are suitable for the initial development of an app (free plan using less data) or enterprise level customers (high cost high value). While Firebase does offer a free plan, but that comes with hard quotas and restrictions that might hinder your application's usage.</p>

<h3><strong>Works only with NoSQL Databases</strong></h3>

<p>Firebase offers two database options - Firestore and Firebase Realtime Database. Both of these have a NoSQL structure, and there is no option to use a relational database. </p>

<p>This becomes a big problem when a developer wants to migrate some or all of their services to other providers and since Firebase uses JSON to store data, there is almost no easy way to be able to migrate from the existing database. </p>

<figure class="wp-block-image"><img src="https://eww-wp.s3.ap-south-1.amazonaws.com/wp-content/uploads/2019/06/11062817/MySQL-vs-NoSQL.jpg" alt=""/><figcaption>Comparison between SQL and NoSQL</figcaption></figure>


<h3><strong>Firebase can be geo restricted</strong></h3>

<p>Firebase is a subdomain of Google, and their official website is https://firebase.google.com, the services can be blocked in any country by a domain ban. This means that if George wanted to publish his app in a country where Google cannot be accessed, he will have to rebuild his core infrastructure to something that is available in that country. </p>

<p>You can find the list of <a rel="noreferrer noopener" href="https://transparencyreport.google.com/traffic/overview" target="_blank">active disruptions to Google on this page.</a> </p>

<h3>Vendor Lock In</h3>

<p>Developing an application using a non open source tool set can be frustrating when you want to add a certain feature or migrate to another service, but due to incompatibility, you are forced to stay with the same service, sometimes at a higher price or lower quality of service. This is called "Vendor Lock In", and it is a prominent detriment in complex applications which use multiple services. </p>

<h2>Conclusion</h2>

<p>If you are in the beginning stages of your app development journey, and your app can be considered "small" - it doesn’t require complex data queries and relies on real-time updates, Firebase is one of the most robust and cost efficient BaaS that you can utilize. </p>

<p>However, as the complexity of your app grows and there is an acute need for customization, high volume data transfers, better data structuring for analysis and querying, Firebase loses its sheen. As a developer, it would be more efficient to create your own backend or build upon existing <a href="https://en.wikipedia.org/wiki/Infrastructure_as_a_service" target="_blank" rel="noreferrer noopener">IaaS</a> platforms. </p>

<p>Have you used Firebase services and what prompted you to use/leave Firebase in search of a solution? If you have ever developed using Firebase, do share your experience as a comment below!</p>

Learn how to set up your Android application with Firebase in 4 easy steps! {% post https://dev.to/applozic/applozic-android-sdk-tutorial-4-push-notifications-4a2h %}