Serverless architecture is a software design pattern where applications’ hosting is outsourced to a third-party service provider, eliminating the developer’s need for server software and hardware management.

Serverless architecture is largely based on a Functions as a Service (FaaS) model that allows cloud platforms to execute code without the need for fully provisioned infrastructure instances. FaaS, also known as Compute as a Service (CaaS), are stateless, server-side functions that are
event-driven, scalable, and fully managed by cloud providers.

Hence, serverless architecture is an innovative approach that can decrease time to market and operational costs. Currently, the best-known host of Function as a Service is AWS Lambda.

Advantages of Serverless

  • Serverless is ideal for independent task-based applications such as chatbots and can save on operational costs since billing is based on the actual number of requests.
  • Reducing development time and server costs while simplifying the build process are goals that universally appeal to business teams and IT teams.
  • Serverless computer services are small snippets of code meant to execute a single function, executed on pre-existing servers that run functions for countless other customers as well. Hence, there's no infrastructure to maintain, physically or virtually, with serverless computing.
  • No costs when functions aren't running.
  • There's never a need to partition a new cloud server or purchase additional computing power for an existing instance. All of that is handled by the serverless computing platform, leaving you with no complication outside of a slightly larger bill for additional computing time.
  • On top of being easier to build, serverless functions require a lot less coding knowledge to build, which opens up development to those at lower skill levels.
  • Web Development

    Disadvantages of Serverless

  • The developers are dependent on vendors for debugging and monitoring tools. Debugging distributed systems is difficult and usually requires access to a significant amount of relevant metrics to identify the root cause.
  • When you give a vendor the reins to control your operations, you have to play by their rules. It’s also not easy to port your application to Azure if you’ve already set it up on Lambda. The same concern refers to coding languages: Right now only Node.js and Python developers have the freedom to choose between existing serverless options.
  • The serverless model can exhibit higher latency in certain scenarios. For example, when a user request first arrives, the platform may need to perform a cold start. Developers can overcome this by keeping services “warm,” which keeps everything preloaded and ready to execute.
  • Serverless vendors

    aws-lambda

  • AWS Lambda
  • A FaaS offering that belongs to Amazon Web Services was introduced in 2014. Since its release, Lambda has become synonymous with what serverless means, holding the position of the leading product on the market with the widest range of services available. The most well-known example of public serverless adoption is by Netflix.

    microsoft-azure

  • Azure Functions by Microsoft
  • The service was launched in 2016 to compete with AWS Lambda. Azure Functions offers a similar set of services to Amazon, with a focus on the Microsoft family of languages and tools. One of the examples of using Azure Functions is ‘Have I Been Pwned’.

    google-cloud

  • Google Cloud Functions (GCF)
  • One of the four largest, Google released its solution only in 2017. GCF service used to lag behind Azure and Lambda, but during 2018, Google managed to fix earlier mistakes as evidenced by GCF release notes.

    IBM cloud

  • IBM Cloud Functions
  • Relatively new to the serverless genre, IBM stepped into the game with a competitive set of services to offer. IBM Cloud Functions is the only managed infrastructure solution by OpenWhisk within their cloud services. But if you prefer an open-source solution, Apache OpenWhisk would be a more suitable option.

    Serverless vs Server Frameworks

    Scalability

  • A server does not scale up or down. It has a capacity that cannot be exceeded, and its resources stay available even if they’re not being used (being effectively wasted).
  • Serverless systems automatically scale server instances up and down to handle the load. You do nothing to achieve this behavior.
  • scalability
    maintainance

    Maintainance

  • A server requires maintenance. If you run a server, you might have to monitor it, install software, install patches, tune it, and other operations. You have to figure out how to deploy your code to it.
  • Serverless systems require no maintenance. The cloud provider handles all these details of managing the underlying hardware. You just write and deploy code using tools provided by the cloud vendor.
  • Cost

  • A server has some ongoing costs associated with it. Typically costs are paid on an hourly, daily, or monthly basis just to keep the server up and running, even if it’s not being used.
  • Serverless systems are billed per function invocation. When you deploy code to a serverless backend, you will be charged for resource uses (invocations, memory, bandwidth). If you use nothing, you are charged nothing.
  • cost
    maintainance

    Programming paradigm

  • A server allows you to deploy services that run on an ongoing basis. You can typically login and run whatever programs you want, whenever you want, for as long as you want.
  • Serverless systems are event-driven by nature. You deploy code that runs in response to events that occur in the system. These can be things like database triggers that respond to changes, or HTTP requests that serve an API. Code does not run outside of the context of handling some event, and it is often constrained by some time limits.
  • Serverless Usage Cases

    1. Web applications
    2. Event-driven data processing
    3. Stream processing
    4. Conversation bots
    5. Serverless workflows