Blog
/
Case Study

From Custom Code to Cutting-Edge: On The Beach Adopts WunderGraph Cosmo for GraphQL Federation

cover
Stefan Avram

Stefan Avram

min read

We're hiring!

We're looking for Golang (Go) Developers, DevOps Engineers and Solution Architects who want to help us shape the future of Microservices, distributed systems, and APIs.

By working at WunderGraph, you'll have the opportunity to build the next generation of API and Microservices infrastructure. Our customer base ranges from small startups to well-known enterprises, allowing you to not just have an impact at scale, but also to build a network of industry professionals.

TLDR;

During the pandemic, On The Beach embarked on a bold journey to transform their platform, opting for a complete redesign from the ground up. They embraced a microclient architecture, with GraphQL as the backbone of their API, allowing for seamless communication across services. However, as the company rapidly expanded and travel demand surged post Covid, their once monolithic GraphQL API began to buckle under the pressure, becoming a performance bottleneck.

Recognizing the need for a more scalable and agile solution, On The Beach set their sights on GraphQL Federation. This new approach promised to revolutionize how they managed their distributed APIs, offering the flexibility and efficiency they needed to power their future growth. The shift was more than just a technical upgrade—it became the foundation for their evolving vision of scalable innovation.

The Solution Part 1: Custom Built GraphQL Federation Solution

On The Beach sought to distribute their GraphQL API but found existing solutions too rigid for their needs. Undeterred, they built a custom pipeline using Apollo Rover and schema stitching to distribute the API across multiple services. While this approach initially worked, it quickly revealed its limitations—scalability was an issue, and maintenance became increasingly complex, prompting the need for a more sustainable solution.

The Solution Part 2: WunderGraph Cosmo

After exploring various options, On The Beach chose WunderGraph Cosmo over Apollo. Key factors in their decision included Cosmo’s advanced features like Event-Driven Federated Subscriptions and Advanced Request Tracing. The open-source nature of Cosmo, coupled with the opportunity for a close collaboration with the WunderGraph team, sealed the deal, offering them the flexibility and support they needed for future growth.

The Results

WunderGraph Cosmo has delivered significant improvements in both scalability and complexity management for On The Beach. With Event-Driven Federated Subscriptions, they will be able to scale operations more effectively, playing a pivotal role in the success of their real-time features. The advanced request tracing capabilities have made debugging production issues faster and more precise.

From a developer experience perspective, the introduction of the WunderGraph CLI has streamlined their development workflow. The Cosmo CLI (wgc) has simplified the management of GraphQL schemas, projects, and users, making API development and maintenance a seamless, efficient process.

In terms of performance, the Cosmo router has provided improvements of tens of milliseconds across the board. Compared to their previous custom-built solution, the Cosmo router handles significantly more traffic with fewer instances, resulting in notable infrastructure cost reductions.

In this case study, we’ll explore the migration from a custom-built GraphQL federation solution to WunderGraph Cosmo. We’ll dive into the benefits, challenges, and the impressive results On The Beach has achieved. Let’s get started!

On the Beach

Founded in 2004, On The Beach has grown into one of the UK’s leading travel companies, offering a comprehensive range of services, from flights and hotels to car rentals and beyond. As a publicly listed company on the London Stock Exchange, they have established themselves as a trusted name in the travel industry.

As the UK’s premier beach-focused online travel agent, On The Beach has consistently enhanced its customer experience. Their ability to rapidly launch new features and services has allowed them to stay ahead of the competition, providing a seamless and enjoyable experience for their customers.

On The Beach also has one of the most advanced engineering teams in the UK, if not Europe. They are known for their innovative approach to engineering and their use of cutting-edge technology. They are also known for their strong culture of open source and collaboration.

Challenge: Modernizing On The Beach and Overcoming Bottlenecks with GraphQL Federation

In January 2020, as the pandemic reshaped the world, On The Beach seized the moment to overhaul their platform, opting for a full-scale modernization. They embraced a microclient architecture and chose GraphQL as the interface for their API, laying the groundwork for a more agile future.

The task of modernizing the platform fell to Stephen Wootten, Senior Software Engineer, and Craig Bradley, Principal Software Engineer. While their efforts were successful, new challenges soon emerged as their monolithic GraphQL API began to create bottlenecks.

The Graph API slowly started to form into a monolith API which introudced a lot of pain points and bottlenecks for our team. With that in mind, we started to look into GraphQL Federation.

-Stephen Wootten, Senior Software Engineer, Onthebeach.com

As a team, they knew they needed a more efficient and scalable solution to manage their GraphQL APIs. They started looking into GraphQL Federation, but found that existing solutions were not flexible enough to meet their needs. With this in mind, they started building their own solution.

We started building our own Federation Solution. We ended up implementing a home baked solution utilizing Apollo Rover and schema stitching. It worked for a while, but as we grew, it became more and more difficult to maintain, and harder for teams to adopt. We decided to look for a better solution.

-Stephen Wootten, Senior Software Engineer, Onthebeach.com

Adopting WunderGraph Cosmo and On The Beach's Hybrid Approach

After evaluating several options, On The Beach chose WunderGraph Cosmo over Apollo GraphOS, drawn by its powerful features such as Event-Driven Federated Subscriptions and Advanced Request Tracing. The open-source nature of WunderGraph Cosmo, combined with the opportunity for close collaboration with the WunderGraph team, further solidified their decision.

On The Beach operates a hybrid setup with WunderGraph Cosmo, self-hosting the Cosmo router in their AWS Kubernetes cluster while leveraging the Managed offering. This configuration provides the perfect balance of performance, cost-efficiency, and control.

As a travel e-commerce company, On The Beach required self-hosting to meet their stringent performance needs. The self-hosted Cosmo router allows for a more scalable and efficient distribution of GraphQL APIs, handling significantly more traffic with fewer instances, leading to reduced infrastructure costs. Additionally, self-hosting offers the team greater control over their infrastructure, enabling deeper customization to fit their unique requirements.

Self Hosting the cosmo router allows us to have more control over our performance, the running costs, networking, tuning of the self hosted router gives us better response times and performance for our website, vs if we used a managed router

-Stephen Wootten, Senior Software Engineer, On the Beach

WunderGraph Cosmo Hybrid Reference Architecture

Let's dive into the features that WunderGraph Cosmo offers and how they have improved the overall experience for the On The Beach platform team.

Event-Driven Federated Subscriptions: A Game Changer for On The Beach

Event Driven Federated Subscriptions has revolutionized how On The Beach handles real-time data, making it more scalable and efficient than ever before. By leveraging a powerful publish-subscribe pattern, the Cosmo router acts as a central broker, seamlessly pushing subscriptions to the relevant services as they are created. This architecture allows On The Beach to distribute GraphQL subscriptions more efficiently across their ecosystem.

For On The Beach, this feature has been a game changer, enabling them to scale their operations effortlessly while powering the success of their real-time features. The impact has been nothing short of transformative, allowing them to innovate faster and deliver better experiences to their customers.

Stay tuned for a deep dive into how this technology is reshaping their platform in our upcoming blog post and video!

Advanced Request Tracing: Boosting Performance and Profitability for On The Beach

Advance Request Tracing allows for faster and more accurate debugging of production issues. With ART, the Cosmo router traces each request and provides developers with a clear view of the query plan within the Cosmo Studio, allowing for a deeper understanding of how queries are executed. This insight is crucial for optimizing queries, improving data loading strategies, and preventing both over-fetching and under-fetching of data.

For a high-traffic e-commerce site like On The Beach, this is invaluable. By eliminating slow queries and improving loading times, ART has helped boost overall performance and reliability, ensuring a smoother experience for customers. This, in turn, directly impacts revenue, as faster and more efficient query execution means less friction for users and higher conversion rates. In short, ART isn’t just a performance tool—it’s a profit-driving asset.

Advanced Request Tracing in WunderGraph Cosmo:

Schema Registry: Streamlining API Development and Unlocking Efficiency for On The Beach

With the introduction of a schema registry , On The Beach transformed how they manage their GraphQL schemas. By centralizing schema management, they gained the ability to version schemas more efficiently, maintain them in a single location, and have a clear, comprehensive view of their entire API ecosystem. Paired with the Cosmo Studio and Cosmo CLI , this setup streamlined the entire process of building and maintaining GraphQL APIs, eliminating the bottlenecks they faced with their previous home-built solution.

For an e-commerce platform, this level of efficiency is vital. By simplifying schema management and accelerating development workflows, On The Beach could deploy new features faster, ensuring their platform stayed responsive and adaptable to market demands—ultimately driving better customer experiences and higher revenue potential.

The WunderGraph Cosmo Schema Registry in action:

Exceptional Support: A Key Factor in On The Beach’s Success with WunderGraph

One of the most crucial aspects of On The Beach’s decision to choose WunderGraph was the exceptional support they received from the WunderGraph team. The high level of assistance provided was a major selling point, allowing On The Beach to focus on their core business rather than getting bogged down by the technical intricacies of their solution.

With the WunderGraph team’s expertise at their disposal, they could confidently scale their platform, knowing they had the support needed to address any challenges along the way. This partnership enabled them to innovate faster and deliver an even better experience for their customers.

We've got a really good relationship with the WunderGraph team. They've been incredibly responsive, often addressing our concerns within minutes. They're always on hand to help and provide guidance, genuinely interested in the solutions we are building and always open to sit down and discuss our graphql federation strategy. Anytime we've spotted an issue or had a question, the WunderGraph team acted instantly and kept us up to date with the progress. One of the biggest benefits is that their is a lot of new features being developed and it's exciting to be involved in that through their RFC process.

-Stephen Wootten, Senior Software Engineer, Onthebeach.com

Open Source Advantage: On The Beach’s Active Role in WunderGraph Cosmo’s Development

WunderGraph Cosmo’s fully open-source nature gave On The Beach a unique advantage, making it easier for them to actively contribute to the project. By fixing bugs, adding features, and improving documentation, they forged a closer relationship with the WunderGraph team and became more involved in shaping the platform’s future. T

The open-source model also simplified security audits, allowing On The Beach to review the codebase thoroughly and provide valuable feedback. This collaborative approach not only strengthened their partnership with WunderGraph but also ensured the platform aligned closely with their needs.

The initial attractions around WunderGraph were due to the fact that it was open source. It was useful and transparent that we were able to see exactly how Cosmo was implemented and how it worked. If we had any problems or questions, we were able to look at the code and understand it.

-Stephen Wootten, Senior Software Engineer, Onthebeach.com

The Future of On The Beach and WunderGraph

As On The Beach continues to grow and evolve, their partnership with WunderGraph will remain a cornerstone of their platform’s success. The WunderGraph team’s commitment to innovation and their responsiveness to customer needs have been instrumental in driving the platform forward.

Looking ahead, WunderGraph is excited to continue collaborating with On The Beach to explore new features and enhancements. We are collectively excited for the upcoming RFC for Graph Pruning and Garbage Collection , which will further streamline API development process and provide even greater performance benefits for On The Beach and all customers!

Moreover, the WunderGraph team’s active engagement in the open-source community has positioned them as a leader in the GraphQL ecosystem. By fostering a collaborative environment and encouraging contributions from the developer community, WunderGraph is setting the stage for future advancements in GraphQL technology.

Video testimony

If you prefer watching to reading, you also have the option to view this case study as a video: