GP Solutions is proud to announce the successful migration of Hotelplan’s website, Hotelplan.com, from API Gateway to Apollo Federation. The website became the first to undergo such back-end changes, with several others underway.

After the thorough preparation procedures which lasted almost two years, the joint efforts of our and Hotelplan’s teams resulted in the launch of a series of back-end migrations to Apollo Federation. The first website served as a starting point to test out the new technology and the overall methodology the two teams have been so carefully honing all this time. In the near future, we expect a few other Hoteplan’s websites to undergo the same migration.

We would like to extend our heartfelt gratitude to our dedicated team for their unwavering commitment and exceptional efforts throughout this migration project. Their expertise, diligence, and collaborative spirit were key in ensuring the project’s success.

We also want to express our sincere appreciation to Hoteplan’s team for their invaluable support and cooperation. Their insights, responsiveness, and partnership were crucial in navigating the complexities of this project.

What Is Apollo Federation?

Apollo Federation is a cutting-edge technology that allows you to combine several GraphQL APIs into a single, federated supergraph accessible by the client application. This approach simplifies the development process, since developers only need to create independent services responsible for subgraphs, which are then automatically combined by the Apollo Router.

Apollo Federation Scheme

CLIENTS CAN FETCH ALL THE DATA THEY NEED IN A SINGLE REQUEST.

Previous Challenges

Hotelplan’s previous structure of APIs and services had grown increasingly complex to handle and implement new features. Multiple services, each responsible for different app pages, were managed by an API Gateway that imported separate gRPC APIs, transformed them into GraphQL and integrated into a common schema. As data overlap increased across pages, multiple gRPC connections between services became necessary, leading to a tangled web of dependencies.

After migrating to Apollo Federation, we got rid of direct connections between services. Now each service is independent of the others.

Why Switch to Apollo Federation?

The decision to switch was spurred by the need for truly independent microservices at both the API and code dependency levels. Hotelplan’s domain entities are tightly interconnected, making GraphQL an ideal solution. The previous use of gRPC had led to “dependency hell,” where microservices were no longer autonomous, complicating support and releases of new features.

Advantages of the New Approach

  • Simplified integration: Developers no longer need to combine subgraphs manually, as the Apollo Router handles the process automatically.
  • Isolated testing: We can develop and test each service individually, which makes it faster and easier to develop and support specific parts of the application.
  • Automation and debugging: We can implement the latest version of the schema, simplifying debugging and maintaining effective automated tests.
  • Inversion of control: No need for complex coding for communication between services, which can reduce the microservice codebase by 30 to 50%. Declarative descriptions in the schema replace complex communication code.
  • Enhanced front end: Apollo Federation provides a more flexible structure and connections. The new API structure eliminates the need for multiple back-end calls, allowing more efficient data retrieval with a single query.
  • Declarative language for entity connections: Connections between entities in independent microservices are described at the GraphQL schema level.
  • Smooth client interaction: Clients interact with the federated schema as if it were a monolithic one.
  • In-built validation: In-built tools allow to validate changes at the GraphQL schema levels and prevent back dependency issues for clients when releasing new version of services.

New Possibilities

The migration to Apollo Federation has opened new avenues for Hotelplan, such as:

  • Directly transforming content graphs in the CMS to be accessible via API without intermediary services.
  • Deploying a flexible automation API framework to write operational automated tests for all tenants and generate documents for Apollo queries.
  • Implementing best practices of DevOps and SRE, including testing, log processing, service monitoring, and streamlined release delivery to end users.

All the parties involved are looking forward to the upcoming migration instances. We are confident that the transition will go without a hitch thanks to the technical foundation we’ve been building during the project.