Making a Serverless Website

In this blog post you will learn how you can turn your website into a serverless website.
Why Serverless?
There are several reason why your should convert your website into a serverless website. On one hand, it makes you less vulnerable for attacks. An attacker has less resources and opportunities to focus on. Secondly, it drastically cuts computing power and energy. Another reason is that it forces you to think about data and data storage. Because of that, Data Blogger is now fully GDPR compliant.
When Not Serverless?
If your website is highly interactive and stores a lot of user data, you might consider to keep your server and to transform all actions and events into micro services.
How to go serverless?
I will now discuss how I used Amazon Web Services (AWS) to convert my server setup (EC2, WordPress, MySQL, PHP, Nginx) to a serverless setup (S3 buckets). I first converted all my WordPress pages to simple HTML, JavaScript and CSS files and removed all the dynamic files. Then, I created two S3 buckets. One bucket containing the contents of the website (the HTML, JS and CSS files) and one bucket redirecting all traffic to the first bucket. It ensures that traffic to “data-blogger.com” is redirected to the subdomain “www.data-blogger.com”. Then, I used CloudFront to duplicate the data across several regions around the world. CloudFront is pointed to the bucket containing the website contents. Then, I used Route 53 to point the domains (“www.data-blogger.com” and “data-blogger.com”) towards the CloudFront setup.
Publish New Posts
The major downside is that I have to collect all HTML, JS and CSS files when I publish a new post. However, the website speed and security are improved and that was the main goal.
Conclusions
A serverless setup assures speed and security improvements for your website.