Hasura Cloud: the easiest way to run & manage your Hasura applications in production
Teams building with Hasura know and love the powerful features available at their disposal - instant GraphQL APIs, remote schema joins, granular authorization, eventing system, and more. Hasura is available for use as multiple product offerings - Hasura CE, Hasura EE, and the focus of this blogpost, Hasura Cloud. Here, we will explore the features that come out of the box with Hasura Cloud that drastically reduce the ops effort required to run and manage your Hasura applications in production.
“We have gotten a lot done as a small team. While looking at other companies of our size, we have a much smaller engineering team, and that’s largely because of Hasura and Hasura Cloud” — Asa Miller, CTO & co-founder of Brave Care
Brave Care is a rapidly growing YC backend healthcare startup. Prior to Hasura Cloud, Brave Care was hosting Hasura themselves on a Kubernetes cluster. They’ve now moved their stack over to Hasura Cloud so as to not worry about operating & scaling Hasura themselves. Read the case study here.
Teams worldwide and across all industries have come to depend on and love Hasura Cloud to handle all the idiosyncrasies of scaling applications. Instead of focusing on resource allocation, failovers, caching, API throttling, and more – Hasura Cloud lets you focus on your business, not on scaling cloud infrastructure and a cloud infrastructure team.
The best part of Hasura Cloud is that it is easy to migrate to from any functioning Hasura instance. So if you have a running application and are considering the next level of scale, or want to implement some form of automation, or even just add observability – Hasura Cloud is just a few steps away. Let’s take a high-level survey of the features that let Hasura Cloud reduce your operations burden and speed up your time-to-market. To make this comparison, we look at three critical aspects of running your application in production that Hasura Cloud makes simpler – reliability, scaling, and observability.
Reliability
Making any change to the underlying schema of your application, updating your application, and introducing new components risks breaking the build and introducing regressions. Hasura has several features that make production releases stable, well tested, and guaranteed to work.
Managed Upgrades
The Hasura product is continually evolving with new features added and new databases supported. When it’s time to upgrade your instance, Hasura Cloud handles all the migrations and updates for you, eliminating downtime and ensuring a seamless upgrade experience.
Regression tests
Regression tests let you quickly generate a list of tests based on real-world usage of your application. First, check to see which queries are coming into Hasura, select the ones you want to add to your regression test suite. Then whenever you make changes to your schema, the tests will run to ensure that the queries representative of your production usage will continue to work. Instead of creating multiple unit tests for individual parts of your schema, Hasura makes it simple to enable complete “end-to-end” integration tests that ensure your application performs as you’d expect.
API limits
The API limits feature on Hasura Cloud lets you set reasonable defaults for how users can interact with your application by simply configuring a few parameters. Some of the configuration options provided include passing in control checks on user IDs or IP addresses and more advanced configurations such as setting maximum query depth – a particularly tricky problem to solve for in GraphQL servers that you get out of the box.
Scaling your Hasura applications
Hasura Cloud allocates the optimal hardware required for hosting your Hasura application and ensures that extra resources are available as and when needed by your application.
Hasura takes care of scaling
Hasura Cloud ensures that the API gateway, caching, event processing, and more are ready to scale to millions of users on demand. You can still configure Hasura precisely the same way you would for Hasura CE, and then be rest assured that the hardware running your Hasura instance is ready for any scale.
Built-in cache layer
Hasura Cloud includes a caching directive for the GraphQL API. If you add @cached to a query, it will immediately cache the results and send the appropriate response headers with the time to live, the reset key, and more. You can instantly leverage faster queries with this “out-of-the-box” cache layer from Hasura Cloud just by adding seven characters to your existing code!
Rate limits
With the built-in API limit controls of Hasura Cloud, you can look for, scope against, and limit excessive traffic from IPs, users, and other header flags that are causing a drain on your app’s performance.
Observability
Observability is the ability to ensure that the application is running according to the parameters you defined. Hasura Cloud has specific features to help with this task.
The operations tab allows you to track every individual request across your entire Hasura Cloud instance. You can drill down onto specific details about those requests and filter on a wide array of indices to find the particular query you want to monitor.
Under the Errors tab, you can see the usage filtered by errors and grouped by the offending error. In addition, you can see how often the error surfaced, the error response, and the percentage of total errors this particular operation accounted for. This is useful for triaging the cause of a widespread problem.
The Usage tab also groups requests by operation name and surfaces how many requests of that operation resulted in an error. This view helps provide a contextual overview of your application and surfaces insights into where users may be seeing unexpected behavior or crashes in your application.
The Websockets view shows all concurrent connections to your Hasura instance, surfacing if there’s an abnormal number of connections not disconnecting, or simply to monitor what kinds of usage is requested in real time.
Lastly, the Subscription Worker view shows you which queries are actively executed by the subscriptions inside of Hasura, including variables, error rate, starting time, and more metrics that help you look for outliers in content consumption.
Distributed tracing
Hasura supports standard distributed tracing protocols which means that not only do you see details about the query planning, data resolving, and API access stages of a request, but you also see tracing information sent by any external tools such as service providers or bespoke databases. This tracing functionality effectively collocates your entire stack trace into a single point of reference where you can monitor the health of your application.
Logs
Hasura Cloud includes detailed logs for all the events in your application. Continuing with the theme of monitoring without maintaining your application, you can see everything happening under the hood on your Hasura Cloud console.
Summary
Hasura helps you build applications with flexible schemas, descriptive data access patterns, reliable eventing, and much more. Hasura’s fully managed cloud offering not only hosts your Hasura application for you but also controls the everyday operational tasks around reliability, on-demand scaling, and observability that you’d be required to set up for your application in production. Looking for even more information about what Hasura Cloud has to offer? Read here about how Hasura Cloud provides enhanced security for your applications out of the box.