How developers go Serverless on the Freshworks platform

“Software will eat the world”. – Andreessen Horowitz

“Implementation will buy you a couple of years.” — Clunky SaaS

Anyone who has dealt with SaaS in the last decade – early adopters and laggards alike – will swear by the immense business value the “pay-as-you-go” software model has unlocked. Over the last decade, Freshworks has been striving to improve this value proposition with intuitive, user-friendly, and self-serve products that need minimal to no consulting to setup. While we are at it, we also strive to abstract out the often hidden costs of owning SaaS – the capEx and opEx involved with customizing SaaS to your tastes.

Today, we wish to present Exhibit A from the Freshworks Developer Platform that is designed to help developers build customizations for our customers without requiring an investment in any server infrastructure: The Serverless App.

Treasure at the end of the Rainbow

Let’s pick this story up at the point where you have signed up for a SaaS product, and have played around to identify its limits. Did you wish the workflows were extensible? An integration with your HRMS? Improvements to employee productivity within the constraints of your particular business needs?

Many SaaS products provide a Marketplace with useful, popular apps, and if you are lucky, you might stumble upon an app that addresses your needs. What if, however, the things that differentiate your approach to business are particularly niche? You are now paired with a development partner to help implement a customized solution, just for you. This would typically be the point where costs and go-live timelines spiral out of control. The custom software being built for you must usually solve the same set of problems you were hoping to avoid when you decided to adopt SaaS – think indirectly owning, hosting and maintaining infrastructure with the complexity of integrating this into the SaaS product you signed up for.

This is where Freshworks has a different take on how this story should play out.

An app backed by infrastructure

Let’s look closer at a typical problem that is solved using an app. We will take one of the most popular serverless apps on the Freshworks Marketplace as an example – the Freshdesk-Jira integration.

This app helps customer support teams collaborate with technical teams that use Jira for issue tracking by,

  • Track an issue on the behalf of agents and help update customers when it is resolved.
  • Helping agents create and link a Jira issue with a ticket in Freshdesk.
  • Assist with information exchange between the two teams by pushing conversations from a ticket into a Jira issue as a comment, and vice-versa.

The picture below depicts one architectural approach a developer could use to tackle this problem, at scale.

The developer would need to host the following components to serve their application,

  • A database to maintain a relationship between tickets in Freshdesk and issues in Jira.
  • Compute resources to run the app’s business logic that can scale out as request traffic grows.
  • The ability to subscribe to and listen to events served over webhooks from both Freshdesk and Jira. Plus the ability to do this with high reliability.
  • A secure component that can generate and store access tokens from Jira for each user.
  • Some form of monitoring to ensure one could learn about and react to infrastructure problems in a timely fashion.

The Developer Platform Vision

This leads us to one of the primary ideas on which our platform was envisioned. Imagine if the platform was built from the ground-up to anticipate the common application needs that typically require hosting and managing infrastructure in a cloud environment?

As a developer, you would no longer have to sort through multiple cloud-service providers deciding where to host your application, and pay them to host servers exclusively for your apps. You would also not have to worry about dealing with the popularity that brings more traffic into your applications. You would be additionally relieved from being subscribed to service and maintenance advisories that force you to plan and upgrade your application infrastructure from time-to-time. Even more importantly, you can free up a whole lot of cognitive load in relation with security and compliance and leave it to the underlying platform. In a new world where data residency regulations are the norm, imagine managing infrastructure across 4 different geographies!

As a customer, given you have already placed your trust in Freshworks as a SaaS vendor, it only makes sense to also be comfortable in leaving the application infrastructure needs for your customizations to us. You could expect the platform to be more reliable, available and secure, and enable transferring these qualities to the applications running on them. In addition, the platform could provide ready building blocks to help make these applications compliant to the needs of your industry and geography.

We are proud to claim that one of the two First Principles behind the design of our platform happens to be:

“Developers should focus on solving customer issues and not compute issues”. 

To enable them to be able to focus on solving customer issues, developers on our platform leverage features such as:

  • Data Storage to persist data through the application lifecycle
  • Request Proxy to securely make API calls to any API endpoint on the internet
  • OAuth to handle secure access tokens to access any 3rd party application
  • Serverless compute to run custom application code in response to relevant events.

In the absence of each of these features, a developer would typically have to stand up and manage cloud infrastructure for their applications.

The Serverless Phenomenon

While everyone realizes the opportunity-cost of not adopting cloud technologies today, the Serverless phenomenon is a more recent offshoot of the cloud revolution from the 21st century. The easiest way to understand Serverless is to appreciate the “pay-for-what-you-use” subscription model.

If you subscribe to a power (electric) connection at home, you are already familiar with this model. As a subscriber, the utility company installs a metering unit outside your home to measure the number of Watts of power you consume in a given billing period. You are sent an invoice at the end of the period that reports your usage and translates the same to an amount you owe the utility company.

Photo by Taner Ardalı on Unsplash

 

Simply replace “Watts of power” with “milli-seconds of compute” or “number of requests to store or retrieve data” and you have successfully visualized Serverless and the convenience it provides. Despite what the name might suggest, Serverless is backed by servers that power the computing needs of consumers. Consumers never need to host, manage or deal with servers themselves. Instead, they simply write code and leave the rest to the platform.

A platform that can securely run custom applications written by millions of consumers unlocks the next level of economies of scale. Again, you only need to imagine the feasibility of a utility company pulling a single cable just for your home-sweet-home versus laying out a grid for millions of homes. The same grid also brings with it massive ability to add new consumers and serve highly variable loads.

An app with standing instructions

Let’s revisit the Freshdesk-Jira integration from the perspective of the Freshworks platform. If you were a developer building this same application on the Freshworks platform, your view of the problem would reduce quite simply to …. this.

The built-in OAuth client securely stores and manages tokens and the built-in data store persists the relation between a ticket and an issue, broadly simplifying the crux of the app. It becomes just a set of IFTTT (IF This Then That) rules, that can also be seen as a set of standing instructions for what it must do when an expected event occurs. A couple of these rules might look as follows,

  • When a note is added to a ticket, find the corresponding Jira issue and add a comment with the contents of the note.
  • When a Jira issue is resolved, find the corresponding Freshdesk tickets and add a reply to each ticket so the customers are notified that the problem has been fixed.

Everything else is simply left to the platform behind it all.

You code, we scale

Dealing with a flood of tickets on Cyber Monday? The platform has you covered.

Can’t afford to miss a single update? The platform has reliability built in.

You dread losing your access tokens to a rogue actor? We do as well – we manage tokens on your behalf and securely share them with the app, and not with the developer.

What’s more? A developer can leverage all kinds of event triggers to weave together an automation for your business workflows.

Serverless security under the hood

Let’s take a closer look at how a serverless app is secured despite running on shared infrastructure with other serverless apps. The key word here is isolation.

The underlying infrastructure hosting our serverless platform is shared and multi-tenant like most SaaS infrastructure is. Every serverless app is however guaranteed to be executed on its own host server (a reminder that there are indeed servers behind “serverless” technologies!). Another app will never be executed on this host.

Two invocations of the same serverless app can, however, execute on the same host. This is not concerning if the app happened to be a private app belonging to one of our customers. If this was, however, a public app, the two invocations could have originated from two different customers. This is where the serverless platform adds yet another layer of isolation by creating a sandbox that imprisons each invocation. Two invocations will never be aware of each other, nor will they have access to each other’s resources like memory, file-system and execution state.

Using serverless technologies, we have securely brought the same economies of scale to the Freshworks Platform that is also the basis of our SaaS offerings.

Operating at Freshworks scale

We launched our serverless apps capability in Beta in early 2017, but it has rapidly picked up adoption easily becoming the most popular feature on our platform.

Today serverless apps work with 6 Freshworks products, and more will be added soon.

While we have had our hiccups along the way and burnt our fingers with event streaming problems of all kinds, it was all worth it as the platform has matured into one that reliably runs workloads for our customers of all walks and all sizes.

In June 2020, we recorded a new milestone on the platform – our customers invoked serverless apps over half a billion times in a single calendar month. The average latency between an event being generated and the app being invoked was under 5s all this while.

A billion-invocations month is certainly just around the corner. While we eagerly await this next milestone, our engineers continue to focus on quality-of-service guarantees around performance, reliability and availability of this platform. This is designed to present our developers and customers with a predictable event stream that powers the platform, so they can continue to confidently build and run their time-sensitive automations with us.

Extending your “customer-for-life” promise with the Freshworks Platform

At Freshworks, we believe in our mission of helping teams generate “moments of wow”. The Freshworks Platform and its serverless capabilities are designed to wow our developers while they stay laser-focused on the business problems our customers need solutions for. Our serverless platform does the heavy lifting behind the scenes. Our customers see shorter implementation cycles as they come aboard the Freshworks rocket-ship and trust Freshworks with the security of their implementation rather than leaving it all to the developer. We believe that this adds up to a productive experience for our customers, who in turn deliver remarkable experiences for their own customers, helping secure them as customers for life.