Work

Portfolio

Contact

Batch adding data source objects to the API

Improving the developer experience (DX) of adding a large amount of data source objects to the API.

The Value of Data Source Integrations

Hasura's core functionality allows seamless integration of database objects into GraphQL APIs.

This feature enables users to effortlessly add various database objects - including tables, views, and functions - to their API, automatically generating typed GraphQL nodes.

While powerful, particularly for databases like Postgres or MSSQL, this capability faced significant challenges as the company expanded its focus to enterprise clients with extensive data infrastructures.

This was the layout for the original adding feature before we got into updating it.

The Scaling Challenge

As Hasura targeted larger enterprises with vast datasets, three critical issues emerged in their interface:

  1. Object Discovery: With databases containing hundreds or thousands of objects, locating specific items became increasingly difficult.
  2. Transaction Limitations: The addition of objects occurred as a single, synchronous transaction. Any issues during this process would halt and reverse the entire operation.
  3. Lack of Visibility: Users had no insight into the progress or estimated completion time of batch additions, leading to uncertainty and inefficiency.

Additionally, there was no built-in mechanism for conflict resolution when issues like duplicate type names arose.

Strategic Solutions

The updated version of the feature, starting with having optional selectable database objects and a search for the objects to add.

If you'd like to know more about our design system update, you can find out more here.

Recognizing these pains, we implemented a set of new designs with the following solutions:

  1. Enhanced Search Functionality: Integrated a search feature for database objects - significantly improving the efficiency of object location within large databases.
  2. Improved Transaction Model: Worked with the team to re-factor the transaction process to be asynchronous and more resilient. This allowed for partial success in batch operations, graceful failures, and an increase in overall speed.
  3. Progress Tracking: Introduced a transparent progress tracking system, providing users with real-time updates on the number of items being added and estimate of how many more actions were needed.
  4. Intelligent Conflict Management: When conflicts did occur, such as duplicate type names - the system now provides immediate feedback and offers users the opportunity to resolve issues as needed.
Explicit indicators for the status of adding database objects as well as errors.
Error resolution modals depending on the the error that was issues (for instance, customizing to solve a type conflict issue).

Impact and Outcomes

These enhancements resulted in substantial improvements:

  • Increased scalability: Hasura can now efficiently handle enterprise-level databases with numerous objects.
  • Improved user experience: Developers can work more efficiently, focusing on API development rather than interface navigation.
  • Better resilience: Better support for error-handling and edge / corner cases which could occur.

Index