How FASTCUP built a high performance app with a complex database schema using GraphQL and Hasura
How FASTCUP leveraged GraphQL, Hasura, Postgres and Event Triggers to build a fast, realtime app.
FASTCUP is an esports league app that allows users to play Counter-Strike matchups against other teams on their game servers, with custom anti-cheating measures and rank-based matchmaking.
Gamers have access to profiles of other players with details like ranks, statistics, matches, friends, advanced player statistics, etc. They can even enter leagues and tournaments, and earn cash prizes.
Solving for a complex database schema and website speed
In 2018, FASTCUP decided to bring their gaming services to a larger audience by building an English language version of their existing web app. This new app, https://cs.fastcup.net, was required to query a really complex database schema with lots of relational data:
You need a “bird’s-eye” view to fit FASTCUP’s database schema in a single page
One of the major design goals for this app was to be extremely fast (gamers tend to expect speed from their websites too!), and consequently, structuring the response payload to exactly meet the requirements of the app’s front-end was a strict requirement. GraphQL’s proposition of avoiding under-fetching/over-fetching of data fit their needs perfectly, and the team started evaluating tools for building a GraphQL API.
Evaluating GraphQL tools
Before settling on Hasura, they considered a few other tools, but discarded them for being slow and inflexible, and for their limited support for GraphQL subscriptions and other arguments/operators (where, order by, limit, etc).
A search for GraphQL tools with support for subscriptions led the team to discover Hasura and subsequent evaluations showed it to be a good fit for their requirements due to:
- Leveraging of Postgres features for a better developer experience
- GraphQL engine’s speed and performance
- Auto-generated CRUD GraphQL API over a database schema
Hasura now powers almost all of the app’s GraphQL API requirements. Event triggers are also leveraged to kickstart a game server when the status of a match changes to “Live”.
Feedback on Hasura
FASTCUP believes that Hasura has contributed significantly to their feature throughput, largely due to the fact that they are required to write code only to support custom business logic in mutations. They also love the fact that there’s a "single source of truth" derived from introspecting the database, and the fact that this “snapshot” can be version controlled.
Next steps with Hasura
The FASTCUP engineering team is the go-to candidate for Hasura for feedback on performance-related features. They also actively shape the product roadmap with their feedback, especially on enhancements for event-triggers and iterations on access-control patterns.
FASTCUP currently supports CS:GO and CS 1.6, and they are aggressively working on adding support for other popular games like PUBG, Dota 2, etc. with Hasura powering the entire catalog.
Want to know how Hasura can help your team? Schedule a demo.
This case study was prepared basis a discussion with the FASTCUP team.