Serverless backend for a small/medium size website

June 22, 2018


Serverless technologies have been around for quite some time now. They are primarily useful for executing event driven use cases( IoT, mobile and the like) with great performance. Almost every notable cloud provider today offer their own implementations of developing serverless functions. Amazon Web Services was first to market with their serverless product Lambda and has steadily evolved ever since.

Serverless design hasn't been widely adopted for websites simply because the inability to handle high performance workloads as and when the website scales up with the additional complexity involved in code management and database management. Debugging also becomes a pain point since there are no servers involved. However this necessarily doesn't mean that you should totally eliminate the idea of a website being hosted on a serverless platform.

With the current technology available, the type of websites which can you consider hosting on a serverless platform are: a content/media based site, hosting a personal blog, promotional sites (landing pages, portfolios etc), video streaming site. The serverless containers can very well handle the incoming loads for these kind of websites and the site itself can quite easily be managed when bundled with a CMS.

So how do you go about building one? I personally prefer using Django with Lambda for accomplishing the task of building a serverless website. Django offers rapid development, and Lambda's support for Python compliments the process of hosting on it. I went ahead with using AWS because of the ecosystem it offers and how their services can integrate with one another. S3 can be used for serving the static content of the site and RDS/Dynamo DB can be used for the database. A simple architecture(on AWS) of the site would look something like this.

website_design.png

The biggest advantage here is cost savings and also the elimination of constant monitoring since there are no servers to manage! Try it out and let me know your thoughts.


Share
Return to blog