Introducing Instant GraphQL for CockroachDB
Tags: database, postgres
Published: 2022-11-10 14:35:39

---
title: Introducing Instant GraphQL for CockroachDB
published: true
date: 2022-11-08 16:29:03 UTC
tags: database,postgres
canonical_url: https://hasura.io/blog/announcing-native-cockroachdb-integration/
---

![Introducing Instant GraphQL for CockroachDB](https://hasura.io/blog/content/images/2022/11/cockroachdb-graphql-1.jpg)

We are pleased to announce the beta release for CockroachDB on Hasura in v2.15.0, which will be available in the open source and cloud free versions of Hasura. Together, Hasura and CockroachDB drastically reduce the time and effort required to build or migrate to a high availability distributed database architecture that is leveraged using an enterprise grade data access layer that includes GraphQL & REST APIs, Declarative Role Based Authorization, Advanced Security and Performance with rate limiting, allow lists, and caching. The combined solution of our platforms cut what could be years of experimentation and development down to weeks.

## What is CockroachDB?

CockroachDB is a distributed SQL database built using a strongly-consistent key-value store. It scales horizontally; survives hardware failures with minimal disruption or manual intervention; supports strongly-consistent ACID transactions; and supports the PostgreSQL wire protocol and the majority of PostgreSQL syntax.

## When is CockroachDB a good choice?

CockroachDB is a good choice for applications that require high availability and reliability across multiple regions. Many of the traditional drawbacks associated with distributed databases such as complexity that increases operational overhead are addressed with simple configurations that allow users to automatically replicate, rebalance, and recover from failures. The ability to scale up and down makes CockroachDB a cost effective solution for a wide range of operational requirements.

## Why Hasura?

Hasura’s intuitive tools and documentation make it easy to set up and connect to CockroachDB, instantly generating GraphQL schemas and resolvers based on the tables and views in the database. With little to no effort organizations use Hasura to create a powerful data access layer that includes GraphQL & REST APIs, declarative role-based authorization, advanced security and performance with rate limiting, allow lists, and caching with little to no effort.

### Auto-Generated GraphQL Schemas and Resolvers

Hasura’s ability to instantly generate GraphQL schemas and resolvers based on the tables and views in CockroachDB saves time spent on development and continued maintenance because developers no longer have to author more data access APIs or modify the code every time there is a database change. Hasura provides “GraphQL out of the box” with its ability to auto-generate GraphQL schemas and resolvers from CockroachDB, saving months of development time - especially in the early stages of greenfield projects or migrations when changes to features and the underlying database happened frequently. Many organizations use Hasura for nearly all queries and updates for hundreds of database tables.

_Ref:_ [_https://hasura.io/case-studies/pulley/_](https://hasura.io/case-studies/pulley/)

### Security, Authorization & Auditing

Hasura’s granular authorization features can be applied down to the row and column level to address a wide range of data authorization use cases and Hasura’s built-in auditing capabilities can be used to track changes in user permissions, providing a history of changes.

A mature and hardened data authorization layer is essential to protecting sensitive financial and personal data. To ensure the security of the system, Hasura regularly performs penetration testing to make sure Hasura is hardened from external attack.

### Data Migrations

Hasura’s migrations features track CockroachDB database schema changes in metadata, allowing users to keep their database consistent between development and production.

### Management Console

Hasura’s console also increased the developer’s productivity by making it easy to perform GraphQL schema generation tasks, perform GraphQL queries, and perform traces to identify any performance bottlenecks.

**Before**

![Introducing Instant GraphQL for CockroachDB](https://lh4.googleusercontent.com/Z2p6F-PrHEP8986nqdyAUMv87lvF3Q748d9hgHM35ZSSG0Bm1biTHf9jg5DU9tOt4ANKslHik4kkRUI84gv_pqerVzOwr7xQM0XkepFo3kr5ziUtQBU9qbFZyZHG3QSKBm_IoqF8rX66JCyeaIs_sZ0NCUXxuX5ip9u894GSPfWdYrIEe0EzP3zH5JbC)

![Introducing Instant GraphQL for CockroachDB](https://lh4.googleusercontent.com/wSOLV38XuxFDeRAF24zvsUpnE_bQCluv0gXD4rjT5CRMJ-yc8Gh6s9heBf58A9E8pOgR_cB45uliVq9R861VtBWK8xkTRG_LJ_mwepXzdoHx26qWvdzpdbYJSGYwwcHCEltBNhsKzNdgbiumzzGdJZRif6tQ7lYLt7bp2aV4zXRFY6fRtF0dXiH1UYjH)

**With Hasura**

![Introducing Instant GraphQL for CockroachDB](https://lh3.googleusercontent.com/nGNXGRP04NY5ePvtLDT3FE0EyfittbFveabn5Z0yn1-L9mIJF4uvUiTmEh-qskm6O7zoaVxqU9uY2waSUlY4s03zVMoR68PmFhg_PEEEextQ-aVXNnebO-xZAzSxJM6uhTV9GHOirUeBdjPEUBo7Nk3iKr7YFpdZ4cw-dtJudFV0dDGRt2Us0tdQNTFHaA)

![Introducing Instant GraphQL for CockroachDB](https://lh3.googleusercontent.com/ovty6Ey-5BAz8SrpVZHa45fmQFC91esI8qEDOYhKpDancgAW15xtWmsMhB7lQn8ZoVdOjL2-_-UUYogfHuvGODms_s-CX5gAm_FBAD3x5fYVlxFmzUgUiyiyvVKPmrk2_ENHOyb5xbuakgK4W6JbVw5pa5YL2lb_2VE5GNQQS0j6Dmd8JcoP-vNAg4GZDg)

## Why Hasura and CockroachDB?

Together, Hasura and CockroachDB drastically reduce the time and effort required to build or migrate to a high availability distributed database architecture that is leveraged using an enterprise grade data access layer that includes GraphQL & REST APIs, Declarative Role Based Authorization, Advanced Security and Performance with rate limiting, allow lists, and caching. The combined solution of our platforms cut what could be years of experimentation and development down to weeks. Providing our solutions as a service allows organizations, both big and small, to treat their data as mission critical to their business ensuring data is reliable, available, correct, with response times measured in milliseconds, regardless of scale 100% of the time.

## What is next?

Hasura will add support for Subscriptions in an upcoming release. Hasura support for the CockroachDB managed services will be available following the GA release of CockroachDB version 22.2.

## Try it out

You can follow the instructions found in the documentation [here](https://hasura.io/docs/latest/databases/postgres/cockroachdb/getting-started/docker/) to try Hasura's beta support for CockroachDB using docker today.