/

Introducing Instant APIs for MySQL, MariaDB, and Oracle

MySQL, MariaDB, and Oracle are undoubtedly some of the most widely utilized databases in the market today. Over the past several years, I’ve worked closely with numerous software development teams building applications on top of these databases and have personally experienced the effort it takes to build a data access layer that provides an interface between the application and the database.

This data access layer is generally built by using an ORM (object-relational mapping) library or framework that maps objects in the application to relational database tables. It takes a lot of custom coding to create an API layer that provides a standardized way for business logic services or other applications to access and manipulate the data.

These efforts often take months since – in addition to building the API server from scratch – to productionize it, you often need to secure the APIs, optimize performance, and ensure reliability.

Today, I’m delighted to share that Hasura has achieved a breakthrough – instant APIs (GraphQL and REST) on top of MySQL, MariaDB, and Oracle with built-in production-ready features allowing you to get an API server running within days.

We’ve achieved this by releasing data connectors (currently in beta) for these databases. Over the past few months, we’ve learned that our customers and users see these connectors being useful for rapidly:

  • Modernizing legacy applications to newer frontend frameworks like React, NodeJS, etc. with no change to the database
  • Building new applications on top of existing data
  • Combining data from MySQL, Oracle, and MariaDB with newer data sources (such as PostgreSQL and existing GraphQL APIs) through powerful remote relationship capabilities

How do these new data connectors work?

To get a sneak peek, check out these videos illustrating how Hasura connects to MySQL and Oracle databases and generates GraphQL APIs to perform reads, writes, and joins across  databases and other GraphQL APIs.

Note: You can create a REST endpoint from a Hasura GraphQL API in less than 30 seconds – check out our docs for more info.

Getting Started with MySQL and MariaDB

Getting Started with Oracle

Production readiness

We’ve built a number of features with Hasura to ensure that your API server can be deployed in your environment and is reliable, secure, and scalable. Here are some key considerations:

Support for a number of cloud databases

Our MySQL, MariaDB, and Oracle database connectors have been tested and validated on a number of cloud databases, including:

  • Amazon Relational Database Service (RDS) (MySQL, MariaDB, and Oracle)
  • Amazon Aurora (MySQL)
  • Google Cloud SQL (MySQL and Oracle)
  • Digital Ocean (MySQL)
  • SkySQL (MariaDB)

Flexible deployment options

To use our data connectors, you can either use:

  • Our fully managed service – Hasura Cloud is deployed in AWS or GCP and automatically scales with your application
  • Our self-hosted offering (Hasura Enterprise Edition) allows you to run Hasura in your infrastructure in the container environment of your choice (Kubernetes, Docker, AWS ECS, Google CloudRun, Azure Containers, etc.)

For more information, check out our “getting started” guides for MySQL, MariaDB, and Oracle.

Performance

Performance is critical for API servers as it directly impacts the user experience and the success of your application and its related services.

We’ve done performance benchmarking of our data connectors to ensure that our API server responds quickly to client requests, with sub-second response times, and scales to thousands of requests per second.

This is done by:

  • Implementing predicate push-downs that handle role-based authorization through the database query as opposed to filtering or transforming at the API layer
  • Implementing query field projection that ensures only the requested fields are being queried via SQL, which optimizes for as few fields as possible being sent over the wire
  • Efficiently solving for the (N+1*) query anti-pattern that can occur with naive implementations that join between tables

*The N+1 query anti-pattern is where you query “table B” for every row returned by the query to “table A,” which is very inefficient. In Hasura, join queries are optimized to query each table once, limiting the number of separate queries issued to the smallest possible number.

We’ll publish a follow-up blog with full details on our performance benchmark test soon. Plus, query response times can be brought down even further with our query-response caching feature.

Security

Hasura has a number of robust features to ensure the security of your MySQL, MariaDB, and Oracle applications in production.

  1. With Hasura, you can easily manage access to your data and APIs by defining roles and permissions. Hasura's fine-grained access control system allows you to specify which users can access which parts of your data, ensuring your application is secure and robust. For more information, check out our docs on authentication and authorization.
  2. Leverage API limits to prevent API performance issues caused by malicious or poorly implemented queries.
  3. Use role-based allow-lists to restrict queries to be accessed by only certain roles.
  4. Restrict access to the GraphQL schema on a per-role basis.
  5. Implement multiple JWT secrets to support multiple authentication providers and roles in your Hasura-based application and multiple admin secrets to implement security mechanisms like rotating secrets and enable lifecycle management for individual secrets.

Reliability

Given that Hasura forms an integral part of your application stack, you want to ensure reliability for your apps in production by monitoring, diagnosing, and troubleshooting all aspects of your Hasura deployment along with all other application components and infrastructure.

Hasura provides application telemetry data in the form of logs, metrics, and traces that can be exported to your observability tool/APM of choice. For more information, check out our docs on observability integrations in Hasura Cloud and how we provide logs, metrics, and traces in Hasura Enterprise.

Conclusion

Hasura's support for the MySQL, MariaDB, and Oracle data connectors offer developers a powerful way to quickly build data APIs and ensure they are secure, scalable, and reliable in production.

By simplifying the process of building and deploying APIs, Hasura’s data connectors help you focus on quickly delivering value to your end-users, without getting bogged down in the details of building a data API yourself.

Join our launch event webinar on May 18

We have an exciting launch event planned! Don't miss out on our virtual product launch event, where we’ll introduce these three new data connectors for MySQL, MariaDB, and Oracle that simplify code writing and SQL queries.

The event will feature a live demo, a keynote from Hasura Co-Founder and CEO Tanmai Gopal, and a customer panel discussion with two leading development consultancies. Register now to reserve your spot.

Connect with us

A reminder, this is the beta release, and we’re moving quickly to add new functionality for MySQL, MariaDB, and Oracle.

If you’d like to discuss our connectors, request new features, or just ask questions about Hasura and these databases, connect with us on Github or join our Discord. To get started right away, sign up for a free Hasura Cloud account.

Blog
02 May, 2023
Email
Subscribe to stay up-to-date on all things Hasura. One newsletter, once a month.
Loading...
v3-pattern
Accelerate development and data access with radically reduced complexity.