How do you improve the performance of a Node API?
Model answer
Find the bottleneck first with profiling and monitoring. Common wins: database indexes and projecting fewer fields, caching (in memory or Redis), compression, pagination, avoiding blocking synchronous code, connection pooling, and running several processes. Measure before and after.
Learn this topic
Deploy a MERN App to a VPS with pm2, nginx and HTTPS (Let's Encrypt) in the course MERN Stack Full Course: MongoDB, Express, React and Node.js.
Sign in to add your own answer.