Why Placement Groups?
By default, AWS decides where to physically place your EC2 instances. Placement Groups let you control that decision based on your needs — whether you want maximum speed, maximum safety, or large-scale distributed setups.
Types of Placement Groups
1. Cluster
All instances are packed together on the same hardware in a single Availability Zone.
- Pro: Ultra-low latency and high network speed between instances (up to 10 Gbps)
- Con: If the underlying hardware fails, all instances go down together
- Use for: HPC (High Performance Computing), ML training, big data processing jobs
- Trade-off: Speed over safety
2. Spread
Each instance is placed on completely separate hardware — different rack, different power source, different network.
- Pro: Maximum fault isolation — if one rack fails, only that one instance is affected
- Con: Maximum 7 instances per Availability Zone (AWS needs to reserve a unique rack per instance)
- Use for: Critical applications that cannot afford simultaneous failures — RDS, important app servers
- Trade-off: Safety over scale
3. Partition
Instances are divided into groups called partitions. Each partition runs on separate racks, but within a partition you can have many instances.