John Doe
John Doe

Reputation: 1043

Is it wise to only use Firebase as database?

I come from SQL background, so Firebase is pretty big shift for me. My most recent project requires me to consider only useing Firebase for data and file storing.

The project is a social messaging app that has already up to 100K registered users.

My concern is, can Firebase fully substitute SQL? Features that I find problematic:

  1. Filtering millions of messages for specific keywords (language moderation)
  2. Allowing users to block each other (should take effect immediately both ways)
  3. Remotely logging-out users from unwanted devices
  4. Monitoring daily statistics (how many likes, messages, users appeared which day)
  5. Filtering users by various attributes (name, distance, gender, age)

I want to avoid situation 2 years down the line, when 50 million messages have been sent and suddenly a bad-language filter needs to be put in place. Now what.

In SQL I would run

delete from messages where content like "%bad-word%"

5 minutes later, done.

So my question is, can Firebase fully substitute SQL?

Upvotes: 0

Views: 1078

Answers (1)

amsh
amsh

Reputation: 3377

No, firebase can't fully substitute SQL as of now. But there are solutions to the problems you mentioned while using Firebase with 3rd party systems or custom implementations.

Before considering firebase for your solution in place of SQL, you should consider that it is noSQL, and has entirely different paradigm. There are many usecases that are easy to implement with noSQL, so it depends on the scenario. Firebase is better suited for realtime scenarios.

  1. Firebase (Real Time DB or Firestore) doesn't have full text search as of now. You will have to use Algolia or ElasticSearch or do some custom implementation similar to this (and some other articles available online).

  2. If blocking users simply means adding an entry to some one on one table that tells user X blocked user Y, firebase can do it with realtime execution.

  3. We can remotely logout users using admin sdk, like this.

  4. Not supported. You will have to maintain a count key for each stat you want to get, else you will have to fetch all (or partial of all) data and count on client side.

  5. You can query records on a number of factors. As a reference please look at firebase firestore queries.

Please let me know if you have any questions.

Upvotes: 1

Related Questions