Blog

How to Build Apps on Top of your Salesforce Org and Still be Immune from Salesforce Outages

Glen Crawford
May 17, 2021

Last week Salesforce had an outage. And not just any outage; a worldwide one that lasted hours and affected thousands of businesses and millions of users around the world.

Here at reinteractive we have quite a few apps that we have built for clients that interface with their Salesforce organisation, accounting for about half of all the new apps that we have built in the last two or so years. Some of these apps use our [StoreConnect® service] (https://getstoreconnect.com/), and some are bespoke builds.

Both of these connect to Salesforce for data storage. And yet, we had a pretty chill time while the Salesforce outage was ongoing. Why? Because our apps are built in a way that are almost unaffected by Salesforce outages, even though all of their data is ultimately stored there.

How? Well, first you need to know what an API is. An API is just a way for software systems to interact with each other in a programmatic way, as opposed to the point-and-click way that humans do. Whereas a human might fill out a form and click a submit button to search for products in a system, a computer would invoke its API via a web request that looks like GET https://www.example.com/products?query=jelly&sort=price and get back a response that looks like { "products": [{ "name": "Jelly beans", "price": 2.50 }] }. There’s nothing visual; it’s just computers talking to each other via programmatic interfaces in order to efficiently transmit data between themselves on demand. Obviously, fetching and storing data this way requires the API to be online. If it isn’t, any app that needs to use it will be unable to access its required data.

Now that you know what an API is, forget about it: apps that we build here at reinteractive don’t interact with their Salesforce data via an API.

Instead, we use a system to constantly store and maintain a copy of a Salesforce organisation in a database that is local to the application, meaning that the data is available to our apps without having to retrieve it on demand via the Salesforce API.

We do this using a system called Heroku Connect. Heroku Connect allows us to do three key things:

  • Map the structure of a Salesforce organisation into a PostgreSQL database schema. For example, if the organisation has an entity called Product with two fields called Name and Price, that would become a database table called products with two columns called name and price.

  • Sync data between the Salesforce organisation and the database. This can be read-only or read-write and can handle new, updated and deleted records. Each record of a Salesforce object becomes a row in the aforementioned products example table.

  • Make this database available to a Ruby on Rails application that can present it to users like any other app as if it were traditionally stored data. heroku-diagram.png

The end result is that alongside the application sits a database that is constantly up-to-date and, most importantly, is not dependent on the Salesforce API being available.

So what happens to a reinteractive-built StoreConnect (or bespoke) app when there is an outage at Salesforce? It pretty much continues to operate as normal. The app can still read, write, and search its data like any other app can with its database. The only thing it can’t do is sync its data (both to and from Salesforce) once an outage occurs at Salesforce. This means that, for example, new records in the app’s database won’t show up in the Salesforce organisation right away. But that is only until the Salesforce outage is over, at which point syncing automatically resumes and all is well again.

This is a significant departure to the traditional way of connecting an app to a third-party for data storage, but it has worked out well for us, as evidenced by the events of the last week. These apps are quickly becoming a significant number of the apps that we build and maintain and we like to think that we’re getting pretty good at it! If you have (or are considering having) your organisation’s data in Salesforce, and would like to build an app or website on top, get in touch with reinteractive and we’ll find a solution that meets your needs.