Fly.ioTutorial
Run Apollo Server Close to Your Users
Summary
Run Apollo Server Close to Your Users presents an edge deployment pattern for GraphQL APIs. The post argues that, much like serving JavaScript and markup from a CDN, placing API servers and an application cache near users can improve application speed. Its approach combines Fly.io’s platform for running API servers close to users with a global Redis cache service, then uses Apollo Server’s cache capabilities and first-class Redis support. A demo GraphQL API built from the Open Library REST API accompanies the guide, with both a guide and source code available. The author frames the design through a newly adopted GraphQL perspective, emphasizing static typing and describing the resulting setup as CDN-like infrastructure for an API.
Context
The post applies the idea of pushing application content close to users to GraphQL APIs, arguing that nearby API servers and an application cache can provide a speed boost.
Approach / What changed
It pairs Fly.io’s platform for running API servers close to users with a global Redis cache service and Apollo Server’s cache capabilities and first-class Redis support. A demo API based on the Open Library REST API illustrates the setup.
Takeaways
The proposed architecture treats an edge GraphQL API similarly to CDN-delivered application content by locating both servers and cache near users.
Apollo Server is presented as a fit for the setup because it has cache capabilities and first-class Redis support.
The demonstration uses a GraphQL API based on the Open Library REST API, with a guide and source code provided.
Source and freshness
- Source
- fly.io
- Published
- Added to Yomu
- Last updated
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.