Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Revolutionizing Application Development Using Serverless Architectures

DZone's Guide to

Revolutionizing Application Development Using Serverless Architectures

Serverless tech isn't just for the big tech companies. Read this detailed map explaining how each element in AWS makes development easier for businesses of all sizes.

· Cloud Zone ·
Free Resource

Insight into the right steps to take for migrating workloads to public cloud and successfully reducing cost as a result. Read the Guide.

Serverless architectures are applications that depend on custom code executed in ephemeral containers.  One might think that "serverless" literally means that there are no servers involved. However, serverless comprises of two different areas which overlap with each other.

  1. Applications that depend on 3rd party applications/ services to manage server side state. These types of services have been defined as "Backend-as-a-Service" (BaaS).
  2. Applications in which a certain amount of code is written by the application developer and deployed on stateless compute containers that are event triggered and ephemeral. These are referred to as "Function-as-a-Service" (FaaS).

This post does not intend to describe serverless, but rather the possibility of revolutionizing the way application development is done in small and medium enterprises. Traditionally, serverless has been viewed to have limited capabilities.  Most organizations have used it for marketing applications where click counts required to be counted. Others have used it for data processing and data warehousing applications.

However, I would like to explain a brief use case where the architecture of the application can be revolutionized.

Consider a medium scale food distributor who requires a web application to track his deliveries. The traditional way of development would require a front end application, developed using a web framework such as AngularJS or ReactJS, a server to execute the back end logic of the application, typically using Spring JPA, and a database to store data.

App Development Traditional View





Now let's see how the architecture can be changed to a Serverless architecture by using a services provider such as Amazon.

 Serverless Architecture











It might be overwhelming at first but let's first look at the components. The web application development can be done using  ReactJS. The only requirement is to add functionality to generate rest API requests. This can be easily done using a library such as "axios".  After the application has been developed, we could deploy it using the AWS ECS service where the application would be executed as a Docker container.  This means that the developer does not need to worry about deploying and managing it on a server.  The Docker container can be deployed in a Kubernetes cluster if required so that auto scaling and high availability can be guaranteed.

For authentication purposes, AWS Cognito services can be used. This means that the developer does not need to worry about managing usernames, passwords and encryption functions. The concept pretty much aligns with BaaS where AWS provides an authentication token that can be used to access services.

Next a cloud API gateway service such as AWS API gateway can be configured with the resource paths required (the method: POST, GET etc. and the corresponding resource path).  The requests would then invoke the corresponding lambda functions.

The back end functionality can be reproduced using lambda functions with AWS Lambda.  Data formatting and SQL queries can be included within lambda functions to achieve the required behavior. When a request is received by the API gateway, a lambda will be invoked and the data can be stored on the database/retrieved from the database as required.

The database can also be hosted using AWS RDS , making a system administrator's life much easier. In this way, the whole architecture of the application can be developed while considering the cloud services provided by Amazon.

Benefits to an SME

This means that no longer does an organization need to worry about infrastructure management.

Also, based on the concept of serverless, you only pay for the usage. Therefore, an organization with bursts of traffic, would benefit from this because they would not have to pay for redundant infrastructure.

Risks to an SME

Vendor locking is by far the greatest risk. If the system needs to be transferred to another cloud service provider, as of now it would be a nightmare. However, in the future, cloud service providers might make transitions more smoother.

Also, serverless application development is a daunting task for a new developer. The learning curve is steep given the number of services and the documentation a developer has to go through.

Henceforth, still it might not be feasible for a small or medium enterprise to shift their development environment to a lambda environment. However, with the advances in technology, certain architectures can be moved into a serverless cloud provider. 

TrueSight Cloud Cost Control provides visibility and control over multi-cloud costs including AWS, Azure, Google Cloud, and others.

Topics:
serverless ,amazon ,architecture ,enterprise ,cloud ,container deployment

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}