Web Application Deployment: Environments, Hosting, CI/CD, Security & Best Practices

1. What is deployment in web development?

Deployment is the process of making a web application or website available to users by transferring it from a local development environment to a production server or hosting platform.

2. Why is deployment important?

3. What is the difference between development, staging, and production environments?

Environment Purpose
Development Local environment for coding and testing new features.
Staging Pre-production environment that mimics production; used for testing deployments.
Production Live environment accessible to users.

4. What are the main types of web hosting for deployment?

5. What are common deployment tools and platforms?

6. What is CI/CD in deployment?

Continuous Integration (CI): Automates testing and building code whenever changes are made.

Continuous Deployment (CD): Automatically deploys tested code to production.

Benefit: Reduces errors, improves speed, and ensures consistent deployments.

7. What is the difference between static and dynamic deployment?

Static Deployment: HTML, CSS, JS files served as-is (no server-side processing).

Dynamic Deployment: Requires server-side code execution (e.g., Node.js, PHP, Python) and often a database connection.

8. How do environment variables work in deployment?

Environment variables store sensitive or environment-specific data (API keys, database URLs) outside the codebase.

REACT_APP_API_KEY=abcdef12345

Keeps credentials secure and allows easy switching between environments.

9. What are the general steps to deploy a web application?

10. How can you deploy a static website on GitHub Pages?

11. How can you deploy a frontend framework (React, Vue, Angular) site?

12. How do you deploy a full-stack app with backend (Node.js, Python, PHP)?

13. What is the role of version control in deployment?

Git ensures code is consistent, trackable, and easy to revert, which simplifies deployment and collaboration.

14. How can you ensure security during deployment?

15. How do you handle scalability in deployment?

16. How can you perform zero-downtime deployment?

Techniques:

17. What is containerization in deployment?

Containerization packages an app with all dependencies into a single container (e.g., Docker).

Ensures consistent environments across development, testing, and production.

Simplifies deployment and scalability.

18. How do you monitor a deployed application?

19. What is rollback in deployment?

Rollback is reverting a deployment to a previous stable version when the new version has bugs or issues.

Essential for maintaining uptime and reliability.

20. Best practices for successful deployment