What is Hasura

At first glance, Hasura is a PaaS with BaaS components. It's built with CoreOS, Docker & Kubernetes so it can run anywhere.

Hasura: Design goals

  1. Be the fastest way to get a production backend up and running (Parse/Firebase)
  2. Provide common architecture and tooling across ALL projects
  3. No restriction on choice of development language/framework
  4. No infrastructure dependency
  5. Easy to reuse our own code across projects. Eg: Payment gateway API
  6. Easy to reuse code from the community across projects. Eg: Blog engine
  7. Support offline development

1. Fast development: Instant APIs

Taking our cues from Parse and the amazing rapid development experience, we made tools to create the data and auth APIs as fast as possible.

Data APIs

Given tables and metadata for row-level access control metadata, Hasura automatically provides a JSON API for web-clients.

We created a simple dashboard to rapidly create tables and add appropriate metadata.

Auth APIs

Hasura uses a Python based auth microservice that supports all the common ways to auth (Social, recaptcha, OTP etc). Basic user & auth APIs are available instantly upon project creation without any configuration.

The Hasura dashboard allows further configuration of the the social authentication APIs & dashboard to manage application users.

2. A common architecture

  • We buy into a microservice architecture
  • Containerize everything
  • Choose Postgres as the only database (see this & this) and have the platform manage it completely
  • Centralize & abstract out auth/sessions into the API gateway

3. Handling persistent data

Postgres is set as the primary database.
The Postgres instance and it's state is managed by the platform. Backups, PITR & vertical scaling features are built-in to the platform.

4. API gateway & centralized session management

Then, Nginx acts as an API gateway and uses Redis to resolve auth-tokens into user/role HTTP headers for all upstream microservices.

5. Re-using code

Each microservice on the platform is dockerized. This allows us as developers to push & deploy docker images, or to use existing docker images from the community.


Read more posts by this author.

comments powered by Disqus