SharinPix

SharinPix Powers Seamless Image Management on Heroku for Salesforce Users

Heroku Connect syncs data in real time between a Rails app on Heroku and Salesforce.

Smartphone cameras make photography easy and cheap, and as a result, photos have become an essential part of business workflows across industries. Digital photography provides a convenient way to record and share information and helps people accomplish any number of tasks, such as communicating the status of a job, proving that something has happened, or requesting input from others. In relatively short time, digital image handling, categorization, and distribution has become a core process for businesses around the world.

In 2015, a team of software engineers at a construction company in France recognized that their colleagues needed a better way to manage images. The result was an internal tool that enabled construction supervisors to upload photographs of work sites and integrate them into the company's Salesforce workflows. Members of the team gave talks about their tool at Salesforce developer events, which led to other organizations asking if they could use it too. Realizing the potential of their image management tool, the team spun out a new company, SharinPix, and made their product available for anyone to use through the Salesforce AppExchange.

SharinPix takes advantage of the unique integration between Heroku and Salesforce to deliver sophisticated image management to Salesforce users. The app is powered by custom application code on Heroku and synchronizes data with Salesforce using Heroku Connect.

Images tell a deeper story

For a wide range of businesses, photographs are an increasingly important form of communication and record keeping. For example, when a tenant moves out of an apartment, photos act as proof of the property's condition and help contractors provide an accurate quote for repairs.

However, unlocking the information held in photos poses a challenge for software developers. Unlike text, which can be easily matched and manipulated, photos often require a human being to put them into context. While computers can easily search for written reports of broken windows, for example, it's only recently that machine learning has led to software that can identify photos of broken windows. Even without diving into the meaning of images, simply uploading, storing, and moving images requires a different way of working due to the larger file sizes involved.

SharinPix offers an end-to-end solution for working with images within Salesforce. Using the Salesforce web and mobile apps, or SharinPix's own native mobile apps, a field agent, customer, or anyone else with the right permissions can upload and manage images within a Salesforce org. Once an image is in Salesforce, SharinPix allows users to edit it, add it to documents, and share it with other people. Crucially, it also enables users to add tags and annotations to images, thereby providing the context that makes them easily searchable, available in reports, and capable of triggering automated tasks.

sharinpix-01

SharinPix combines the capabilities of Heroku and Salesforce

When it came to building their MVP, the SharinPix team recognized that the task would require two quite different sets of developer skills. On the one hand, they needed to produce a seamless user experience within Salesforce, as well as integrate with data and functionality from across the Salesforce Platform. On the other hand, they needed to store, manipulate, and distribute images at scale, which brought an entirely different set of challenges.

The solution was to create a Ruby on Rails application that would take care of the image-specific functionality and then integrate the results with the data and user interface available to their customers in Salesforce. The SharinPix team evaluated several cloud platforms and chose Heroku to deploy and run the Rails app. Not only did Heroku offer tight integration with the rest of the Salesforce Platform, but by using Heroku Add-ons, the platform provided easy integration with many of the other tools and services that they would need to build and run the service.

Today, SharinPix is a single offering that spans a variety of components. Running as a Salesforce Connected App, SharinPix provides Lightning Components, Visualforce pages, Canvas Apps, and HTML5 components that enable customers to integrate image management into their Salesforce workflows. In each of these cases, SharinPix provides an iFrame that is generated by the Rails app on Heroku and authenticated using JSON Web Tokens that specify the Salesforce user and org. The Rails app then takes care of processing, cataloging, and distributing images.

The first task of the Rails app is to store the original image file in Amazon S3 and any metadata, such as tags or a description, in a Heroku Postgres datastore. SharinPix also runs a second Postgres instance as a real-time follower. This enables them to run analytics and other reporting tasks against the follower instance, freeing the primary instance to serve customer requests.

In addition, SharinPix runs two instances of Heroku for Redis. The first is a cache of commonly queried data, which reduces the read burden on their primary data store. The second acts as the datastore for Sidekiq, which schedules asynchronous Ruby jobs. SharinPix makes extensive use of such background jobs as an easy way to scale capacity. While the user-facing web app takes care of the user interface, heavier tasks like image manipulation, interaction with the storage provider, and sending emails are all added to a Sidekiq queue to be processed in turn.

Heroku Connect enables real time data sync between a Salesforce org and a Heroku app

The SharinPix team knew from the beginning that it was essential to provide a smooth, native Salesforce user experience. Not only would their app have to match the Salesforce user interface guidelines, but crucially, data would need to be available in the app without noticeable delay.

Had the SharinPix team chosen to run their Rails app using another cloud provider, they would have faced two problems. The first would be the work of building, securing, and maintaining a custom integration between their Rails app and the Salesforce Platform. The second would be the likelihood of introducing lag into the user experience. If SharinPix were to rely on data from outside the Salesforce Platform, it would introduce a level of unpredictability and potential delay in fetching the data needed by SharinPix users.

Instead, the seamless integration between Heroku and Salesforce enables real-time data exchange. Heroku Connect powers bi-directional data synchronization between the Rails app's Heroku Postgres database and Salesforce. This allows the team to deliver a predictable and slick Salesforce app experience.

Salesforce and Heroku act as one. We can leverage the development flexibility of Heroku and deliver a native Salesforce experience to our customers. Jean-Michel Mougeolle, CEO, SharinPix

sharinpix-02

Automating image categorization with Salesforce Einstein

Manual tagging and annotation provide essential context but can be resource intensive, especially for customers with large image sets. To help offset some of that work, the SharinPix team introduced automatic image categorization and object detection through the Salesforce Platform's Einstein Vision API.

In car parking management, for example, SharinPix could train Salesforce Einstein with photographs of common parking violations, such as cars parked across two bays or cars parked in a restricted area. Then, when parking officers submitted photos of incidents, Einstein would categorize them automatically according to what was shown in the image. Just as with manual image tagging, that metadata would then be synchronized between Salesforce and the Heroku Postgres database using Heroku Connect.

Heroku Add-ons open a world of new functionality with near zero configuration

Heroku Add-ons are a central part of the SharinPix infrastructure, enabling the development team to integrate with multiple third-party services with virtually no configuration needed.

Many SharinPix customers set maximum image sizes or require watermarks. To process the photos in this way, SharinPix enages the Cloudinary add-on. Once Cloudinary has processed the image, the Rails app then stores the new file in Amazon S3.

While the images themselves are core to SharinPix, it's the metadata that makes those images useful. In particular, SharinPix customers require the ability to search for images using free text queries as part of their workflows. To enable this type of search, the Rails app passes the image metadata to the ElasticSearch add-on for indexing.

Add-ons also play a role in managing customer communication, with SharinPix using the SendGrid add-on for email management and Pusher Channels add-on to take care of real-time functionality.

The team gains insights into the performance of their service through add-ons including Librato, Pingdom, Rollbar, and Scout APM. Combined, they provide visibility of potential code inefficiencies and system availability issues.

Heroku Add-ons, such as Cloudinary, ElasticSearch, and Pusher, have accelerated our development by giving us direct access to industry leading technologies in just a few clicks. Jean-Michel Mougeolle, CEO, SharinPix

Scaling to meet growth without a dedicated DevOps team

Delivering the most value possible to their customers has been a core tenet of the SharinPix team's approach. Another reason that SharinPix chose Heroku was because the managed platform allows each of their developers to focus on creating features rather than performing DevOps tasks.

Beyond Heroku's own day-to-day server management, SharinPix has found that Heroku's effortless scaling and add-ons marketplace have enabled them to grow quicker than if they'd chosen an unmanaged platform. Rather than have to plan for, provision, and deploy servers, SharinPix can scale up with a couple of commands in the Heroku CLI and or clicks in the Heroku Dashboard. Recently, SharinPix has begun scaling automatically by using the Rails Autoscale add-on, which adds dynos as demand increases.

A customer might ask us out of the blue to import 5 million images over a weekend. With Heroku, we can scale up and down on demand and we don't need a DevOps team to make it happen. Jean-Michel Mougeolle, CEO, SharinPix

SharinPix grows the business with Heroku and Salesforce

The future of SharinPix lies in helping their customers drive greater value from images within their workflows. Five years into their journey, and with customers across the globe, the SharinPix team are committed to using Heroku as the best way to deliver that value to their customers who depend on Salesforce to run their business.

The SharinPix team plans to give customers greater flexibility over where they store their images and allow them to source more metadata from device sensors. For example, they're now able to integrate lidar readings from devices such as the Apple iPhone 12 and store a 3D map of the scene depicted in a photo. Going forward, Heroku's managed platform is key to enabling the team to bring their new features to market efficiently and effectively.


Inside SharinPix on Heroku

SharinPix runs a Ruby on Rails application on Heroku, backed by Heroku Postgres for operational data and a second Postgres follower for analytics workloads. Heroku for Redis provides a caching layer in front of Heroku Postgres.

Other Heroku Add-ons, including Librato, Pingdom, Rollbar, and Scout APM, provide logging, monitoring, and operational visibility of the system's performance. The Cloudinary, SendGrid, and Pusher Channels add-ons enable image manipulation, operational email, and real time capabilities. The Rails Autoscale add-on monitors queue times in the Rails app and adds Heroku Dynos in response to increased demand, and the Elasticsearch add-on enables free text search.

Heroku Connect provides real-time, bi-directional data synchronization between Heroku Postgres and Salesforce. The Salesforce Platform's Einstein Vision API enables automatic image categorization and object detection.