October 21, 2021

How Instatus reduced their infrastructure costs by 86% thanks to GraphCDN’s GraphQL edge caching

Instatus allows its customers to create status pages for their products and services. They are beautiful, customizable, and load super quickly for visitors. For example, Linear uses them for their status page.

Let's dive into their architecture to understand how GraphCDN's GraphQL edge cache helped reduce their infrastructure costs by a whopping 86%.

Technical architecture

The entire product is based on a unified GraphQL API, queried from two main clients: the management dashboard and the status pages. Ali Salah, the founder of Instatus, used Node.js and TypeScript, his language of choice, for the backend, and the data is stored in an AWS Aurora Postgres instance and queried with Prisma.

To ensure the status pages load as quickly as possible, a key differentiating feature, and to avoid traffic spikes, they leverage Next.js' Incremental Static Regeneration (ISR). Rather than dynamically rendering the status pages for every visitor, they lazily build static HTML files every three seconds. Those load almost instantly for visitors while still being up-to-date at all times --- a fantastic overall user experience.

GraphQL caching

However, the frequent rebuilds also caused significant strain on the API and database. To alleviate performance and stability concerns, they had to significantly upgrade their infrastructure across the stack — which in turn caused costs to balloon out of proportion.

GraphQL caching seemed like the obvious solution to save those unnecessary costs by reducing load on the API and database. They knew that purely Time-To-Live-based caching wouldn't suffice, as updates made to status pages (like "Service B is currently experiencing downtime") need to be reflected immediately.

With its instant global invalidation, GraphCDN's GraphQL edge cache was the perfect solution.

Cost savings

Almost immediately after implementing GraphCDN's GraphQL edge cache, their overall cache hit rate across all GraphQL queries was 90%+. That, in turn, reduced their hosting provider costs and allowed them to use fewer database instances to serve the same audience.

Those two changes, enabled by GraphCDN's worldwide GraphQL edge cache, reduced Instatus' overall infrastructure costs by a whooping 86%.