Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
One day you decided to give GraphQL a try and implement an API of your new application using GraphQL. You deployed the app to production, but after a while, you realized, that responses are not super fast. How to find out what makes your GraphQL endpoint slow? We’ll discuss how queries are executed and what makes processing slower. After that, we’ll learn how to measure performance in the GraphQL era and determine the part we should improve. Finally, we’ll discuss possible solutions and some advanced technics to keep your GraphQL app fast!
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
## Summary of 'Building High-Performance GraphQL APIs' In this presentation, Dmitry Tsepelev discusses improving the performance of GraphQL APIs specifically aimed at an audience already using GraphQL in production environments. He outlines common issues that may lead to slow responses and shares methods for diagnosing and enhancing performance. ### Key Points: - **Understanding Query Execution**: - GraphQL queries are string-based and go through several stages of processing when handled by a server, including parsing, validating, and executing queries. - **Measuring Performance**: - Performance measurement is essential before optimization. Tools like New Relic can track query performance, but GraphQL specifics require additional setup such as utilizing the 'tracer' feature in Ruby GraphQL to monitor slow queries effectively. - **Identifying Bottlenecks**: - Common performance issues include parsing efficiency and response building speed. Smaller and simpler queries are preferable to facilitate quick parsing, while excessive response sizes can lead to slowdowns. - **Dealing with N+1 Problem**: - This problem arises in scenarios where associations aren’t eagerly loaded, leading to multiple queries for related data. Solutions include eager loading associations using methods like ‘includes’ and employing lazy preloading techniques. - **Caching Strategies**: - Advanced methods such as HTTP caching, ETags, and Apollo Persisted Queries can enhance performance. For instance, switching from POST to GET for certain queries allows for traditional caching methods to be applied effectively. - **Practical Examples**: - Tsepelev provides examples, like discovering that slow price conversion queries were improved simply by reducing unnecessary data in Redis. He emphasizes the importance of client headers for maintaining performance insights in evolving applications. - **Continuous Improvement**: - Regularly updating to the latest versions of GraphQL libraries is crucial as updates typically include performance enhancements. ### Conclusions and Takeaways: 1. **Monitoring Setup is Critical**: Performance monitoring must be configured initially to effectively address potential issues. 2. **Simplifying Queries**: Reducing the complexity and size of queries can yield substantial improvements. 3. **Addressing N+1 Issues**: Implementing effective loading strategies for associations is key to avoiding performance pitfalls. 4. **Utilizing Caching**: Implementing caching solutions tailored for GraphQL can lead to significant performance gains. Dmitry concludes by encouraging continuous evaluation and adaptation of strategies to keep GraphQL APIs performing optimally.
Suggest modifications
Cancel