Serverless Computing - Architectural Considerations & Principles
Serverless Computing - Architectural Considerations & Principles
Serverless Computing –
Architectural
Considerations & Principles
Introduction have also gone down significantly
The last decade has seen tremendous while improving time-to-market for Serverless as a concept is not
innovation in the enterprise IT space. enterprises. new
The primary focus of this technological Amazon launched its cloud
innovation has been enabling Server computing is now evolving storage service (AWS S3)
businesses agility, improve resiliency towards even smaller units of scale – in 2006, which was also
and drive cost efficiencies. from virtual machines to containers a ‘serverless service’ that
to serverless1. The technology provided unlimited storage at
The revolution in the server computing evolution has been depicted below. infinite scale without having to
space over the past decade has maintain servers. However, the
allowed enterprise IT to develop and This thought paper provides a differentiation now is that the
deploy scalable software without vendor neutral summary of industry compute services are becoming
worrying about the underlying recommended principles and key ‘serverless’ thus defining a
infrastructure. At the same time, considerations for architecting new paradigm in software
cost of technology operations serverless systems. architecture.
Virtual
Atomic Unit of Compute Physical Server Containers Functions
Machines
1.
Evolution of Server Computing: VMs to Containers to Serverless — Which to Use When?, Gartner, June 2017
03
Serverless Computing – Architectural Considerations & Principles
2.
Denotes the fact compute resources in serverless disappears immediately after use
3.
Functions are units of deployment or work in serverless computing and contains application or business logic in the form of code which is executed when
a certain event is triggered
04
Serverless Computing – Architectural Considerations & Principles
Function as a Service
Compute
(FaaS)
Database as a Service
Database
(DbaaS)
The three key core technology components of serverless computing stack includes the following:
01 02 03
API Gateway: The API Gateway Functions or Function as a Service Backend as a Service (BaaS): This is
acts as the communication layer (FaaS): This is the layer that executes essentially a cloud based distributed
between the frontend and the FaaS specific business logic (or code) with NoSQL database which essentially
layer. It maps REST API endpoints the cloud provider providing the level removes database administration
with the respective functions that of abstraction in terms of executing overheads.
runs the business logic. With servers the business logic.
out of equation there is no need for
deploying and manage load balancers
also in this model.
4.
Relational databases like SQL are not preferred in a serverless architecture because they have a limit on the number of database connections that can be
opened simultaneously at a time which can result in scalability and performance challenges
05
Serverless Computing – Architectural Considerations & Principles
01
Fully managed service: As iterated earlier, it is a fully managed service provided by the cloud service
providers and the developers doesn’t need to worry about the underlying infrastructure, operating
system, middleware, language runtime and its management and dependencies.
02
Supports event-driven approach: Functions are triggered based on events. Different cloud
services5 and existing applications that supports a trigger mechanism can initiate and launch a
function.
03
Provides infinite scalability and built-in high availability: Depending on the user traffic,
functions scale horizontally in a completely automatic and elastic fashion which is managed by the
cloud service provider.
04
Less-Ops: Serverless doesn’t necessarily mean NoOps6 for the service consumers; however, it can
definitely mean ‘Less-Ops’ as operational tasks like debugging, testing, trouble-shooting etc. remains
while the infrastructure management is fully outsourced to the cloud service provider.
05
Pay for execution time: In a serverless computing model service consumers pay only for the
duration of execution of a function and the number of functions executed. When a function is not
executed no charge is levied – thus eliminating any idle time. This is a significant benefit over cloud
computing where users are charged on an hourly basis for running virtual machines.
5.
F or example, AWS services like S3, DynamoDB, Kinesis Streams, SNS and SES etc. can trigger AWS Lambda function. HTTP triggers either from a REST API
are also supported
6.
No operations is a concept which refers to an IT environment becoming automated to the extent that the underlying infrastructure is abstracted without
need for a dedicated team to manage the same
06
Serverless Computing – Architectural Considerations & Principles
07
Serverless Computing – Architectural Considerations & Principles
In addition, not all application or service can be delivered in a serverless model – we believe the future enterprise IT
landscape will be a hybrid landscape. Hence, to ensure that the optimum architecture is in place, we have outlined
certain architectural considerations that needs to be kept in mind while architecting serverless systems.
7.
Containerization involves splitting applications into small parts, or containers, all sharing the same underlying operating system
8.
For example, AWS Lambda and Azure Functions have maximum execution time (per request) of 300 seconds (i.e. 5 minutes)
9.
For example, AWS Lambda supports CloudWatch and Azure Functions support App Service monitoring
08
Serverless Computing – Architectural Considerations & Principles
Below are some of the industry recommended guiding principles or best practices that can be kept in mind while
architecting serverless systems:
01
function which has a direct impact on cost. In
addition, single purpose codes are easier to test,
deploy and release thus improving enterprise
agility. Finally, even though statelessness may
be perceived as a limitation, it provides infinite
scalability to a platform to handle an increasing
number of requests, which otherwise would not
Design push-based, event-driven
have been possible.
patterns: Designing push-based and
02
event-driven architecture patterns
Create thicker and powerful frontends: where a chain of events propagate
Executing more complex functionality at the without any user input imparts
front-end especially through rich client-side scalability to an architecture.
application framework helps reduce cost by
minimizing function calls and execution times.
03
Completely decoupling back-end logic from the
front-end while not compromising on security is
Incorporate appropriate security
one way of doing. This also allows more services
mechanism across the technology
to be accessed from front-end resulting in
stack: Appropriate security
better application performance and richer user
mechanisms must be incorporated at
experience.
the API Gateway layer and also at the
05
terms of identifying which functions are slowing
down a particular service is critical to ensure
optimal customer experience. Leverage third party services:
Serverless being an emerging field
existing enterprise tools for various
services like logging, monitoring etc.
10.
S erverless: The future of cloud computing by Peter Sbarski, ServerlessConf, 2016
09
Serverless Computing – Architectural Considerations & Principles
Conclusion
With the right architectural legacy monolithic model with the before mainstream adoption happens.
considerations and due diligence, serverless paradigm where the Serverless has the potential to change
serverless may present industry focus isn’t on infrastructure but on the economic model of IT consumption
incumbents with an exit strategy delivering the required business of enterprises leading to significant
to move from legacy infrastructure functionalities which in turn changes cost reductions associated primarily
to adopt public cloud models – this the economic model for IT service with IT support and maintenance
was not observed earlier. However, delivery. (which can be a significant 50 – 60%
industry incumbents will need of the total IT budget of enterprises),
move away from the status-quo and There are concerns though with regard reduce time-to-market and foster
embrace the change. A structured to vendor lock-in and adherence innovation to support changing
approach with a defined roadmap to industry specific compliance business requirements and provide an
is required to move away from requirements in a serverless model. edge over competitors.
the current software architecture Like any emerging technology,
paradigms which is based on the Serverless will go through its cycle
10
Serverless Computing – Architectural Considerations & Principles
11
Contacts
Rakesh Barik
Partner, Technology Consulting Leader
Deloitte Touche Tohmatsu India LLP
E-mail: [email protected]
Anubrata Chakrabarti
Partner, Consulting
Technology Strategy & Architecture
E-mail: [email protected]
Ritesh Pal
Manager, Consulting
Technology Strategy & Architecture
E-mail: [email protected]
Deloitte refers to one or more of Deloitte Touche Tohmatsu Limited, a UK private company
limited by guarantee (“DTTL”), its network of member firms, and their related entities. DTTL
and each of its member firms are legally separate and independent entities. DTTL (also
referred to as “Deloitte Global”) does not provide services to clients. Please see www.deloitte.
com/about for a more detailed description of DTTL and its member firms.
The information contained in this material is meant for internal purposes and use only
among personnel of Deloitte Touche Tohmatsu Limited, its member firms, and their related
entities (collectively, the “Deloitte Network”). The recipient is strictly prohibited from further
circulation of this material. Any breach of this requirement may invite disciplinary action
(which may include dismissal) and/or prosecution. None of the Deloitte Network shall be
responsible for any loss whatsoever sustained by any person who relies on this material.
©2018 Deloitte Touche Tohmatsu India LLP. Member of Deloitte Touche Tohmatsu Limited