r/Firebase • • Sep 18 '16

Why You Should Never Use Firebase

https://crisp.im/blog/why-you-should-never-use-firebase-realtime-database/
1 Upvotes

7 comments sorted by

16

u/Methodric Sep 18 '16

There are many incorrect statements in this article. Very odd. Like.. there is plenty of pagination support, on the queries. The issue with firebase is it replaces backend infrastructure, but can't do squat all about bad programmers. Doesn't feel like they used firebase properly, just as a replacement for a flat db.

If you are doing 60gb of traffic a month, then you will never achieve that io on a 5$ digital ocean server.

Correct me if I'm wrong, but it just doesn't seem like they actually embraced firebase, they just attempted to throw crap at the wall and see what sticks, instead of working the problem to fit the tools.

8

u/nonagonx Sep 18 '16

I agree, this article is terrible with many simply wrong statements. What really frustrated me was that their app was built with Socket.IO, and Firebase powering their dashboard. This is a really strange use-case, as I am using Firebase because I did not want to learn Socket.IO. "all synced with AMQP"- No idea what this means either, but it sounds like something unnecessary if you are using Firebase.

Here is my full rebuttal which I posted in their comments:

"Server-less, doesn't mean code-less! This means that all your server logic is now in your web or mobile client."

Not true if you use Firebase on the server. I'm glad you mentioned Firebase Queue, because by using that and the Firebase Node library, you can move your server-side logic to an actual server instead of building it all on the client, which I found out is not really secure at all since the security rules are not robust. If you move your server-side logic to respond to events from the Firebase Queue, all your client is doing is pushing messages to the queue. It's a shame you did not talk more about your approaches with Firebase Queue in the article.

"You may query directly your Firebase over the network, but you should avoid doing this because it's really slow at scale."

Can you explain what you mean by this further? What is "querying directly your Firebase over the network"..

"With your own server code, you will gain with maintainability and productivity and you'll will have a cost-effective code-base."

Will it really be the productive to learn how to replicate all of Firebase features with Socket.io? I understand it will be worth it long-term to grasp the intricacies of sockets to save money, I would just be curious as to how your team was able to learn this technology so quickly while migrating, you said it took only 3 weeks to convert to Socket.io.. if that's the case why didn't you just start without Firebase in the first place.

"4 ) Firebase is downloading all subtrees on load"

Why are you querying such a large data set? Doesn't firebase optimize if you only want to limitTo(10) or example user.child('messages').limitTo(10).on('value').. etc? Obviously if you get a reference to all the messages in the database it will load all of them..

"Firebase supports offline operations. It's works like "git commits", but the main issue is that if you client goes offline and then online and that you have concurrency on some inputs (for instance, a shared notepad), you might have some inconstancies, like merge issues."

What in the hell does Firebase offline operations have anything at all to do with git commits? Couldn't you do an onDisconnect here to set a flag that the user has signed off, and then on the server listen for that flag and do a transaction on that shared notepad?

" Queues- This feature was not well maintained by Firebase teams, and we had several bugs, including syncing issues, locks, etc."

Queues seem to be working fine for me, would be interested in hearing more about this.

"Your can't perform operations to get active users, or doing batch operations to update documents having some fields."

I was able to do this by getting a reference on the client to the /.info/connected and then transaction on an "active users" field. When they disconnect, decrement the value. I don't see why you couldn't do batch operations on the server with a Queue? Again, I did not test this at scale, but I'm curious to hear how you failed at either of these things.

"We decided to migrate to a REST API. To make it simple, we used an old-fashioned SQL Database, "

You did not describe at all how you would replicate a real-time presence system with Socket.IO. Everyone knows how to make a SQL database. That's not why I'm using Firebase. I'm using Firebase to maintain state in real-time. a

2

u/eviltofu Sep 19 '16

I think perhaps it's a case of round holes and square pegs?

1

u/at5007 Sep 28 '16

This article openly states that they don't understand the NoSQL structure, when they claim they had to download all subtrees on load. The docs make that very clear and give numerous examples of how to denormalize your data to ensure fast load times.

If I can find problems in their approach from this little information, a good programmer would definitely find plenty more if they actually got to see the code.

1

u/sumskills Sep 18 '16

Thanks for sharing your experiences!

-3

u/[deleted] Sep 18 '16

Great Article