I am working on a project that will include a Laravel web application, Android application, and iOS application. I am new to iOS. Since a user's data will need to be synchronized across all platforms, I assume the optimal way to do this is with a Relational Database (i.e. MySQL) and a PHP Web Service that interacts with the mobile apps.
Everything I see online says to basically use Firebase for mobile apps. There is a lot of work to create the PHP Web Services necessary. I am surprised the dominant recommendation is to use Firebase. About every iPhone app I have has both web and mobile platforms where data must be synchronized. I assume they cannot use Firebase and must use PHP Web Services.
Am I missing something?
You are absolutely correct that it is not a foregone conclusion that one would use Firebase. It’s a great solution that fills a particular niche, but developing separate web services is extremely common. (I suspect that that your online research may be biased by the fact that most of these articles are likely geared for mobile developers who might not have the wherewithal to develop, maintain, and support their own web server infrastructure.)
That having been said, I would not have jumped to the conclusion that the “optimal” way would be to write your own backend going against some RDBMS. These NoSQL solutions, like Firebase, are perfectly up to the job in most cases. There are pros and cons on both sides of the NoSQL vs RDBMS discussion (which is probably beyond the scope of this question).
So, do not be unduly biased by these Firebase articles you found online, but consider adding it to your tech stack if:
there are some compelling Firebase features that you don’t want to reinvent yourself (e.g. the integrated authentication options are nice; the realtime observers for database changes is a killer feature, if you need that; etc.);
the NoSQL paradigm of Firebase’s “Real-time Database” fits your app’s requirements; and
you need backend server capabilities, but don’t want to deal with the overhead of developing and maintaining your own backend.
In your case, because you’re already developing a Laravel app, that largely undermines that last rationale, because you’ve obviously already signed up for that.
So, it is just a question of what Firebase features you need and whether these features are compelling enough to justify adding Firebase to your tech stack. But don’t use Firebase because you found a bunch of articles advocating for it. Nor should you dismiss Firebase because you fear it won’t be “optimal”. It depends.
All of that having been said, the excellent, seamless, object-to-database mapping that Laravel provides really begs for the SQL database approach. If you tried to use Firebase for the backend, you’d likely lose a lot of the benefits of Laravel.
I'm fairly new to app development, and have no apps in the app store. However, the app that I have been working on is really progressing along.
The backend database that I have been using is Firebase, because it is so user friendly, easy to use, and easy to roll out an MVP. However, in the last couple of days I've really started hitting barriers with Firebase and how limited its querying functionality is, and how the code will become a "spaghetti" mess after a while. I'm looking for advice from some experienced programmers/developers.
Is Firebase viable for an app that depends heavily on searching? Can I couple Firebase with another service like Algolia and ElasticSearch to fix this problem? I'm concerned that if I press forward with Firebase and I eventually need to swap over to my own database that it will be pretty much impossible if I had 100,000 users. Especially factoring in the cost of such services after the app scales.
Or should I start my own backend (even though I have no experience with this at all) and move forward from there? I can learn, and don't have a problem putting forth effort in this area, but its a whole new journey for me. If this is the absolute right thing to do in order for me to have the ability to turn my app into a success story like your Uber's and AirBNB's, then I want to start out in this area and not get screwed on a transition from Firebase.
In summary, my question: If you were to start a company that could be the next Uber, where would you start your MVP? Firebase w/Elastic Search, your own custom backend, MongoDB, node.js, etc?
Thanks so much for the help and insight in advance!
thank you all for reading my question~
Before asking some (2~3) questions, I will briefly explain what I am trying to do. I am trying to build a turn based multiplayer (1 vs 1) game. I have a little knowledge of Swift/IOS development, mysql, html, and jsp. I am planning to learn php since many people say combination of mysql and php is good for ios back-end programming.
Here are actual questions:
Do I need to get a droplet from places like Digital Ocean and deploy my own server? Or is it possible to use web hosting such as bluehost for this purpose?
This is the part which I have no clue about... How do I actually develop a multiplayer game? I can guess that this has something to do with tcp/ip socket programming. My experience with tcp/ip programming did not require mysql or something similar if I remember it correctly. In that vein, what's the role of some database like mysql when it comes to developing a multiplayer game? Of course it becomes handy when saving scores and achievement; however, I do not know why it is required for finding a match and establishing a connection. Wouldn't a private server needed instead for receiving and sending sockets? Does this mean I have to lease a dedicated server and setup everything by myself?
It seems like there are more than three questions... sorry for asking too many questions. I am a noob programmer and needs many advice from experts!
Is is necessary for me to deploy a web application for handling all backend stuffs? By the way, I am trying to avoid having users make an account. As a result, if I have to manage each user, maybe keeping each user's unique phone id can help me distinguish each user?
I have looked into both Google's and Apple's free game match system... It is very tempting to use them, but my friends designed game match screen and separate ranking systems. As so, I need to come up with a way to solve this conundrum. Please help me!!! Thank you all for reading my question again and help a poor soul here...
I am planning to build an iOS app with react native and I am super excited to do so.
Unfortunately the deadline is quite short, so I am considering to use an approach like this, which hosts the app bundle in the cloud for the production build of the application.
This may be beneficial, as an api will be build for the app and I could simply change the code of the deployed app if the api behaves otherwise than previously assumed.
As this seems like a good idea on first thought and I am quite sure it is a good idea in terms of testing and continuous delivery I am not sure if this works out in production and if the application will be accapted by apple.
So my question is if such an application would be approved by apple and if this kind of structure provides any problems on the users devices.
Yes, this tends to be good idea. Usually, application stores a lot of data (authentication, user data and so on) on it's own servers.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
MongoDB vs Firebase
What are some quantitative advantages of using Firebase over MongoDB? (not opinions)
I know that Firebase is a cloud-based service with its own API, but I feel like Mongo may give me greater control in the long run.
Firebase is a real-time engine with backward connectivity. I.e. you might build a cross-platform app where clients subscribe to events on specific data and server actively informs clients about changes
The data layer is hosted for you. Mind that it is highly scalable. It's a nice kickstarter solution. Including auth management
Geo-Fire. Real-time geo coordinates solution.
Evident drawbacks of Firebase are:
You have to pay for it as soon as you start growing
You can't host datalayer (if owning data is critical or you develop an app for some separated subnet)
EDIT: here is a nice article how to replace Firebase in your app with Node.js+MongoDb. It shows how much work you would have to do on your own, and explains, IMHO, why a startup (small app) should begin with Firebase (if real-time updates to clients are required) and proceed with MongoDb (in any case self-written solution) if the project keeps evolving
EDIT 2: after being acquired by Google Firebase now offers various perks on top of its basic features which you would struggle to build on your own:
For development
Cloud Messaging: Deliver and receive messages across platforms reliably
File Storage: Easy file storage (including iOS)
Hosting: deliver static files from Firebase's servers (Included in Free plan)
Crash Reporting: Not a full logging service, but crucial help
For growth
Remote Config: Customize your app on the fly: suitable for A/B testing
Dynamic Links: Send users to the right place inside your app
Notifications: Engage with users at the right moment
Apples and oranges. Firebase is a Backend-as-a-Service containing identity management, realtime data views and a document database. It runs in the cloud.
MongoDB on the other hand is a full fledged database with a rich query language. In principle it runs on your own machine, but there are cloud providers.
If you are looking for the database component only MongoDB is much more mature and feature-rich.
Firebase is designed for real-time updates. It easily integrates with angular. Both are NoSQL databases. MongoDB can also do this with Angular through Socket.io integration. Meteor.js also makes use of MongoDB with an open socket connection for real-time updates.
MongoDB can be run locally, or hosted on many different cloud based providers. Firebase, in my opinion is great for smaller apps, very quick to get up and running. MongoDB is ideal for more robust larger apps, real-time integration is possible but it takes a bit more work.
After using Firebase a considerable amount I've come to find something.
If you intend to use it for large, real time apps, it isn't the best choice. It has its own wide array of problems including a bad error handling system and limitations. You will spend significant time trying to understand Firebase and it's kinks. It's also quite easy for a project to become a monolithic thing that goes out of control. MongoDB is a much better choice as far as a backend for a large app goes.
However, if you need to make a small app or quickly prototype something, Firebase is a great choice. It'll be incredibly easy way to hit the ground running.
I will answer this question in terms of AngularFire, Firebase's library for Angular.
Tl;dr: superpowers. :-)
AngularFire's three-way data binding. Angular binds the view and the $scope, i.e., what your users do in the view automagically updates in the local variables, and when your JavaScript updates a local variable the view automagically updates. With Firebase the cloud database also updates automagically. You don't need to write $http.get or $http.put requests, the data just updates.
Five-way data binding, and seven-way, nine-way, etc. I made a tic-tac-toe game using AngularFire. Two players can play together, with the two views updating the two $scopes and the cloud database. You could make a game with three or more players, all sharing one Firebase database.
AngularFire's OAuth2 library makes authorization easy with Facebook, GitHub, Google, Twitter, tokens, and passwords.
Double security. You can set up your Angular routes to require authorization, and set up rules in Firebase about who can read and write data.
There's no back end. You don't need to make a server with Node and Express. Running your own server can be a lot of work, require knowing about security, require that someone do something if the server goes down, etc.
Fast. If your server is in San Francisco and the client is in San Jose, fine. But for a client in Bangalore connecting to your server will be slower. Firebase is deployed around the world for fast connections everywhere.
Firebase is a suite of features .
Realtime Database
Hosting
Authentication
Storage
Cloud Messaging
Remote Config
Test Lab
Crash Reporting
Notifications
App Indexing
Dynamic Links
Invites
AdWords
AdMob
I believe you are trying to compare Firebase Realtime Database with Mongo DB .
Firebase Realtime Database stores data as JSON format and syncs to all updates of the data to all clients listening to the data . It abstracts you from all complexity that is needed to setup and scale any database . I will not recommend firebase where you have lot of complex scenarios where aggregation of data is needed .(Queries that need SUM/AVERAGE kind of stuff ) . Though this is recently achievable using Firebase functions . Modeling data in Firebase is tricky . But it is the best way to get you started instantaneously .
MongoDB is a database. This give you lot of powerful features. But MongoDB when installed in any platform you need to manage it by yourself .
When i try to choose between Firebase or MongoDB(or any DB ) . I try to answer the following .
Are there many aggregation queries that gets executed .(Like in
case of reporting tool or BI tool ) . If Yes dont go for Firebase
Do i need to perform lot of transaction . (If yes then i would
not like to go with firebase) (Tranactions are somewhat easy though
after introduction of functions but that is also a overhead if lot of
transactions needs to be maintained)
What timeline do i have to get things up and running .(Firebase
is very easy to setup and integrate ).
Do i have expertise to scale up the DB and trouble shoot DB related
stuffs . (Firebase is more like SAAS so no need to worry about scaleability)
In my experience, working with Firebase is a huge advantage if you are trying to do user management, database, messaging sort of app since all of these features are already well integrated.
Like others have said, if you're just focused on the database/querying aspect, stick to mongo.
Firebase provides some good features like real time change reflection , easy integration of authentication mechanism , and lots of other built-in features for rapid web development.
Firebase, really makes Web development so simple that never exists. Firebase database is a fork of MongoDB.
What's the advantage of using Firebase over MongoDB?
You can take advantage of all built-in features of Firebase over MongoDB.