ClickMechanic Builds a Data-Driven Car Repair Marketplace on Heroku

Heroku’s flexible, managed platform enabled a lean team to build a real-time quoting engine using industry data from multiple sources.

Car trouble can be stressful. Being off the road is not only an inconvenience, it's a reminder of how little most of us really know about our vehicles. When it comes time to find a mechanic, we're often in the uncomfortable position of putting our faith in an expert who both diagnoses the problem and decides how much to charge for the cure.

In 2012, the founders of London-based startup ClickMechanic set out to find a better way. They believed that with enough data, they could set a fair price for any repair of any road-legal vehicle. Today, thousands of car owners visit the ClickMechanic website where they can enter their location, vehicle details, and work needed. ClickMechanic then sets a fixed price and invites trusted specialists to apply for the job. For those drivers who aren't sure what the problem is, ClickMechanic provides a diagnostic wizard to help define the problem and specify the necessary repairs.

Just as ClickMechanic simplifies car repairs for people across the UK, Heroku simplifies their app deployment and operations. From the beginning, Heroku's managed service has been key to enabling ClickMechanic to put all their resources into delivering their product.

Car repair costs are a data science problem

At first glance, ClickMechanic appears to offer a two-party online marketplace just like many others. However, there is a crucial difference. In many B2C marketplaces, consumers have an instinct for what makes a fair price. For example, most big city dwellers know how much a ride to the airport should cost. ClickMechanic, though, isn’t just about connecting consumers with providers. The app also promises to solve the knowledge gap between vehicle owners and mechanics.

While a ride hailing app can use a relatively simple pricing model, ClickMechanic has to consider the huge variety in part prices and labor required for each job. Everything from engine size to the location of the job has an impact. Altogether, the wide variety of specifications means that there are tens of thousands of unique car configurations on UK roads. Finding precisely the right parts and labor costs for all those possibilities make it a data science problem.


Heroku’s flexibility helps ClickMechanic generate pricing from multiple data sources

In developing ClickMechanic, the team created a proprietary method of analyzing their huge and frequently updated data sources. This enabled them to build a prediction model that generates a reliable quote quickly enough to present to customers in real time. Underlying that system is a hybrid data model that combines industry data stored in Amazon Web Services RDS with ClickMechanic's Heroku Postgres database.

The team periodically runs machine learning jobs against their industry data sources and compares that with real world data on repair time and parts costs as reported by mechanics and garages. They load the resultant price prediction models into Heroku Postgres, using a scheduled Ruby process. This enables the team to continually refine their predictive model and generate ever more accurate prices.

As usage of their product grew, the ClickMechanic team introduced a secondary Heroku Postgres instance as a read-only follower. It receives real time updates from the primary instance, making it ideally suited to longer running analytics jobs and similar tasks. Creating that follower took just a few minutes in the Heroku Dashboard --- saving the team many hours of DevOps work that would have been needed with unmanaged solution.

Marshaling the end-to-end process are two Ruby on Rails apps deployed to Heroku, one for car owners and the other for mechanics. When customers come to request a quote, ClickMechanic's customer-facing Rails app queries the AWS RDS data store. It then queries the Heroku Postgres datastore to find suitable mechanics within the customer's locality. If the customer decides to go ahead, the Rails app connects with the Twilio SMS and SparkPost email APIs to send the job offer to suitable providers.

Mechanics then follow a URL in their notification where they interact with a second Rails app to review, accept, and refuse job offers. Once a mechanic has accepted the job, the car owner is notified by email of their appointment details.

Heroku’s flexibility has been crucial in helping us bring together data from industry sources, as well as our own, to build our real-time quoting engine. James Wozniak, Full Stack Engineer, ClickMechanic


Spikes in demand are easy to manage with Heroku

Demand for ClickMechanic goes through predictable peaks and valleys. The busiest times tend to be Monday and Tuesday mornings, when unhappy commuters find their car unresponsive after a weekend in the driveway.

The ClickMechanic team have architected their application to handle differing levels of demand by offloading asynchronous tasks to worker dynos. Worker dynos are designed specifically to run background tasks separately from the user-facing web application. Handing asynchronous tasks to work dynos means that the two user-facing apps remain responsive even during times of increased traffic. As demand increases, so does the queue of background jobs. This acts as a signal for the ClickMechanic team to increase their number of worker dynos using the Heroku Dashboard. When demand subsides, they can return to their standard level of provision.

Scaling in that way using an unmanaged cloud service would require additional administration planning and DevOps integration work (e.g. providing access to the data store), making it harder to meet demand immediately. With Heroku's managed service, the necessary integration work happens automatically, allowing the ClickMechanic team to remain agile.

Working with Heroku is like having our own DevOps team without the need to hire. When we need to scale or add new functionality, Heroku’s managed platform makes sure we always have the resources we need. James Wozniak, Full Stack Engineer, ClickMechanic

Heroku Add-ons help ClickMechanic tune their app’s performance

The ClickMechanic team makes extensive use of Heroku Add-ons to manage the smooth running of their service. In particular, the New Relic APM add-on gives them immediate insights into production issues, should they arise, and pinpoints specific code that needs attention. Similarly, the Papertrail add-on provides real time log analytics and search, enabling the team to dig deeper into the possible causes of issues as they happen.

To ensure the fastest responses to frequent database queries, ClickMechanic uses the MemCachier add-on to provide a cache in front of their Heroku Postgres instance. For less common repairs, ClickMechanic enables car owners to search for their specific issue. That free text search is enabled by the Bonsai Elasticsearch add-on.

Heroku’s GitHub integration accelerates QA and deployment

As a lean team, the company’s QA engineers need to minimize the admin work necessary to perform quality control on new ClickMechanic code. Heroku Review Apps enable them to get straight down to review. When one of their developer colleagues creates a pull request in GitHub, Heroku automatically seeds a new Heroku Postgres instance, builds the branch, and deploys it to a temporary domain. Over the course of a year, this saves hundreds of engineering hours that otherwise would be lost to manually setting up and deploying QA builds.

Once the QA team has approved a release for deployment, the pull request is committed to their main branch. That commit triggers Heroku to run any necessary database migrations and then to push the new code to the live environment. This automation enables the team to deploy new code at least once a day. Without Heroku, such a release velocity would require a dedicated DevOps team.

Heroku Review Apps automate all of our QA admin. As soon as a branch is ready to test, Heroku gives us a working version using real data. Chris Glover, QA Analyst, ClickMechanic

A microservices future on Heroku

As the ClickMechanic team looks to the future, their challenge is to prepare their application architecture for the next phase of their growth. In particular, they’re planning to carve out aspects of their Rails monolith and convert it into microservices. Microservices are particularly well suited to Heroku, as the dynos responsible for each microservice can scale independently according to which parts of the application are most in demand.

Thanks to Heroku’s managed platform, the lean ClickMechanic team has simplified one of the most stressful aspects of car ownership. In particular, Heroku’s flexibility has enabled the team to bring together data from various sources and direct their engineering effort to generating accurate quotes in real-time, while avoiding mundane DevOps tasks.

Inside ClickMechanic on Heroku

ClickMechanic runs their Ruby on Rails application on Heroku, using the Delayed Job Ruby library to send background tasks to worker dynos. It relies on a production instance of Heroku Postgres, with a follower instance used for analytics and other secondary tasks.

Heroku Add-ons New Relic APM and Papertrail provide visibility of the system's health, while MemCachier provides read caching to reduce load on their Heroku Postgres instance, and Bonsai Elasticsearch enables free text search of their repairs database, as well as indexing of help center articles. Heroku Review Apps enable the ClickMechanic QA team to test review branches without the need for manual environment setup, database seeding, or reprovisioning add-ons.