16
Therefore, when considering the cost of running an application in a
traditional cloud environment like EC2 over serverless architectures such
as Lambda or Kinesis, it is important to consider the total cost of running the
application which includes the infrastructure, development, and maintenance
costs, also referred to as the cost to run, cost to achieve, and cost to support
the application. In isolation, each one of these cost components may provide
an incomplete picture of the total cost and a comprehensive comparison across
all three cost components is needed to arrive at an accurate total cost
of ownership (TCO).
Exceptions to the rule
Although there are many benefits of moving to serverless technologies, not
all applications are the right fit for a serverless architecture. It is important to
consciously select your technology stack and configure it in a cost-effective
manner for serverless functions to yield the fully intended benefits. As the
diagram below illustrates:
• Applications with variable capacity and high scalability requirements are
good candidates for serverless
• Applications that spend large amounts of time running, while waiting on an
event to be triggered, will continue paying for their API and other service
calls, thus making them not ideal candidates for serverless
• Serverless is best suited for web, mobile, and IoT apps, real-time analytics,
and data processing
• Serverless may be least suited for long-running or complex computational
tasks, data migrations from relational to NoSQL, applications requiring
significant disc space or RAM, and applications requiring SSH server access.