Security, Performance & Deployment Flashcards
OWASP Top 10 for Node.js Helmet, Rate Limiting Clustering, Load Balancing CI/CD, Docker, PM2 Performance Monitoring (New Relic, Prometheus) (52 cards)
What is the OWASP Top 10?
The OWASP Top 10 is a list of the most critical web application security risks, such as Injection, Broken Authentication, and Cross-Site Scripting (XSS).
What is Helmet in Node.js?
Helmet is a middleware for Express that sets various HTTP headers to secure apps from common web vulnerabilities.
What is rate limiting in Express apps?
Rate limiting controls the number of requests a client can make to an API within a time window to prevent abuse or DoS attacks.
What is clustering in Node.js?
Clustering is a technique that allows Node.js to spawn multiple processes (workers) to handle concurrent connections on multicore systems.
What is a load balancer?
A load balancer distributes incoming traffic across multiple servers or instances to enhance reliability and performance.
What is CI/CD?
CI/CD (Continuous Integration/Continuous Deployment) automates code testing and deployment to improve software delivery efficiency and reliability.
What is Docker?
Docker is a platform that uses containers to run software consistently across environments by packaging code with dependencies.
What is PM2 in Node.js?
PM2 is a production-grade process manager for Node.js applications that enables monitoring, clustering, and zero-downtime restarts.
What is New Relic used for?
New Relic is an APM (Application Performance Monitoring) tool that tracks performance metrics, errors, and transactions in real time.
What is Prometheus used for?
Prometheus is an open-source monitoring system that collects metrics from applications and supports alerting and visualization.
What are the advantages of using Helmet?
Helmet is simple to use, improves default security posture, and mitigates common attacks like clickjacking and MIME sniffing.
What are the disadvantages of rate limiting?
If misconfigured, it can block legitimate users or degrade user experience during traffic spikes.
What are best practices for Node.js security?
Use Helmet, validate input, sanitize data, use HTTPS, manage dependencies, and follow OWASP guidelines.
What is a use case for Docker in Node.js apps?
Running a Node.js app in the same environment across development, testing, and production systems.
What is the impact of load balancing on system design?
It requires stateless services or external session storage and affects how services scale and failover.
How does clustering improve performance?
It allows better CPU utilization on multicore machines, increasing throughput and responsiveness.
What is a CI/CD pipeline example?
GitHub Actions or Jenkins running tests, building a Docker image, and deploying to a server or Kubernetes cluster.
What is the architectural implication of using PM2?
Enables zero-downtime deployments, process monitoring, and simplified log management in production.
What is a performance benefit of Docker?
Isolated environments reduce conflicts, and container startup is faster than virtual machines.
What is a fault tolerance advantage of clustering?
If one worker crashes, others continue to handle requests, reducing total application downtime.
What is a monitoring best practice for production apps?
Track metrics like response time, error rate, memory usage, and use alerting tools like New Relic or Prometheus.
What is a real-world tradeoff with Docker?
It adds an extra layer of complexity and may consume more resources than native environments in some cases.
What’s a potential gotcha with rate limiting?
Clients behind the same IP (e.g., proxies) may get unfairly rate-limited if IP-based logic is used.
What’s a common interview question about OWASP?
Can you explain some OWASP Top 10 risks and how to prevent them in Node.js applications?