Home / Companies / Wundergraph / Blog / January 2024

January 2024 Summaries

8 posts from Wundergraph

Filter
Month: Year:
Post Summaries Back to Blog
Cosmo Router has added field-level authorization for GraphQL Federation, allowing developers to use a policy-as-code workflow to control access to their federated APIs. This feature enables teams to define granular access control policies and improves transparency, security, and compliance. It also allows for the merging of scopes across Subgraphs and enables features like returning partial data or failing the whole request if an agent doesn't have the required scopes. The Cosmo Router is now the most advanced Open Source GraphQL Federation Router available today, with a formal specification being developed to define the behavior of Federation directives and their interaction with each other. To get started with field-level authorization, developers can follow the Cosmo Documentation for the added directives `@requiresScopes` and `@authenticated`.
Jan 30, 2024 2,554 words in the original blog post.
The Cosmo Router has added field-level authorization to its Open Source GraphQL Federation Router. This feature allows teams to define their Subgraph Schemas independently, including their security policies, and enables a policy-as-code workflow for controlling access to federated GraphQL APIs. The router uses a matrix multiplication approach to merge scopes across Subgraphs, providing a more secure and auditable way of managing authorization logic. With this feature, developers can ensure that their Subgraphs implement security policies correctly, without unknowingly disabling the intended policy of another team. The Cosmo Router is now available in its latest version, with no special license required for this feature.
Jan 30, 2024 2,579 words in the original blog post.
Cosmo Router is an Open Source GraphQL API Gateway that implements the GraphQL Federation specification, allowing multiple GraphQL APIs to be combined into a unified Graph using GraphQL Federation. The Cosmo Router integrates Subgraphs, which are managed by separate teams and can support requests over HTTP and subscriptions over WebSockets via SSE. To ensure seamless end-to-end functionality, correctness, and superior system performance, the team developed an integration testing framework that abstracts away complexity and ensures deterministic and reproducible tests for distributed systems like Cosmo Router. The framework uses gqlgen to implement Subgraphs and run them in the same process as tests, allowing for debugging into Subgraphs if necessary, NATS for Event-Driven Federated Subscriptions, and the testserver provided by NATS to define test cases. The team also implemented features such as parallel testing, counter-based assertions, and deterministic tracing to ensure fast, easy-to-write, and easy-to-debug tests that meet the requirements of a complex system like Cosmo Router.
Jan 26, 2024 3,557 words in the original blog post.
The Cosmo Serverless GraphQL Federation Router for AWS Lambda is a new release that marks a significant milestone in the GraphQL community. This router acts as a single access point to aggregate data from multiple sources, providing a unified GraphQL schema and streamlining query processing and schema management. The router is built using AWS Lambda, which provides a serverless computing service that simplifies concerns about server provisioning, scaling, and infrastructure management. The Cosmo Router has been optimized for small footprint and fast cold starts, with a binary size of 19MB. It also features built-in support for OpenTelemetry for tracing and metrics, as well as schema usage data to provide insights into schema changes. The router performs well on AWS Lambda, handling requests with a p95 time of 480ms and scaling well with 100 concurrent users over a period of 60 seconds. The source code is available on GitHub, and the router can be easily deployed using SAM CLI or the AWS console. This release makes it simple to deploy, operate, and scale a GraphQL Federation Router / Gateway on AWS Lambda.
Jan 22, 2024 1,291 words in the original blog post.
This summary highlights the key points of the text, which discusses implementing GraphQL Subscriptions in Go using Epoll and an event-driven architecture. The author initially implemented a naive approach that was sufficient for the first iteration but had limitations, including creating 4 goroutines per client and Subscription, allocating excessive memory, blocking in the ServeHTTP method, and blocking to read from the connection. To address these issues, the author introduced an event-driven architecture using Epoll/Kqueue, which reduced the number of goroutines by 99% and memory consumption by 90%. The optimized implementation uses a thread pool to handle events, limits concurrent updates, and reuses tools efficiently. The changes were validated using pprof, and the author concludes that the new implementation is fast, efficient, and maintainable.
Jan 18, 2024 2,913 words in the original blog post.
EDFS - Event Driven Federated Subscriptions is a new feature introduced by Cosmo that allows for the combination of Federation, Entities and Subgraphs with an Event-Driven Architecture. This enables the creation of stateless Subgraphs, eliminates the need for a single root field ownership, and leverages Epoll/Kqueue to handle tens of thousands of Subscriptions with a small number of threads and buffers. EDFS makes Subscriptions more efficient and scalable by delegating handling to the operating system, reducing resource consumption and allowing for better scalability across multiple CPU cores when publishing events. It is designed to bridge the gap between Federated GraphQL and Event-Driven Architectures, enabling teams to work independently while still achieving real-time applications capabilities.
Jan 16, 2024 2,575 words in the original blog post.
The Cosmo Router is a fully open-source Federation V1/V2 compatible router that supports event-driven subscriptions in federated GraphQL. Unlike traditional WebSocket connections, which can be complex to implement and have drawbacks such as statefulness, inefficiency, and compatibility issues with enterprise environments, the Cosmo Router provides an alternative solution using Server-sent Events (SSE). SSE connections are stateless, making them more efficient and compatible with enterprise environments. The Cosmo Router supports three protocols: graphql-ws, Server-Sent Events (SSE), and subscriptions-transport-ws. It enables real-time data updates, reduces network overhead, and improves performance by minimizing the number of connections and state information required. Additionally, it allows for self-hosting, scalability, and serverless deployments, making it an ideal solution for enterprise environments.
Jan 11, 2024 1,928 words in the original blog post.
Field-level metrics in federated GraphQL are crucial for optimizing data fetching strategies, minimizing downtime, allocating resources efficiently, and making informed decisions about system performance. In a federated architecture, each subgraph is independent, but field-level metrics provide detailed insight into how often specific fields across different subgraphs are requested in queries. This information enables proactive optimization, faster debugging of issues, and better decision-making on infrastructure costs, scalability, and resource allocation. The use of Cosmo, an open-source platform for GraphQL Federation, provides a suite of analytics tools to track field-level metrics, including usage numbers, timestamps, and histograms, allowing organizations to evolve their federated architecture and deliver a better product. By analyzing these metrics, teams can identify underutilized fields, optimize content strategy, personalize experiences, and inform data model decisions.
Jan 03, 2024 1,624 words in the original blog post.