Build vs. Buy: Adding chat to your app


Find out more about benefits of using Pusher Channels and implementing chat to your realtime apps.


Chat: a vital feature for all apps

When it comes to customer support, live chat has long been a standard for websites. Chat functionality has now become a staple feature for mobile apps too. From support for marketplace and on-demand services, to group and individual channels for gaming and social apps, users want and need tools for communication with your business and with other users. As developers race to keep up with users’ expectations of communication features, they’re also taking advantage of benefits like boost in user engagement and ability to interact with customers directly.

Today, it’s a no-brainer to add this feature, but how? Should you build your own chat app from scratch or choose an off-the-shelf API? This article reviews the costs of building your own app, and discusses the potential of out-of-the-box add-ons or alternative toolkits so you can make an educated decision.

Flexibility and customization

Some developers choose to create their own in-app chat because they are looking to integrate special types of interaction. When you build from scratch, the main benefits includewill operate in line with your business logic. In this case, before starting development, you’ll want to create a clear specification with user workflow and some level of mock-up screens. Creating a detailed specification will allow you to have total clarity on what you need.

Typically, chat is built for one or more of the following applications:

  • Community building, for interactions among app users.
  • Commentary on live streaming or shared events, so that users can enjoy and share commentary in a live room while enjoying a live experience.
  • Collaboration, for example, in business applications where people are creating projects together.
  • Customer support, either for the app itself, or for the organization associated with the app (for example, a food delivery service that allows users to chat to support about problems with their order).

Once you have a specification, it’s worth considering whether there are already APIs on the market that can fulfil your needs. You can compare your specifications to the capabilities of out-of-the-box chat APIs, to make sure you really require something completely custom.

Time to market

The most obvious drawback of building your own application is the time to market. In the best case, it takes between a year and 18 months. Even if you are considering building your own chat interface, it might make sense to temporarily include an add-in. Let’s face it: today’s users don’t want to wait 18 seconds, much less 18 months for new features. And if your competition already has built-in chat, you really can’t afford to wait.

Costs of building from scratch

One of the biggest pitfalls to avoid when building your chat app is to underestimate the amount of time and effort it will take. Yes, there are open source libraries you can build on, but then you lose some control of the code. You’ll also need to consider the implications of needing to provide support to your users for a component you might not understand in real life, because you don’t have the benefit of having written it yourself.

Building your own chat application entirely from scratch typically requires the following components:

  • Elastic infrastructure (2 months): Building the backend infrastructure to handle tens of thousands of simultaneous chats.
  • Elastic data storage (1-4 weeks, plus ongoing hosting costs): Chats accumulate a large amount of persistent state data which needs to be hosted. It is possible to do this part fairly quickly, but you will have ongoing cloud hosting costs.
  • Realtime infrastructure (2 months): It often comes as a surprise how much time is required to sustain realtime chats on mobile. Because this is somewhat straightforward on web infrastructure, most teams underestimate the complexity of maintaining realtime connections for mobile applications. This requires not just time, but the appropriate expertise.
  • Seamlessness and integration (2 months): The realtime systems and persistent systems need to work together seamlessly. The complexity of getting these systems to work together can be daunting because of their distributed nature.
  • Realtime features (6 months plus ongoing): Only after doing all of the infrastructure above, can the team focus on building the app according to those specifications you wrote in the last section. Not only will it take a few months to implement these features, but when it’s your proprietary software you have the ongoing maintenance to be accountable for.
  • Client state management (2 months): Finally, it’s necessary to manage the client state and manage the data consistency and relevance of the data to each client.

For most teams, this development would take 15 months and 3-5 full-time salaried programmers for development. Of course, we know, because we spent that much developing a chat app. And, it doesn’t end there. Security updates, added features, and keeping up with developments and changes in the source app are also necessary.

Additional features

Chat apps vary drastically depending on whether they are built for groups, community, customer support, or live stream commentary.

A comprehensive chat app would include any or all of these different features:

  • Read receipts: an indication of who has read a message.
  • Auto-responders when participants are not available for the chat.
  • Conversion of chat conversations to email records.
  • Control of private and public rooms and different levels of administrator privileges.
  • Ability to add files, images, videos, GIFs and emojis.
  • Typing indicators to know when someone is responding to a message.
  • Presence indicators: so users know when participants are online and offline.
  • Jump to last read item or read cursors, so that each individual can see where they last left off the conversation and catch up easily.
  • Notifications for direct messages, mentions in a chat, etc.
  • Provisioning and permissions to create different levels of users for chat rooms and groups.
  • Push notifications for the app owner to keep conversations going, send out updates, and automate aspects of the conversation.

In order to remain competitive and provide the best user experience, you would need to individually develop each one of these features.

Ongoing maintenance

Total cost of ownership (TCO) is always a concern when you are building your own chat app. First of all, you’ll have ever-increasing cloud provider costs as your app gains traction and you expand your operations.

Secondly, your development team will need to maintain the code closely. As you already know, there are ongoing security updates and changes to the operating system to take into consideration. Maintenance costs will vary, but any issues or bugs will be your problem, not to mention scalability.

The best of both worlds

The allure of the “chat out of the box” style solution is that it is designed to do all of the heavy lifting for you. While this is can be a good way to demonstrate how chat can work for you and your users (especially for quick prototyping), there are some things you’re losing out on:

1. Control over the conversation database
2. Flexibility to use your own business logic

So what about a solution which provides a significant foundation for the realtime messaging infrastructure, reducing costs and time commitment for your team, but gives you the flexibility to use your business logic, and allows you to hold on to your own database?

Using a hosted pub/sub API like Pusher Channels for your live chat infrastructure could you to get up and running quickly, saving you money and time and lowering the risk of development, while still keeping full control of your database.

Choosing an API with proven high throughput could save you the headaches of dealing with scalability as your app adoption increases. Chat is intrinsically designed to increase the usage time of your app, so it’s predictable that your needs will grow. The Channels API is designed for simplicity and scalability, and our team has worked with thousands of global developers, from one-person startups to global giants

Adding chat to a mobile app doesn’t have to be time-consuming or costly, nor do you have to lose control of your code.

If you are interested in learning about how you can build chat with Pusher Channels, check out our relevant tutorials here.