/

hasura-header-illustration

How KintoHub uses GraphQL and Hasura to power their real-time API infrastructure

About KintoHub

KintoHub is a workflow service that manages cloud-native application lifecycle from source to production. It helps individual developers or engineering teams build, combine, deploy, and manage APIs, microservices, databases, and tasks using KintoHub’s interactive dashboard.

Building the real-time API stack

For a service that can be used to manage global-scale deployments and workflows for even complex apps, having a reliable and scalable real-time API infrastructure was a must-have at KintoHub.

In late 2018, the engineering team delivered a proof-of-concept for a real-time CI/CD build-pipeline. At this point, the user-facing dashboard, that served as the center-piece of the developer experience on KintoHub, had to be manually refreshed by a user to update its statuses and statistics. To polish the experience while scoping the product’s beta version, the team started researching various real-time API tools and technologies.

Their choices were narrowed down to the following:

  1. A raw websockets-based infrastructure to support all realtime use-cases.
  2. gRPC
  3. A GraphQL-based solution

It felt premature to adopt gRPC for web development as the frontend javascript libraries were in alpha at the time. Also, based on the volume of realtime use-cases in various frontend apps - like notifications, etc., another requirement of the candidate real-time solution was to ease/standardize the process of accessing information. Therefore, the team narrowed their focus to a GraphQL-based solution.

Evaluating GraphQL and Hasura

Initially, an MVP was built using MongoDB over 6 months to test GraphQL waters. This MVP ran into issues with scale and direct access to the database. This is when the team decided to try out Hasura.

The team was encouraged to get familiar with Postgres and Hasura, especially focusing on Hasura’s role-based access control features. A sign-up/accounts-management service for the dashboard was the first service to use Hasura’s GraphQL API. A reverse-proxy to sit in front of Hasura and a custom JWT server to handle authentication were also built to support this MVP.

This version of the MVP met the team’s requirements, and they decided to adopt Hasura for other microservices as well. The team now leverages Hasura’s GraphQL API by logging real-time infrastructure related events from their various services/workflows into their database, and accesses this data in realtime wherever required. This part of the stack has been open sourced as argo-monitor (coming soon) which makes it easy to funnel any workflow kubernetes event to Hasura, Mongodb or Postgres directly.

Results from the evaluation process

The biggest win for the team was that the 2nd iteration of the MVP, based on Hasura and Golang, took 6 weeks to build and was able to fully replace the earlier version (that took around 6 months to build!). After deploying Hasura in production, a cloud-native deployment management service, built on the same stack, was benchmarked to be 40% faster than its predecessor, further bolstering the team’s confidence in the solution.

Next steps with Hasura

KintoHub is preparing to port the last of their major features to Hasura, in time for OSCON 2019.

They are also closely shaping Hasura’s product pipeline with feedback from their personal experience of running it in production. One of the major areas of collaboration between the two organisations is the ability to deploy a global-scale, one-click multi-region Hasura solution that uses YugaByte as the datastore.

Want to know how Hasura can help your team? Schedule a demo.


The following case-study is based on a Q&A with Joseph Cooper, the CEO at Kintohub.com

Blog
11 Jul, 2019
Email
Subscribe to stay up-to-date on all things Hasura. One newsletter, once a month.
Loading...
v3-pattern
Accelerate development and data access with radically reduced complexity.