3rd Party Services Backend Discussion MySql PostgreSQL

Hasura

The Hasura GraphQL engine makes your data instantly accessible over a real-time GraphQL API, so you can build and ship modern apps and APIs faster. Hasura connects to your databases, REST servers, GraphQL servers, and third party APIs to provide a unified realtime GraphQL API across all your data sources.

Introduction

To use the Hasura GraphQL engine, you need to:

  • Deploy the Hasura GraphQL engine with access to a Postgres database
  • Set up and test your GraphQL API using the Hasura console UI (also possible via the CLI or API)
  • Consume the generated GraphQL API from your client apps

Get started from scratch

  • Using Hasura Cloud (recommended): Create a new Hasura Cloud project with just a few clicks.
  • Using Docker: Run a local development setup that sets up both the Hasura GraphQL engine and Postgres using Docker Compose.

Get started using an existing database

  • Using Hasura Cloud (recommended): Create a new Hasura Cloud project connected to an existing Postgres database.
  • Using Docker: Run as a docker container and connect to an existing Postgres database.
  • Using Kubernetes: Run on Kubernetes and connect to an existing Postgres database.

Features

  • Make powerful queries: Built-in filtering, pagination, pattern search, bulk insert, update, delete mutations
  • Realtime: Convert any GraphQL query to a live query by using subscriptions
  • Merge remote schemas: Access custom GraphQL schemas for business logic via a single GraphQL Engine endpoint. Read more.
  • Trigger webhooks or serverless functions: On Postgres insert/update/delete events (read more)
  • Works with existing, live databases: Point it to an existing Postgres database to instantly get a ready-to-use GraphQL API
  • Fine-grained access control: Dynamic access control that integrates with your auth system (eg: auth0, firebase-auth)
  • High-performance & low-footprint: ~15MB docker image; ~50MB RAM @ 1000 req/s; multi-core aware
  • Admin UI & Migrations: Admin UI & Rails-inspired schema migrations
  • Postgres ❤️: Supports Postgres types (PostGIS/geo-location, etc.), turns views to graphs, trigger stored functions or procedures with mutations

Architecture

The Hasura GraphQL Engine fronts a Postgres database instance and can accept GraphQL requests from your client apps. It can be configured to work with your existing auth system and can handle access control using field-level rules with dynamic variables from your auth system.

You can also merge remote GraphQL schemas and provide a unified GraphQL API.

Hasura GraphQL Engine architecture

Client-side tooling

Hasura works with any GraphQL client. We recommend using Apollo Client. See awesome-graphql for a list of clients.

Add business logic

GraphQL Engine provides easy-to-reason, scalable and performant methods for adding custom business logic to your backend:

Remote schemas

Add custom resolvers in a remote schema in addition to Hasura’s Postgres-based GraphQL schema. Ideal for use-cases like implementing a payment API, or querying data that is not in your database – read more.

Trigger webhooks on database events

Add asynchronous business logic that is triggered based on database events. Ideal for notifications, data-pipelines from Postgres or asynchronous processing – read more.

Derived data or data transformations

Transform data in Postgres or run business logic on it to derive another dataset that can be queried using GraphQL Engine – read more.

Demos

Check out all the example applications in the community/sample-apps directory.

Realtime applications

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *