Optimizing performance in Rails apps with GraphQL layer
summary
A production Rails API running GraphQL since 2016 uses concrete measures: add Honeycomb/OpenTelemetry tracing to break request time into parse/validate/execute and DB spans; write CI assert_queries tests to catch regressions; fix N+1 with graphql-batch and batch-loader and use graphql-preload or graphql-ruby lookahead to selective preload; apply a custom event-driven fragment cache for costly fields; enable max_depth, per-query timeouts and query batching (multiplex) — these changes reduce DB queries and surface hotspots in monitoring.
AI-written summary · about
chapters (6)
- 0:00Introduction and background
- 16:49Performance testing strategies
- 27:38Monitoring GraphQL performance
- 34:51Solving N+1 query problems
- 41:26Handling concurrency and batching
- 46:25Key takeaways and conclusion
related talks
27mGraphQL on Rails
25mOptimizing GraphQL Applications
24mOptimizing for API Consumers with GraphQL
26mBuild a performance-optimized GraphQL API
41mThe GraphQL Way: A new path for JSON APIs
27mGraphQL and Rails beyond HTTP APIs
36mGraphQL on Rails - Creating Living APIs for a Data-hungry World
23mAugmenting a Legacy REST API with GraphQL
