What is Serverless?

What is Serverless?

Serverless computing is a cloud computing execution model in which the cloud provider runs the server, and dynamically manages the allocation of machine resources.

What does Serverless mean?

Serverless computing is a method of providing backend services on an as-used basis. Servers are still used, but a company that gets backend services from a serverless vendor is charged based on usage, not a fixed amount of bandwidth or number of servers.

                  Who uses Serverless?

  • Netflix- You heard that’s right kids, our favorite past time activity provider is using Serverless to serve 7 billion of video hours to 50 million customers in 60 countries. EVERY. QUARTER. Now while I won’t pretend to understand the intricates of the Netflix infrastructure, I will point out that they rely heavily on AWS Lambda to run tasks that would otherwise take up a lot of computing process and even more time to build. The Chief Product Officer at Netflix had a talk at AWS Re-invent where he spoke about the different ways, they use serverless in order to provide the best on-demand video streaming service out there
  • Codepen which has been around since 2012 and has quickly become a standard for web developers. People use it to share pieces of code and examples that help newcomers get a jump start in their development career. Right now, Codepen servers up to 200 000 requests per hour and while that is impressive, what surprised me is the fact that all their infrastructure is run by a one-man DevOps team. What better way to learn about the wonders of serverless than from the horse’s mouth, to that end, here’s a podcast made by the guys over at codepen.io talking about serverless.
  • Zalora is one of the biggest fashion stores in Asia employing around 1500 people with a user base of over 20 million users. They have a cool mission statement: “fashion on-demand, 24/7 at your doorstep”. They rely heavily on AWS and Lambda to make sure every customer gets access to the website and apps without worrying about scaling issues. I like to quote their CTO whenever I have the chance as it points out something that most companies will come to realize in the not so distant future.

We outgrew what the server world offered to us and it was the right time for us to switch over to a provider like AWS

  • Coca-Cola This came as a surprise to me as I was under the impression that big companies don’t look at the infrastructure cost and think, “how can we cut costs?”. Coca-Cola started migrating to serverless back in 2016 and while they are still in the process of moving everything in the cloud, they are still using traditional servers to service their old technologies but this will only happen until they can “sunset” the older machines. At AWS Re-invent, Coca-Cola’s Michael Connor talks about how a few case studies they made where the result was clear that by using serverless they would cut down costs by 65%.
  • Nordstrom is an American-based chain of department stores, headquartered in Seattle. The company was founded over a hundred years ago and has been on the innovation side of technologies ever since. They started switching from data-driven applications to event-driven applications and have been really pushing the envelope with the creation of an open-source proof-of-concept Serverless architecture retail store called Hello Retail. Rob Gruhl talks to This is my Architecture, an AWS community show about how they are using AWS Lambda to create an event-driven app.

These are just a few of the companies that have already switched server technologies, from traditional servers to serverless infrastructure. Of course, this is by no means a reason to think traditional servers will disappear but having big companies make the jump does point to a not so distant future where serverless will be the go-to technology for deploying enterprise applications.

What Is Serverless (and Why Should I Care)?

Serverless architecture is rapidly gaining traction in the industry, with all major cloud providers offering a solution, along with on-premises options for private cloud installations. Serverless computing is a way to deploy single functions which are activated only when a specific trigger is called. Serverless apps can also handle both asynchronous or synchronous interactions. The serverless platform you are using will dictate the input/output options and language you can write the app in. JavaScript seems to be the only universal language across all platforms.

There are plenty of articles on the business value and other benefits of serverless. This article focuses on when serverless makes technical sense.

Is Serverless a Viable Option for This App?

A few questions to consider when deciding if serverless is the best methodology for the piece of functionality you are about to build and deploy are:

  • Is the app a small, usable building block, or can it be broken into small blocks?
  • Do all the building blocks have well-defined inputs and outputs?
  • Can I use existing development and build tools?
  • Does the serverless platform support:
    • Receiving connections from my client?
    • Interacting with the target datastore?
    • A language I know?

Serverless Building Blocks

An important dimension of serverless computing to keep in mind is that it revolves around discrete chunks of code (or functions, if you prefer that term). These are the building blocks of a serverless architecture.

As part of defining your function, you explicitly set one and only one input trigger, and a limited number of targets where you can write your output. The way you test your code is by uploading a text block (usually JSON), which is used as an input and it simply tests if it can accept the input and execute successfully. Basic logs are visible and can be exported to in-cloud log aggregation solutions like CloudWatch.

Given the fact that there is a single input mechanism per function, the code is highly streamlined as compared to traditional apps, which need to handle multiple types of input variations. The most complicated type of function is one that responds to a web or API request, and even it requires a separate function for each method if you want a different dataset input, or to leverage a different datastore.

Serverless Languages and Development Tools

If you have a specific language you want or need to write your code in, then the serverless platforms you can use might be limited. Unless you are running a multi-cloud environment, this may mean you can’t even use the serverless options on the cloud you are deployed on. The closest thing to a universal language across all serverless platforms is JavaScript. One example of a limitation would be if you code in .NET—then, Azure is your only real option. Or if you want to write your code in Swift, then IBM Cloud Functions (aka Open Whisk) is your target platform.

Serverless can almost always be built using the same tools and CI/CD pipelines that you already have in place. If you are currently supporting container development, then your CI/CD tools are ready.

Vince Power

Vince Power is a Fixate IO Contributor and a guest blogger for Twistlock. He is also a Solution Architect who has a focus on cloud adoption and technology implementations using open source-based technologies. He has extensive experience with core computing and networking (IaaS), identity and access management (IAM), application platforms (PaaS), and continuous delivery.

What can you use Serverless for?

Event streaming. Serverless compute can be triggered from pub/sub topics or from event logs, giving you elastic, scalable event pipelines without the maintenance of complicated clusters. These event streaming pipelines can power your analytics systems, update secondary data stores and caches, or feed monitoring systems ..

What are the advantages of Serverless?

No server management is necessary

Although ‘serverless’ computing does actually take place on servers, developers never have to deal with the servers. They are managed by the vendor. This can reduce the investment necessary in DevOps, which lowers expenses, and it also frees up developers to create and expand their applications without being constrained by server capacity.

Developers are only charged for the server space they use, reducing cost

As in a ‘pay-as-you-go’ phone plan, developers are only charged for what they use. Code only runs when backend functions are needed by the serverless application, and the code automatically scales up as needed. Provisioning is dynamic, precise, and real-time. Some services are so exact that they break their charges down into 100-millisecond increments. In contrast, in a traditional ‘server-full’ architecture, developers have to project in advance how much server capacity they will need and then purchase that capacity, whether they end up using it or not.

Serverless architectures are inherently scalable

Imagine if the post office could somehow magically add and decommission delivery trucks at will, increasing the size of its fleet as the amount of mail spikes (say, just before Mother’s Day) and decreasing its fleet for times when fewer deliveries are necessary. That’s essentially what serverless applications are able to do.

Applications built with a serverless infrastructure will scale automatically as the user base grows or usage increases. If a function needs to be run in multiple instances, the vendor’s servers will start up, run, and end them as they are needed, often using containers (the functions start up more quickly if they have been run recently – see ‘Performance may be affected’ below). As a result, a serverless application will be able to handle an unusually high number of requests just as well as it can process a single request from a single user. A traditionally structured application with a fixed amount of server space can be overwhelmed by a sudden increase in usage.

Quick deployments and updates are possible

Using a serverless infrastructure, there is no need to upload code to servers or do any backend configuration in order to release a working version of an application. Developers can very quickly upload bits of code and release a new product. They can upload code all at once or one function at a time, since the application is not a single monolithic stack but rather a collection of functions provisioned by the vendor.

This also makes it possible to quickly update, patch, fix, or add new features to an application. It is not necessary to make changes to the whole application; instead, developers can update the application one function at a time.

Code can run closer to the end user, decreasing latency

Because the application is not hosted on an origin server, its code can be run from anywhere. It is therefore possible, depending on the vendor used, to run application functions on servers that are close to the end user. This reduces latency because requests from the user no longer have to travel all the way to an origin server. Cloudflare Workers enables this kind of serverless latency reduction.

What are the disadvantages of Serverless ?

Testing and debugging become more challenging

It is difficult to replicate the serverless environment in order to see how code will actually perform once deployed. Debugging is more complicated because developers do not have visibility into backend processes, and because the application is broken up into separate, smaller functions. The Cloudflare Workers Playground is a sandbox that helps reduce friction in testing and debugging

Serverless computing introduces new security concerns

When vendors run the entire backend, it may not be possible to fully vet their security, which can especially be a problem for applications that handle personal or sensitive data.

Because companies are not assigned their own discrete physical servers, serverless providers will often be running code from several of their customers on a single server at any given time. This issue of sharing machinery with other parties is known as ‘multitenancy’ – think of several companies trying to lease and work in a single office at the same time. Multitenancy can affect application performance and, if the multi-tenant servers are not configured properly, could result in data exposure. Multitenancy has little to no impact for networks that sandbox functions correctly and have powerful enough infrastructure. For instance, Cloudflare runs a 15-Tbps network with enough excess capacity to mitigate service degradation, and all serverless functions hosted by Cloudflare run in their own sandbox (via the Chrome V8 engine).

Serverless architectures are not built for long-running processes

This limits the kinds of applications that can cost-effectively run in a serverless architecture. Because serverless providers charge for the amount of time code is running, it may cost more to run an application with long-running processes in a serverless infrastructure compared to a traditional one.

Performance may be affected

Because it’s not constantly running, serverless code may need to ‘boot up’ when it is used. This startup time may degrade performance. However, if a piece of code is used regularly, the serverless provider will keep it ready to be activated – a request for this ready-to-go code is called a ‘warm start.’ A request for code that hasn’t been used in a while is called a ‘cold start.’

Cloudflare Workers largely avoids the cold-starting issue by using the Chrome V8 engine, which in most cases is able to start up and run JavaScript code in under 5 milliseconds. If the code is already running, the response time is under a millisecond.

Vendor lock-in is a risk

Allowing a vendor to provide all backend services for an application inevitably increases reliance on that vendor. Setting up a serverless architecture with one vendor can make it difficult to switch vendors if necessary, especially since each vendor offers slightly different features and workflows. (Cloudflare Workers are easier to migrate because they are written in JavaScript and written against the widely used service workers API.)

Does Serverless use CloudFormation?

When deploying to AWS, the Serverless Framework is using CloudFormation under the hood. This means you can use the Serverless Framework’s easy syntax to describe most of your Serverless Application while still having the ability to supplement with standard CloudFormation if needed.

 

Does Serverless mean no more Servers?

 

Serverless does not mean servers are no longer needed, just that they are not user-specified or controlled. … The ability to execute code without concern for the underlying server type, configuration or capacity is very attractive to IT operations.

 

 Why Serverless?    

Serverless computing offers a number of advantages over traditional cloud-based or server-centric infrastructure. For many developers, serverless architectures offer greater scalability, more flexibility, and quicker time to release, all at a reduced cost

How to Decide when to use Serverless

Serverless computing is the new way to build apps in the cloud. The question isn’t whether you should leverage serverless computing, but when you should start. Well, OK — Serverless computing isn’t the right fit for every app. But in many cases, it can improve performance, as well as cost efficiency.

Why is serverless better?

Serverless computing offers a number of advantages over traditional cloud-based or server-centric infrastructure. For many developers, serverless architectures offer greater scalability, more flexibility, and quicker time to release, all at a reduced cost.

Is serverless cost effective?

One of the many benefits that serverless computing is supposed to offer over traditional, server-based solutions is reduced costs in building and running software systems. While using the serverless stack can offer substantial savings, it doesn’t guarantee cheaper IT operations for all types of workloads.

When to consider not to use Serverless

  1. Your Workloads are Constant. …
  2. You Fear Vendor Lock-In. …
  3. You Need Advanced Monitoring. …
  4. You Have Long-Running Functions. …
  5. You Use an Unsupported Language.

Is serverless the future?

In an O’Reilly survey of 1500 IT professionals in 2019, 40% of respondents worked at organizations that have adopted serverless architecture.

A 2020 DataDog survey indicated that over 50% of AWS users are now using the serverless AWS Lambda Function as a Service (FaaS). Serverless technologies are going mainstream.

Serverless, you only pay for what you use. Your utilization rate is always 100%. Furthermore, serverless almost literally means “worry about servers less”.

While servers and containers are used underneath by the cloud provider to deliver the service, we – customers – don’t worry about that.

Why the future of software and apps is serverless?

Going serverless lets developers shift their focus from the server level to the task level. Serverless solutions let developers focus on what their application or system needs to do by taking away the complexity of the backend infrastructure.

Leave a Reply

Your email address will not be published.