Published on

The Cosmo Router: Next-Gen GraphQL Federated Router

Authors
  • avatar
    Name
    Andrew Blase
    Twitter

Introduction

In the dynamic world of technology, GraphQL has emerged as a revolutionary data query language. But GraphQL at scale requires routing — directing queries across multiple subgraphs efficiently. This brings us to the Cosmo Router, a new entrant that promises speed, efficiency, and open-source capabilities.

Cosmo Router

Understanding the Basics

What is a Router in GraphQL?

In the simplest terms, a router in GraphQL acts as a manager that directs queries to the appropriate places, ensuring a smooth flow of data. In federated architectures, the router is the single entry point that understands the entire supergraph and routes each field to the correct subgraph.

When we talk about GraphQL routers, the Apollo Router has been a popular choice. However, the Cosmo Router comes with its own set of unique features, promising to be faster and more efficient.

Architecture

The Cosmo Router comprises three main components:

  • Control Plane: The brain of the operation, overseeing and managing the various functions.
  • Registry: Where all the data schemas are stored, acting as a reference point for data queries.
  • Router: The high-performance execution layer that handles incoming queries.

For context on the broader Cosmo ecosystem, see the WunderGraph Cosmo introduction.

Features and Functionalities

Label Matcher and Federated Graphs

The Cosmo Router introduces the concept of label matcher, a feature that allows for efficient management of federated graphs — routing queries based on labels assigned to subgraphs.

Self-Hostability

One of the standout features of the Cosmo Router is its self-hostability. This means that businesses have the flexibility to run the router on their own infrastructure, giving them full control over their data and operations.

Performance Benchmarks

When it comes to performance, the Cosmo Router benchmarks at approximately 10x faster than the Apollo Router. This performance advantage is critical in enterprise environments where latency directly impacts user experience.

Conclusion

The Cosmo Router stands as a promising contender in the GraphQL space, offering speed, efficiency, and a range of features that make it a worthy choice for businesses managing GraphQL services at scale.

Next, read about WunderGraph Cosmo's open federation support — how it maintains compatibility with Apollo Federation v1 and v2 while remaining open source.

Stay current on WunderGraph Cosmo updates.