Athlane realized they needed to make some architectural changes to scale to an increasing number of users and increase the efficiency of their small development team. They migrated their data store from Firebase to Postgres because they needed the capabilities of a relational database.
The next challenge Athlane faced was how to build their data access layer. They quickly realized that developing a REST-based architecture would consume a large amount of developer time and resources that could rather be spent working on the entire application stack and quickly creating new user features.
Athlane’s backend systems were authored in Node.js and their website frontend in Vue. They needed to find a solution that was compatible with those frameworks and additional constraints and technical requirements:
• Small Development Team: Athlane’s 6 engineers needed to stay lean and flexible - understanding all layers of their system - database, backend, integrations, and the frontend web UI
• Flexible Web APIs: One of the things they wanted to avoid is the inflexibility of utilizing and maintaining REST APIs, where multiple variations of similar request types would require their own REST endpoint because of different end-user requirements.
• Serverless Architecture: Athlane’s small development team made a commitment to use a serverless architecture to reduce the administrative and operational requirements as much as possible.
• Security & Authorization: They needed to make sure that the data was secure and that users could only view data they were authorized to see.
After considering multiple options, including writing their data access API layer themselves, Athlane chose Hasura Cloud for its comprehensive GraphQL capabilities, ease of use, security, and because it didn’t require maintenance as a managed service.
Athlane architecture diagram
Utilizing Hasura and its GraphQL engine made it easier for every engineer to understand the flow of data from the database to their frontend, making it possible for every team member to operate as a full stack developer and add features quickly. Connecting their Vue frontend to Hasura was simple with existing open-source GraphQL libraries.
Hasura’s intuitive tools and documentation made it easy to set up and connect to their Postgres database, instantly auto-generating GraphQL schemas and resolvers based on the tables and views in their database. This saved them development and maintenance time not having to author any more of their own data access APIs themselves and not having to modify the code every time they made a database change.
One of the main features of Athlane’s website is the ability for users to message each other. Athlane implemented this utilizing Hasura’s full support for GraphQL subscriptions, giving Athlane a solution to provide real-time notifications and messages between users.
Hasura Cloud provides a managed service, providing auto-scaling to meet spikes in traffic, and auto-upgrades to the latest versions. This no-ops approach fits into Athlane’s desire to use a serverless architecture as much as possible.
Another benefit Hasura provided is its built-in security and authorization capabilities, which can limit what data is returned down to the individual column and row level. This capability saved on development time implementing it themselves and ensured that customers could only view their own data.
Athlane also utilized Hasura Event Triggers and webhooks to provide real-time integrations to multiple AWS Lambda functions they’re also using.
After migrating away from Firebase, Hasura provides the GraphQL-based data access layer used by all of Athlane’s services and secures and authorizes all the API requests. Hasura also synchronizes Athlane’s overall serverless infrastructure by utilizing Hasura Event Actions to initiate webhooks to other services. Additionally, Athlane built its interpersonal messaging feature utilizing Hasura’s full support for GraphQL subscriptions.
Besides the aforementioned benefits i.e. the doubling of the delivery velocity of Athlane’s small development team, providing easy integration with Athlane’s codebase and expertise in Node.js and Vue, and the eliminating of time necessary to write and maintain inflexible REST-based data access APIs, Hasura Cloud also auto-scales to meet user demand, auto-upgrades to the latest releases, and eliminates administration and system maintenance, making it super easy for Athlane to meet growing demands while keeping maintenance overhead to a minimum.
Thank you to Athlane and Ryan Jiang - CTO for sharing their Hasura story!