Layers represent a functional part of an application. For our three-tier application, the stack would have the following three layers:
- A load balancer layer
- A web frontend layer
- A database layer
Each layer is required to have an instance assigned to it, and each instance is required to be a part of one or multiple layers within OpsWorks. We can assign an instance to multiple layers to reduce the cost of the service we are running. For example, in a development stack, we might assign only one instance to all of the layers as the software development process would only require a functional environment, not a complete replica of the production setup.