Monolithic applications are applications that are deployed as a single executable unit or a package (for example, deployment archive). Enterprise applications are often built in three main parts, which are as follows:
- frontend
- middle-tier / server-side-code
- backend (database)
The server-side code (internally designed as a layered architecture but) is a single logical executable unit, and often, a single process. Any change to the application needs to build and deploy the whole server-side part to the production server.
Monolithic applications can scale horizontally by replicating the whole server-side application instance into multiple servers or VMs. Therefore, scaling requires scaling of the entire application instead of the part of application that needs extra resources.
Microservices architecture divides applications into a number of autonomous microservices. Each microservice is a self-contained package of all code along with its data without unmanaged external dependencies. Microservices scales out by deploying them independently, and replicating them across servers, VMs, or containers: