Web Development Deployment 3 — Questions and Answers
Question 1: What is a rolling deployment?
- Replacing all instances simultaneously with a new version
- Updating instances incrementally, a few at a time, while keeping others live (Correct answer)
- Rolling back to the previous version automatically on error
- Deploying to a single region first and rolling out globally later
Correct answer: Updating instances incrementally, a few at a time, while keeping others live
Rolling deployments replace old instances with new ones gradually, maintaining availability throughout the process.
Question 2: What environment variable naming convention is widely used to distinguish deployment targets?
- APP_TARGET=prod
- NODE_ENV=production (Correct answer)
- DEPLOY_MODE=live
- ENV_TYPE=release
Correct answer: NODE_ENV=production
NODE_ENV=production is the de facto standard used by Node.js frameworks and bundlers to enable production optimizations.
Question 3: Which tool is commonly used for container orchestration at scale?
- Docker Compose
- Kubernetes (Correct answer)
- Vagrant
- Ansible
Correct answer: Kubernetes
Kubernetes automates deployment, scaling, and management of containerized applications across clusters of machines.
Question 4: What does a .dockerignore file do?
- Prevents Docker from starting on certain OS versions
- Excludes files and directories from the Docker build context (Correct answer)
- Disables specific Docker CLI commands
- Lists approved base images for the project
Correct answer: Excludes files and directories from the Docker build context
.dockerignore excludes paths from being sent to the Docker daemon during build, reducing image size and build time.
Question 5: In GitHub Actions, what triggers a workflow defined with `on: push: branches: [main]`?
- Any push to any branch in the repository
- Only pull requests targeting the main branch
- Any commit pushed directly to the main branch (Correct answer)
- Manual workflow dispatch from the Actions tab
Correct answer: Any commit pushed directly to the main branch
This configuration runs the workflow whenever commits are pushed to the main branch specifically.
Question 6: What is the function of an Nginx reverse proxy in a web deployment?
- Compiling server-side JavaScript before serving it
- Forwarding client requests to backend application servers and returning responses (Correct answer)
- Encrypting database connections between app and database
- Managing DNS records for the deployed domain
Correct answer: Forwarding client requests to backend application servers and returning responses
Nginx as a reverse proxy sits in front of app servers, routing requests, handling SSL, and load balancing.
Question 7: What does 'zero-downtime deployment' mean?
- The deployment runs at midnight when traffic is lowest
- New code is released without making the application unavailable to users (Correct answer)
- The deployment process requires no human intervention
- The server shuts down for exactly zero seconds during updates
Correct answer: New code is released without making the application unavailable to users
Zero-downtime deployment ensures users experience no service interruption while new code is being released.
What is a rolling deployment?