GraphQL is a popular choice for enterprises looking to improve the performance, efficiency, and flexibility of their APIs. Functionality like being able to fetch very specific data (no over or under-fetching), having a strongly typed system, and schema introspection all make GraphQL a great choice.
However, building a GraphQL API manually requires considerable time, effort, and investment. Engineering organizations need to write a significant amount of code by hand just for the basic CRUD functionalities of your GraphQL API. Adding authorization, multiple data sources to your end-point, and custom business logic requires even more work and code. This work will likely take months or even years depending on complexity and a team of developers.
We find more and more enterprises asking themselves whether their business is a GraphQL business or not. Why spend time and resources on tedious tasks that are not actually core to your IP when you can get the most heavily leveraged GraphQL functionality out of the box?
This is where Hasura comes in.
Hasura is an open-source product that auto-generates GraphQL or REST APIs with a built-in authorization layer for your data. Point Hasura to the databases, REST & GraphQL endpoints, and third-party APIs, and it provides a unified, connected, real-time, and secured GraphQL API for all of your data.
Hasura speeds up the development process, and in this article, we will explore the top three reasons why enterprises choose Hasura for their GraphQL needs.
Data Access
Data in the modern world most likely comes from multiple sources. In an enterprise environment, you might have data from sources such as your database(s), internal APIs, and third-party services.
That means there are time-consuming and repetitive tasks, such as connecting those data sources to your applications. After you connect them, the work continues by ensuring they function properly on their own and with the other existing data sources.
So each time a new data source needs to be integrated with an existing application, the process repeats:
Integrate the data source -> configure it -> test it -> maintain it
That can quickly become a bottleneck that slows down the development team and the application. So the question is - is there a better alternative? The alternative is Hasura.
As the diagram shows, Hasura abstracts all the tedious, boring, and time-consuming work. You connect all the data sources (databases, REST and GraphQL APIs) to Hasura, and it automatically generates a unified, secure, and real-time GraphQL API.
In the case of databases, the Hasura GraphQL Engine automatically generates the GraphQL Schema and operations such as queries, subscriptions, and mutations. It also enables you to connect existing REST and GraphQL APIs to your Hasura application.
Hasura unifies all data sources and enables the client to access unified data through the GraphQL API provided by Hasura. Creating a unified data-access API layer also allows developers to access and manipulate data in their database without having to write complex SQL queries. To access the data, developers can use the GraphQL API endpoint provided by Hasura to send queries and mutations that specify the data that should be retrieved or updated.
Hasura provides several tools and features to help developers work with data more effectively. For example, the Hasura Console provides an intuitive interface for exploring and testing the GraphQL API, and the Hasura CLI allows developers to manage their data from the command line.
Overall, Hasura’s approach to data access makes it easy for developers to work with their data and build robust and scalable applications on top of enterprise data.
API Production Readiness
In addition to improving data access, another primary business value Hasura provides is reducing the time to market by offering you critical features out of the box such as:
- caching
- real-time capabilities
- authorization
- observability
... and much more.
As mentioned previously, building a GraphQL API manually requires effort just for the basic functionalities. Implementing complex operational features like caching, real-time capabilities, or authorization requires even more effort.
Traditionally, building an API manually takes weeks or months and a team of developers. In this process, the developers also need to optimize the API to be production ready. That includes security, authorization, availability, scalability, and observability.
Hasura transforms the process of building the API into a service that comes with features such as authorization, real-time capabilities, observability, and availability out of the box. And everything highlighted in the above diagram.
Hasura and the developer tooling around it are designed to help teams build products faster and more efficiently.
Increased Developer Productivity
Hasura cuts down development time by 50% to 80%. You can find more from our case studies here. Hasura does this by automating key GraphQL development tasks such as defining schemas, writing resolvers, and setting up a server. Secondly, it automates and abstracts tedious tasks such as:
- defining the GraphQL schema
- defining and implementing the GraphQL resolvers
- creating and configuring the GraphQL server
... plus other mundane work.
Such features are critical for an enterprise and tricky to implement. They require experienced API developers and a considerable amount of effort and time. Once they are implemented, someone needs to maintain them. Letting Hasura take care of them improves the developers’ productivity as they can focus on other critical tasks, like delivering core IP back to the business.
Another thing that increases developer productivity is Hasura’s metadata. The metadata is the brain of a Hasura application that captures vital information such as the following:
- connections to the data sources
- mapping the model from the data sources into an API
- relationships between the models
- authorization rules
Hasura uses this metadata information to generate a JSON API schema and exposes it through a GraphQL API. GraphQL is ideal for working with JSON data, as it is native to the JSON format. As an API specification, GraphQL allows developers to create flexible and powerful APIs that can operate on a wide range of data models and support a variety of methods. At the same time, it maintains the controlled boundaries that are necessary for a web service.
Developers can then use the metadata to configure and manage their applications. As a result, it improves the developer experience and productivity since developers don’t have to write code to configure or enhance their applications.
Summary
Most of the work involved in building a Data API via GraphQL is either tedious and repetitive or difficult and time-consuming. It’ll require lots of effort and resources.
But it doesn’t have to be that way. Hasura enables enterprises to build a production-ready Data API, with all the critical features, without having to write any code. That makes it easy for developers to quickly and easily build scalable and reliable applications without spending time on tedious and complex tasks.
Overall, Hasura offers a comprehensive and robust platform for enterprise application development.