Tuesday, June 7, 2016

Serverless Architecture

The first thing to understand about serverless architecture is that it's not about the absence of a server. What it means is that as a developer you are not concerned with the server. You provide a code piece to an environment and it will be executed and results will be returned to you. You are just responsible for providing the code piece and generally, the code piece has to adhere to some contract so that the execution environment can understand it. AWS Lambda is an example of serverless architecture. 

Serverless architecture is important from the perspective that
  • Development is very easy from the perspective that it's easy to write code, test and deploy. However, with serverless one cannot build complex in-memory data models which usually helps in performance and doing complicated workflows. Serverless is more about shoot and run. Basic crud functionality are good candidates for the same. 
  • It saves the developers from dealing with servers and in dealing with deployments. Write code, load it in the execution environment and run it. This helps developers in focusing on the core stuff than on other aspects of development.
  • Hot redeployments are very easy and can be done selectively.
  • Handles scalability transparently.
The current notion of serverless architecture as presented by AWS Lambda, however, has its limitations. There is a limitation in term of computing time and memory resources it can use. So generally they are good to do a well-defined piece of work which is time and memory bound. Don't attempt to build a complicated piece of work as part of lambda, as of now.

Hopefully, the notion of serverless architecture will evolve more with time. We can expect to see more complicated functionality built and supported in serverless fashion. The key here is to remove the notion of the server from a maintenance perspective, out of developers way.  The other developments that will help in building serverless future are
  • Need to build smart servers. Of course, someone has to deal with the smartness at server level what we call as server maintenance today. 
  • The serverless need to know how to scale itself as per the need during individual executions.
  • Issues of authentication and authorization and how the execution context handles them.
  • Logging is another area which needs to be handled as executions are distributed.
  • The execution environment will have to provide multiple capabilities which are provided by frameworks. For example, connecting to datastores, messaging systems etc. need to be handled by execution environment to an extent. This is also relevant from the context of performance. For example, creating a connection to the database every time the serverless code is executed can be costly. The execution environment needs to handle such notions smartly.
  • Testing frameworks need to evolve to handle serverless pieces.
  • Limitations on execution time and resources.

Image Reference: Pixabay

No comments:

Post a Comment