Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Firebase in a MEAN application?

Background

I am building an Angularjs app and have added express and mongodb to the app already but when looking for some other back-end tools I came across firebase.

I'm just a little confused as to how it all fits together and would appreciate some experienced users input on it.

Question

Does firebase replace the need for mongodb and parts of express or does it work in tandem with them?

If they don't work together why should I use one over the other?

like image 213
Joe Lloyd Avatar asked Oct 24 '15 20:10

Joe Lloyd


1 Answers

MEAN stands for Mongo, Express, Angular, & Node.

If you use Firebase, you would basically be replacing the MongoDB part of the MEAN stack with Firebase. You would still rely on Node / Express to be your server framework, and Angular to be your client framework. Firebase would then serve as your data source as opposed to MongoDB.

The initial configuration would be different. So if you started with some sort of generator ( such as Yeoman or a MEAN boilerplate ), you would probably need to go in and remove any references to MongoDB & Mongoose.

To answer the question, "Why use one over the other", it is really up to you. They are both good solutions.

Firebase seems to be better for real-time data, and in my experience is easier / faster to prototype with than Mongo. If you get into some heavy usage with Firebase, you will have to start paying for it.

MongoDB may have more documentation when it comes to using it with the MEAN stack.

like image 166
Nader Dabit Avatar answered Sep 19 '22 19:09

Nader Dabit