Case study

How Hasura is Enabling the Modernization of the U.S. House of Representatives 30-year-old Tech Stack

The United States House of Representatives is one of the U.S. Congress's two chambers (the other is the U.S. Senate) and part of the federal government's legislative branch responsible for making and passing federal laws. The Legislative Applications department under the Office of the Clerk is responsible for managing the software applications and data for the U.S. House of Representatives; the data includes core legislative activities, such as Congressional information, federal bills, and other information from external partners and government institutions.

Key metrics

Simplified GraphQL API creation

Improved Developer Productivity

Excellent performance that automatically scales

The Problem

U.S. House of Representatives's Challenge

The U.S. House of Representatives needed to modernize their tech stack  

One of the applications the Legislative Applications departments handled was the software used to manage the core legislative activities of the U.S. House of Representatives. The system was responsible for managing activities, such as introducing federal laws, managing activities on these laws, and exchanging information with the Senate and other government institutions. However, the Legislative Applications department observed that their team struggled under the weight of outdated tools and technologies. Therefore, it was becoming difficult to deliver new features and updates, which was a pain point to the end-users and developers.  

To serve their users more efficiently, improve security, and enhance processes and productivity, the Legislative Applications department set out to modernize its 30-year-old technology stack.  

As an integral part of the government operating in a regulated field, they had to ensure their new tech stack was secure, resilient, and future-proof. They settled on using React for the front end and ASP.NET Web APIs for the backend with Postgres as their database. Additionally, they decided to use GraphQL as the data access layer due to the increasing complexity of their backend data. Ultimately, they needed a solution that would be powerful enough to describe all of their data efficiently.  

Some of the goals for this modernization project were to:

Consolidate complex data from disparate sources

Handling data for an over 200-year government institution, the Legislative Applications department had data in numerous backend sources, which became complex to manage. Additionally, they observed that their data became increasingly relational, and handling the data dependencies with REST APIs became burdensome. Therefore, they needed a solution to merge these different data sources to a simplified view for their clients to consume.

Provide a cleaner architecture for domain and business logic

The Legislative Applications department observed its domain and business logic scattered across different application components, and it was becoming a pain for developers to handle. They wanted to transition into a cleaner and more efficient architecture that was both easy to manage and flexible.

Reduce time spent developing data APIs

To boost developer productivity, the department of Legislative Applications wanted to shift away from developing repetitive data-fetching APIs, which crippled their development process. Instead, they needed a solution that would take on the arduous task of creating data CRUD (Create Read Update Delete) APIs while freeing their developers to focus on other parts of the application. Ultimately, they wanted to focus on the data and its relationships and not spend time on repetitive CRUD APIs.

The Solution

Why U.S. House of Representatives chose Hasura

Hasura provided a flexible and straightforward way to streamline data access and modernize the tech stack  

In their search for a GraphQL provider to power their data layer, they chose Hasura and ran a small pilot with one of their smaller applications.  

Impressed with the results, they decided to include Hasura as a core component of their tech stack for the following reasons:

Hasura customer illus

Instant GraphQL APIs

The Legislative Applications department was looking to present their data quickly and effectively to their end-users. Hasura powered GraphQL APIs made it easy for them to do that. They could easily connect Hasura to their Postgres database and get instant GraphQL data access on all their database tables. Additionally, Hasura powered GraphQL APIs made it easy for their developers to create fast data-fetching APIs, reducing development time and allowing them to iterate on features quickly.

Simplified authentication and authorization

Working with sensitive government information, the Legislative Applications department needed to ensure their data was secure, reliable, and of the highest integrity. Hasura’s role-based permissions and access control provided the extensive security they required. Additionally, they could integrate their existing security mechanisms (OAuth/JWT) with Hasura, thus ensuring that only the right individuals have access to the data.

Easy integration to .Net Controllers with Hasura Actions

With ASP.NET Web APIs powering their backend, the Legislative Applications department needed a GraphQL provider with easy integration to ASP.NET Web APIs, and Hasura Actions were the perfect fit. They could wrap their business logic around ASP.NET REST API endpoints and then map it to the central GraphQL API using Hasura Actions. Hasura Actions provided a nifty way to consolidate and encapsulate their business logic and integrate it with the central GraphQL API.

Incremental adoption

Hasura enabled the Legislative Applications department to transition to a modern-based architecture without requiring a disruptive, all-or-nothing switch. They were transitioning from legacy applications connecting with REST APIs to GraphQL, and they needed to do this without disrupting operations. Furthermore, they could gradually add Hasura into their systems while using their legacy APIs and REST endpoints, ensuring no downtime.

“Hasura got us out of the business of writing data access APIs and allowed us to focus on our business logic.”

Director of Legislative Applications, Office of the Clerk, U.S. House of Representatives

Andrew Doyle

Director of Legislative Applications, Office of the Clerk, U.S. House of Representatives

The Results

The U.S. House of Representatives optimized its application architecture using Hasura Cloud

With the help of Hasura, the Legislative Applications department has been able to modernize its tech stack. They now use a CQRS (Command Query Responsibility Segregation) pattern that separates their data store's read and update operations. All queries from the client go directly to Postgres via Hasura powered GraphQL APIs, and mutations go through Hasura Actions to ASP.NET WebAPIs, which delegate them to the appropriate business logic handler.

Some of the other benefits they’ve attributed to using Hasura include:

Centralized data layer

Hasura helped the Legislative Applications department centralize its data layer. As an institution, one of its primary goals was to give users access to data quickly and efficiently. Hasura powered GraphQL APIs provided a simplified view for the Legislative Applications department’s clients to consume data and showcase it to users.

Cleaner application architecture

The Legislative Applications department has achieved a consolidated business and domain logic after migrating to Hasura. They’ve been able to integrate complex business logic and GraphQL mutations using a simple and type-safe interface with Hasura Actions and ASP.NET. In addition, they’ve leveraged Hasura to transition to a CQRS (Command and Query Responsibility Segregation) architecture where all commands and queries flow through different pipelines, giving them a cleaner architecture and a streamlined source of truth for their business and domain logic.

Faster development time

The Legislative Applications department noticed faster development times and improved developer productivity after migrating to Hasura. Developers no longer had to create repetitive CRUD APIs that slowed down development time. Also, frontend engineers could iterate more quickly on features without relying on backend engineers to create APIs.

Closing Note

What’s Next for U.S. House of Representatives

With the success and lessons of this modernization effort, the Legislative Applications department of the U.S. House of Representatives plans to roll out similar architectures to other applications they manage. They’re also working with Hasura to iterate on features and optimize their tech stack to meet users' demands.

2024 Edition

The GraphQL Handbook

A GraphQL Handbook for developers and architects to help plan your GraphQL adoption journey.
The GraphQL Handbook

Build the most impactful data platform with Hasura DDN today.