Problem Statement
How do you scale a service in Docker Swarm and what are best practices to follow?
Explanation
You scale a service in Swarm using `docker service update --replicas <N> <service_name>` or at creation `--replicas <N>`. Best practices include: distributing replicas across nodes (avoid single host bottleneck), define resource limits (CPU/memory) to prevent noisy neighbours, monitor cluster state and service health, use update/rollback policies to minimise downtime and ensure version consistency, and use overlay networks for efficient inter-service communication. Preparing for scaling issues shows readiness for real-world deployments.
