Skip to content

Latest commit

 

History

History
74 lines (53 loc) · 2.29 KB

File metadata and controls

74 lines (53 loc) · 2.29 KB

🚀 GraphQL Server Performance Showdown

Node.js TypeScript GraphQL

Overview

This project provides a comprehensive performance comparison between three widely-used Node.js GraphQL server implementations:

  • ⚡ Fastify + Mercurius
  • 🚅 Fastify + Apollo
  • 🚂 Express + Apollo

🏃‍ Quick Start

# Clone the repository
git clone https://github.com/mypolat/fastify-mercurius_vs_fastify-apollo_vs_express-apollo
cd fastify-mercurius_vs_fastify-apollo_vs_express-apollo

# Install dependencies
npm install

# Build the project
npm run build

# Start all servers
npm run start:all

# Run benchmark tests
npm run test:all

📊 Performance Comparison

Response Time Analysis

Framework Best Average Worst Recommended Use Case
Fastify + Mercurius ~0.6ms ~0.7ms ~1ms High-performance APIs requiring minimal latency
Fastify + Apollo ~4.8ms ~5.1ms ~14ms Balance between features and performance
Express + Apollo ~5.3ms ~15-40ms ~42ms Existing Express.js applications

🎯 Key Findings

Fastify + Mercurius

  • ✨ Best overall performance
  • ⚡ Most consistent response times
  • 🔥 Minimal performance degradation under load
  • 👍 Recommended for high-performance GraphQL APIs
  • ⚠️ Limited ecosystem compared to Apollo

Fastify + Apollo

  • ✅ Good balance of performance and features
  • ⚡ ~7x slower than Mercurius
  • 🔥 ~3x faster than Express+Apollo
  • 👍 Rich Apollo ecosystem available
  • 📈 Excellent monitoring capabilities

Express + Apollo

  • ✅ Most widely adopted combination
  • ⚠️ Higher response times
  • ⚠️ Significant performance variance
  • 🔄 Mature ecosystem
  • 📚 Extensive documentation and community support

⭐ If you found this benchmark helpful, please consider giving it a star!