Wednesday 27 December 2017

FireChat

The quick answer, YES, Firebase is the best and safest option for the majority of cases users will need it. Is FireChat the best chat API to use for chat? Maybe but I wouldn’t recommend any of those APIs.
I work for a bespoke app development company which specialises in instant chat, we use Firebase for many of our projects. Below I will put some of the advantages and disadvantages of FireChat, then I will add some additional points of the best implementation I see when using chat.
NOTE: Other services will include many of the same advantages and disadvantages, this answer will be trying to show that Firebase is better overall based on its strengths. I disagree that the other services you have mentioned are useless. In my experience they have all been excellent (great developers, documentation etc) but Firebase is exceptional.
Advantages of FireChat
  • Cost: As you mention in your question Firebase is great for starting developers. You can get a good level of users on your app before needing to start paying for the service. This level has been set well to mean that once you start paying you have enough users to be monetising your app.
  • Support: Firebase offer great support and also have a huge community to offer support for them. Due to the size and scale of their company Firebase is widely used. This means if you have problems there is a good chance others have found and solved it already, if not then there are lots of people willing to help on StackOverflow and other forums.
  • Documentation: Firebase has a huge and excellently written documentation base. Their documentation is also extremely complete spreading across almost every feature or function you might want to implement.
  • Security: Security is on both lists. Security is easy to set up and understand on your Firebase database. The fact they give you the freedom to set and modify is a real strength. This enables you to customise your functionality very well to your specific app.
  • Speed: Firebase is super quick which is a very important feature for a real time chat.
  • Quality: The Firebase code is extremely well written and excellently tested. In the 4 years I have been working with Firebase I have yet to find a bug with their provided code.
Disadvantages of FireChat:
  • Searching: Firebase is very bad for apps which require an accurate search. Basic search is possible but is not particularly sensitive or quick. If you need to search for characters stored in your database then you either need to write some tricky/slow code or need to use another framework for search (RIP Parse which had excellent search queries)
  • Push notifications: Firebase does have push notifications but these require a custom server. This is a shame as an in house feature would be incredibly convenient.
  • Data storage: Firebase is not the best database for storing large data files. It deals with text great but if you need to be uploading large images/videos regularly then there are probably better services you could use.
  • Security: Firebase is secure but not bullet proof. If your data is highly sensitive then it is worth having a service which specialises in data security.
From the points above you should be able to see that Firebase is a great product with its main disadvantages being in very specific areas. These might affect you depending on your project but can often be fixed with other frameworks.
I would argue that using an API for chat is itself very limiting. In this sense using FireChat is just as bad as using any of those other listed APIs. Below I have listed some of the main disadvantages I see of using any chat API:
Advantages of using Firebase for chat but not FireChat:
  • Flexibility: Firebase is extremely flexible, dumping the API will increase Firebase’s flexibility. Your imagination is the limit of ways in which it can be used.
  • Control: When using an API you are limited by their functions and structure. You are also limited when adding new features. Using FireChat reduces the control you have over the code as the structure is completely fixed.
  • Customisation: Similar to the points above, when using an API you give up a large amount of control in exchange for additional ease of use. In this case I don’t think it is worth it due to the way the Firebase code is currently written. Coding your chat using Firebase, but not through the API, will allow you to add new features and more easily modify current ones.
As you can see Firebase excels when it is being used for the majority of projects. Where it falls down is when a specific project has some very specific requirements which don’t quiet fit the Firebase model. This is why I would recommend it to 95% of developers - the other 5% will need to research what will be best for them.
The problem is not with SendBird, Layer or Sinch but the inherent problem with Chat APIs themselves. Although FireChat falls into all these pitfalls, Firebase provides code to enable you to code it yourself.
Our company has recently released an open source chat component, using Firebase, on Github. These are fully complete and compatible IOS and ANDROID chats which we have released on an MIT license. This means you can release and modify the code with no obligation to us. Both of these project use Firebase for message and data storage but use Backendless for push notifications. I would recommend these over the other chat APIs as it gives you the source code to modify instead of being reliant on a companies frameworks.
What else could we use?
One final disadvantage of Firebase (and all the frameworks you mentioned) is the fact that you are using someone else’s service meaning you are reliant on them. Obviously this is a problem with every chat solution as it requires you to use their API for your project. The solution to this could be XMPP which is what many professional chats have switched to using. The advantage is that you build your service and configure it directly to the service you offer. Our company also specialises in XMPP solutions.

No comments:

Post a Comment