7

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?

Community
  • 1
  • 1
Joe Lloyd
  • 19,471
  • 7
  • 53
  • 81

1 Answers1

10

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.

Nader Dabit
  • 52,483
  • 13
  • 107
  • 91
  • 2
    Great explanation. We sometimes see this referred to as the FAN stack: Firebase Angular Node. – Frank van Puffelen Oct 25 '15 at 00:30
  • Thats exactly the type of answer I was looking for. I just have one other question, does firebase replace some express plugins like passport since it has its own authentication? – Joe Lloyd Oct 25 '15 at 08:10
  • 3
    Express would be almost meaningless with Firebase, which already provides free hosting, and a [great alternative](https://github.com/firebase/firebase-queue) to the typical RESTful strategy, turning entire server stacks into scriptlets. So FAN indeed. – Kato Oct 26 '15 at 18:12