In contrast, serverless architecture apps are launched only as needed as an event triggers app code to run. The public cloud provider then allocates resources specific for that operation to take place. The user stops paying when the code finishes executing.
By way of example, if one was to create a food delivery app under an IaaS setup – cloud providers would charge a flat rate to ensure the solution was available 24/7. However if there was a spike in orders, perhaps due to a lockdown situation – DevOps would need to make sure the app could scale accordingly.
Under a serverless model – the app would have negligible charges during off-peak hours (early morning) & during surges in traffic it could scale openly via the provider without DevOps needing to get involved