This project provides a comprehensive performance comparison between three widely-used Node.js GraphQL server implementations:
- ⚡ Fastify + Mercurius
- 🚅 Fastify + Apollo
- 🚂 Express + Apollo
# 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
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 |
- ✨ Best overall performance
- ⚡ Most consistent response times
- 🔥 Minimal performance degradation under load
- 👍 Recommended for high-performance GraphQL APIs
⚠️ Limited ecosystem compared to Apollo
- ✅ Good balance of performance and features
- ⚡ ~7x slower than Mercurius
- 🔥 ~3x faster than Express+Apollo
- 👍 Rich Apollo ecosystem available
- 📈 Excellent monitoring capabilities
- ✅ 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!