Vous êtes sur la page 1sur 8

.

Cloud Computing
Serverless Architecture
What is Serverless Architecture?
Serverless – a fancy word to hear These functions can start in very less time and can
especially when we have countless be executed anywhere, and after execution, they can
options for containers and servers be stopped, and resources are free in comparison to
available to choose from for application microservices where we have to keep them running
deployment. All this started with for long. One good example of serverless architecture
physical servers where one had to go or FaaS is AWS Lambda, and we will discuss it here
manually deploy the code on virtual in a while.
machines, where anyone can deploy or
recover it irrespective of geographical There is another perspective of serverless architecture
presence. Now we have containers which is BaaS (Backend as a Service), here in this model
with swift deployment times, higher application will call these cloud services via some API
availability, and recoverability. When all or connection or SDKs and use the capabilities in the
these capabilities are available with an application without actually implementing it. BaaS based
architecture having a server, then why services have their storage, code, file management, user
do we need Serverless at all and does it management and they also have their APIs which allows
mean “NO SERVER”? outside applications to integrate with them using these
APIs. Some BaaS even has a UI in between, so calling
Serverless architecture does not mean application has to handle this part and application which
that it can be executed sans server but it is calling BaaS also need to consider that most of these
is a service on its own, and it also means BaaS come with some contractual agreement made with
that developer no longer has to worry the vendor. This is a downside of BaaS since that will be
about the server on which code will having impacts in case if we like to move to another similar
get executed. Serverless architectures feature providing BaaS.
refer to applications that significantly
depend on third-party services (knows So, far we have discussed what serverless architecture
as backend as a Service or “BaaS”) or and FaaS and BaaS techniques which are based on this
on custom code that’s run in ephemeral architecture is. Now we will take a look at different
containers (Function as a Service or cloud vendors and what they are offering in Serverless
“FaaS”). Since it functions on its own, Architecture space.
it is often called as Faas(Function as a
Service), and serverless also means that
the organization need not purchase,
rent or provision servers.The need
to depend on virtual machines to
develop and deploy the code is no
more there. Instead, organizations can
build functions and trigger them based
on events. We can also understand
serverless architecture by comparing it
to a traditional microservice architecture
where large enterprise applications are
broken down into smaller services, and
then these services can be enhanced,
managed and scaled independently.
Now with the serverless architecture,
this is further be divided into functions.
Microsoft Azure - Serverless Architecture

Microsoft Azure is cloud computing service developed Azure Functions are capable of
and owned by Microsoft. Azure is used for building, integrating with different Azure services
testing, deploying and managing applications/services or even 3rd party services like GitHub
in the cloud through Microsoft managed data centers. or Twilio(communication services API).
In Serverless computing world, Microsoft Azure has By integrating means that these services
developed a feature called Azure Functions. Azure can trigger or can be used as providing
Functions are a small piece of code, or we can call it as a data to the Azure Functions.Azure
function which can be executed in cloud infrastructure. Functions support dependencies as well,
The way Azure Functions work is that developer will so while writing functions which have
create a function or piece of code without worrying some dependencies, Azure Functions are
about infrastructure and scalability. To create functions, capable of bringing these dependencies
a developer can choose languages like PHP, Python, while execution, common examples of
Java, and Node.js, etc. which is excellent as we no longer dependencies are NuGet and NPM. If you
need to worry about which programming language a look at pricing wise, Azure Functions are
developer can choose. only be charged for time duration they
are executing and the resources which are
Azure Functions can be used to do lots of prevalent used in executing these Functions.
scenarios which we perform in any enterprise
applications, some of these scenarios are executing Scalability is also not a concern since that
a batch process, calling an HTTP method, processing will be managed by cloud infrastructure
related to messaging infrastructures like queues or where your function will get executed.
topics can also be used to trigger a timer task based
on certain events. Azure functions can also support So, in a nutshell, Azure Functions are
web hooks, like for example if a code checked into a the perfect example of Serverless
GitHub repository, an Azure Function can be written to Computing where a developer can create
track that event and do some operation based on that any functions without worrying about
event which happened in GitHub repository so saying infrastructure or server where it will get
that Azure Functions can do data processing, help in executed and they can be very easily
integrating different systems, creating simple HTTP APIs deployed in Azure App Service platform
is a correct statement. in the cloud.
Google Cloud Platform - Serverless Architecture

Similar to Microsoft Azure Functions, Google also Google Cloud Functions can also be triggered
has come up with a feature called Google Cloud on HTTP/S, and this capability makes them
Functions in the space of Serverless Architecture. As more compelling since with this they also are
per the official documentation released by Google, integrated with API gateways or even web
Google Cloud Functions are lightweight, event-based hooks. Google Cloud Functions comes up with
and asynchronous. They allow developers to create a a local emulator which developer can use to
single small function which can be triggered based test function in local before actually deploying
on an event or this function could also possibly the function to cloud, also if a function has any
respond to an event, and again here this function can dependency, then it can be resolved by running
be developed and deployed without worrying about npm install in the cloud which can bring in
a server or a runtime environment. all the dependencies needed to execute the
cloud function.
Google Cloud Functions are written in Javascript,
and they can be executed in a NodeJS runtime or As far as scaling is concerned, we need not
environment in Google Cloud. Since it is written in worry when executing functions since Google
easy executable Javascript, it makes it portable and Cloud Platform manages it. A function can
testable. scale from a single execution a day to millions
of executions and for that developer does not
Google Cloud Functions are provided with a capability have to do anything, yes, of course, function
of easy integration with other Google Cloud Services execution will be billed as per the resources
like Google Cloud Storage, Google Cloud Pub/Sub, and time it takes to execute the function on
Google Cloud Dataflow, etc. An example of this would the cloud.
be, Google Cloud Function can be triggered based
on file upload in Google Cloud Storage, or it can be So, these cloud functions are capable of
triggered if some message is received on Pub/Sub integrating with all cloud services of Google
topic. Google Cloud Functions can also access the Cloud Platform, these are secure, easy to write,
authentication services of Google Cloud Platform so test and integrate and at the same time can be
no need to worry about any Google Cloud Function scaled as per the usage needs and frequency
getting unauthorized access or executed on the and these all together makes them a perfect
wrong resource. example of Serverless Architecture.
Amazon Web Services – Serverless Architecture

AWS defines Lambda as “AWS Lambda lets you AWS Lambda can easily be integrated with other
run code without provisioning servers. One pays AWS services like AWS API Gateway, Simple Storage
only for the compute time consumed - there is Service (S3), Kinesis, Athena or even with Dynamo
no charge when your code is not running. With DB. Due to this easy integration, AWS Lambda can
Lambda, one can run code for virtually any type be used in wide variety of applications like mobile,
of application or backend service with almost no desktop or even in data processing or analytics
administration. application; it can also be used with IoT backend.
Zillow, Localytics, Bustle and many other big and
Just upload your code and Lambda takes care of successful products are using AWS Lambda.
everything required to run and scale your code
with high availability. One can set up the code to Node.js, Java, C#, and Python are supported
automatically trigger from other AWS services by AWS Lambda which means a code can be
or call it directly from any web or mobile app. written in any of these programming languages
This indicates that this AWS service is a perfect and then can be executed as Lambda function
example of Serverless Architecture since it is all in the cloud on event triggers. AWS Lambda
code but no infrastructure. comes up with versioning and aliases so you can
always keep different versions of a single lambda
AWS Lambda is one of most famous and widely function and it can easily be monitored, logged
used service in Serverless Architecture space. and troubleshoot through AWS’s Cloud Watch.
No server management, flexible scaling, high There are certain limits regarding how much a
availability and no idle capacity or no cost when single lambda function can process request and
idle are key advantages of AWS Lambda which is response, and that can be looked in AWS Console.
no different than advantages provided by other
cloud players.
AWS – Serverless Web Architecture

BaaS - reduced development cost Scaling benefits of FaaS


IaaS and PaaS are based on the assumption that In the previous section we discussed scaling,
server and operating system management can be it’s important noting the scaling functionality of
commoditized. Serverless Backend as a Service, is FaaS not only reduces compute cost but it also
a result of entire application components being reduces operational management because the
commoditized. scaling is automatic.

FaaS - scaling costs Reduced packaging and deployment


With serverless FaaS horizontal scaling is completely complexity
automatic, elastic, and managed by the provider. While API gateways are quite complex, the act
There are several benefits, and the biggest benefit of packaging and deploying a FaaS function is
is on the basic infrastructural side, where you only pretty simple compared to implementing an
pay for the compute that you need. entire server. All you’re doing is compiling and
zip’ing / jar’ing your code, and then uploading
Easier Operational Management it. No puppet/chef, no start/stop shell scripts,
On the Serverless BaaS side, of the fence it’s obvious no decisions on deploying one or many
why operational management is simpler than other containers on a machine.
architectures: fewer components that you support Serverless architectures have a lot of promise
equals less work. in them, but they come with significant trade-
On the FaaS side there are some aspects of play offs drawbacks.
though, let’s dig into a couple of them.
Vendor control Loss of Server optimizations
In any outsourcing strategy, you are giving up Again with a ‘full BaaS’ architecture, there is
control of some of your systems to a 3rd-party hardly any opportunity to optimize server-
vendor. Lack of control can manifest as system design for client performance. The ‘Backend
downtime, unexpected limits, cost changes, loss For Frontend’ pattern exists to abstract certain
of functionality, forced API upgrades, and more. underlying aspects of the whole system within
the server partly, so that the client can perform
Multitenancy Problems operations more quickly and use less battery
Multitenancy is a strategy to achieve the economy power in the case of mobile applications. Such a
of scale benefits as earlier. Service vendors try their pattern is not available for ‘full BaaS.’
best to convinces customers that they are the only Serverless, despite the confusing name, is a style
ones using their system and usually good service of architecture where we rely to a smaller extent
vendors do a great job doing that. But sometimes than usual on running our server-side systems
multitenant solutions have challenges with security as part of our applications. It is done through
(one customer being able to see another’s data), two techniques - Backend as a Service (BaaS),
robustness (an error in one customer’s software where third-party remote applications services
causing a failure in a different customer’s software) are tightly integrated into the front-end of our
and performance (a high load customer causing apps, and Functions as a Service (FaaS), which
slow down in another.) moves server-side code from long-running
components to ephemeral function instances.
Vendor lock-in
It’s very likely that Serverless features offered by Serverless is not the only approach to every
one vendor will differ from another vendor and will problem, so be careful of anybody who says
be implemented differently by them. For switching it will replace all of our existing architectures.
vendors you’ll almost certainly need to update While there are benefits (of scaling and saved
operational tools (deployment, monitoring, etc.), deployment effort), there also are drawbacks (for
probably need to change your code, and you may debugging, monitoring) lurking right around
even need to change your design or architecture the next corner.
if there are differences in how competing vendor There are significant positive aspects of
implementations behave. Serverless Architecture, including lower
operational and development costs, efficient
Security concerns
operational management, and reduced
This deserves an article in and of itself but environmental impact. The most important
embracing a Serverless approach opens you up to benefit is the reduced feedback loop of creating
a large number of security questions. new application components, and the reduced
time-to-market.
Repetition of logic across client platforms
In conclusion, serverless platforms today are
With a ‘full BaaS’ architecture, need for writing
used for critical tasks, where high-throughput is
custom logic on the server-side is not there- it’s all
key and where individual requests are completed
on the client. This works well for first client platform,
in a relatively short time. The economics of
but as soon as you need your next platform, you
hosting such tasks in a serverless environment
will need to repeat the implementation of a subset
make it a compelling way to reduce hosting
of that logic that you wouldn’t have done in a
costs significantly and to speed up the time to
more traditional architecture.
market for the delivery of new features.
For more information contact YASH today
at info@yash.com or visit www.yash.com

About YASH Technologies


YASH Technologies focuses on customer success. As a leading technology services and outsourcing partner for large and fast growing
global customers, the company leverages technology and flexible business models to drive innovation and value throughout its customer’s
enterprise. YASH customer centric engagement and delivery framework integrates specialized domain and consulting capabilities with
proprietary methodologies and solution offerings to provision application, infrastructure and end user focused Right-Sourcing services.
YASH is a SEI CMMI (Level 5) and an ISO 9001:2015 certified company with U.S. and India headquarters and regional sales and development
YASH-Serverless-Architect-WP-0118

offices globally with customers spread across 6 continents.

YASH Technologies Global Presence www.yash.com/contactus


AMERICAS | EUROPE | APAC | MEA

World HQ: 605-17th Avenue East Moline IL 61244 USA | Toll Free: 877-766-8934 | Tel: 309-755-0433 | Fax: 309-796-1242 .

© 2018 YASH Technologies. All rights reserved. Referred products/ services may be registered trademarks of belonging companies.

Vous aimerez peut-être aussi