The majority of on-prem applications built in the last 10 to 15 years are developed with n-tier architecture style that would typically consist of presentation tier, business tier, data access tier and integration tier. These would all get bundled into a single deployment package and get deployed on each computer/server, and this would require more compute resources like CPU and memory to run all the tiers. Depending on the complexity of the logic or the volume of data to be processed, each tier would require different levels of CPU and memory, and the tiers would start competing for compute resources. In such cases, more high-capacity servers needed to be added to handle the workload, instead of being able to run each tier in a separate server. In order to simplify some of these challenges, Service Oriented Architecture (SOA) was introduced, where different tiers would be hosted as web services running on different servers, but they had their own challenges and limitations.
A new breed of REST APIs was created to address these issues and to meet the needs of ever-growing mobile devices and Internet of Things (IoT) devices that need light-weight APIs that can respond in micro-seconds and to enable broader enterprise systems integrations. These REST APIs simplify integration and security, and have much smaller payload using JSON format compared to earlier versions of SOAP/XML based SOA web services.
These REST APIs also allowed us to look at big monolithic and n-tier systems in a different way. All the tiers can be split vertically by each business/functional domain and exposed as tiny sets of APIs called microservices. These microservices can be consumed by any application/device in a secure way.
This split-up into smaller set of APIs makes it easy to build, test and deploy into separate servers, virtual machines or as docker containers, and scale them independently from other tiers based on the workload by automatically adding/removing additional compute resources.
The API and microservice patterns became the foundation of the cloud technology implementation that can efficiently use the cloud compute resources to scale-out and scale-in as needed to keep optimal performance. To simplify the configuration, security and management of APIs, cloud platform providers have built API gateways that allows API admins to configure many traditional web services, REST APIs and cloud native services and expose them through API gateways and secure them with API keys and other advanced options.