When I created service in Amazon EC2 Container Service, there were 2 options for service type: REPLICA and DAEMON.
What is the exact difference between them?
Replica services place and maintain a desired number of tasks across your cluster. Daemon services place and maintain one copy of your task for each container instance
Your ECS cluster most likely exists out of multiple EC2 instances (= Container instances).
According to the AWS documentation
This means that, if you have an ECS cluster with three EC2 instances and you want to launch a new service with four tasks, the following will happen:
Replica: Your four tasks will start randomly distributed over your container instances. This can be all four on one instance or any other random distribution. This is the use case for normal micro services.
Daemon: For a daemon you do not specify how many tasks you want to run. A daemon service automatically scales depending on the amount of EC2 instances you have. In this case, three. A daemon task is a pattern used when building microservices where a task is deployed onto each instance in a cluster to provide common supporting functionality like logging, monitoring, or backups for the tasks running your application code.