Pick your API Builder in 2021 — Canonic or Hasura

SimranJot Singh
Canonic.org
Published in
6 min readJan 5, 2021

While building API’s has been simplified by many players in the market, deciding the right tool for your upcoming project or for a lean development team can be a really tricky job.

On 15th October’2020, we launched our product, Canonic, on Product Hunt and we were ranked the 3rd Product for the Day along with an incredible traction on Hacker News as well. Amongst all the questions that were asked to us about the product, the one that came most often was “How is Canonic different from Hasura?”

So, what exactly are Canonic and Hasura?

Hasura is an open-source GraphQL server that gives you realtime GraphQL APIs over Postgres, with web-hook triggers on database events, and remote schemas for business logic. It aims to helps you build GraphQL apps backed by Postgres or incrementally move to GraphQL for existing applications using Postgres.

Canonic is a low-code platform to craft API’s in minutes.
It offers a GraphQL service for the backend while managing the entire production-ready backend infrastructure needs. It lets you define your content-model, automatically provisions a database, spins up a server in realtime, and serves your content over both GraphQL and REST APIs.

It aims to give you a seamless experience to build out powerful backends for any kind of digital product in the most user friendly way.

If that still feels similar? Here are some of the key differentiators:

1. New/Linking/Importing Data API’s

Hasura provides an easy way to only connect with your own existing/new Postgres databases and provide the CRUD GraphQL APIs on top of it.

Canonic on the other hand gives you the flexibility to either:

  • If you have an existing database, with Canonic’s Import/Link feature, you can bring the data onto Canonic very easily (currently supporting MongoDB, in future via Postgres, Airtable, MySQL and more) and start building API’s on top of it.
  • For your new project, just define your content model to automatically generate a CMS, a database and deploy your project live in just a few minutes. Build your database on Canonic

CRUD APIs are generated in both GraphQL and REST formats.

import screenshot
Canonic Import Screen

2. Intuitive Content Modelling

Hasura’s primary use case is to provide Data APIs over existing Databases, it’s a little demanding process to create new tables, their fields, and relationships between them. For someone having no knowledge of data types, foreign keys, etc it can be rather confusing.

Hasura screenshot
Hasura content modeler

Canonic has its own unique graph-based content modelling engine that lets you define the structure of how you want your data to be laid out in a highly intuitive and interactive manner.

Canonic graph based content modelling system
-
  • Create different types of fields that you want to have in your table.
  • Reorder them however it fits best to you.
  • In-built support for integrating different User Signup types (Google, Github, etc)
  • Add validations that each of your fields will adhere to when adding/updating your content.
  • Define relationships and link tables easily.
  • Group fields together, either be for semantics or if you want to store a list of entries for that group of data.
  • Preview how your changes will look like when you deploy them.

3. Extending APIs and Business Logic

On Hasura, you can extend the CRUD APIs to write your own business logic by either:

  • Building your own GraphQL Service and merge that with Hasura’s GraphQL Service to make them work together under a single Endpoint.
  • Writing a custom web-hook yourself ideally as a server-less function, that gets triggered whenever any changes happen in the database, which Hasura triggers when your database changes.

On Canonic, If you want to add any new custom endpoints, you don’t need to build out a separate service and link it with Canonic.

  • You can create as many endpoints as you want that will be ready to serve on both GraphQL and REST formats.
  • You can add your custom business logic with the built-in code editor right there itself.
Canonic API Workflow Screen

It makes it insanely easy to build out new endpoints and extend on your existing ones as your product needs change without having to go anywhere else.

4. API Documentation

Your backend service ultimately needs to be integrated with other platforms that need to have the correct knowledge of the API contracts. Canonic smartly generates the documentation for all of your APIs in one place so that anyone can see what the contracts are start the integration directly without having to know your backend or database structure at all.

Documenting is an iterative process and needs to reflect the current and correct state of the system. This removes the responsibility of having to take care of documenting and lets your build rapidly.

Canonic Docs Screenshot
Canonic Docs Screen

In comparison, Hasura does not provide any documentation around API contracts.

5. Full Blown Content Management System

Hasura goes with the traditional approach of adding new rows and the values of its fields in their respective columns. It lets you see the data stored in your database using a basic tabular format.

Hasura CMS screenshot
Hasura CMS

Canonic on the other hand gives you a full-blown CMS tailored to how you defined your content model. You can add access control so that only people who have access to it can see and operate on it. You can upload images/files directly from there and follows all the validation rules that you defined on the content.

Canonic auto generated cms screenshot
Canonic CMS screenshot

6. More than a GraphQL Service

You need to have a considerable amount of backend and database knowledge to be able to start building with Hasura. It aims to save you the grunt effort of writing a CRUD and scalable real-time backend yourself.

Canonic aims to be a more citizen-first non-tech friendly platform that lets you build your entire backend stack end to end with the minimum level of technical know-how.

Hope this gives you a good understanding of how Canonic is different from Hasura and more clarity on how it fits into your stack, development workflow, and adds value to your project.

Canonic / Hasura

You can signup and start using Canonic for free here. You can also join our discord community to interact with other members and with us directly.

Website | Twitter | LinkedIn | Facebook | Instagram

--

--