• Ei tuloksia

1. INTRODUCTION

There are many choices that need to be made when deciding infrastructure for a commercial scale web site. For example, what programming language and frame-works are used, what databases to use, on what infrastructure should the systems run in and so forth.

When considering hosting a website the minimal setup would be serving HTML (Hypertext Markup Language) document from a storage system provided by a ser-vice provider. HTML served directly from a source without Javascript that would alter its contents would be optimal for search engine optimization as search engines would not need to execute Javascript.

However, sites that are only HTML can be lacking in functionality. Javascript frontend frameworks execute Javascript code to generate HTML. They also allow for richer user experience. However, if this kind of document served directly from a source would not be optimal for search engines and for some slow devices because Javascript would have to be executed in order to generate the HTML document.

This problem can be solved by pre-rendering the content into HTML document and that content could be stored in a storage system and served from there. This is problematic however because in some cases different content needs to be served to different customers. One pre-rendered HTML document would not thus satisfy the requirements.

Server side rendering remedies the problem as the code is run individually for all requests and after that pre-rendered and sent to the user. There are multiple ways of hosting this kind of a setup and this thesis focuses on one of them.

1.1. Background 2

1.1 Background

This master’s thesis focuses on suitability of FaaS (Function as a Service) systems as frontend servers. This master’s thesis was written while working for Alma Talent Oy company in one of their media site renewing projects. The renewed site in question was www.talouselama.fi.

In talouselama.fi’s renewal project the whole technology stack was reconsidered.

This reconsideration process offered nice opportunities to look for new and interest-ing technologies that could prove useful in the project. Main aim of the site renewal was to get rid off sluggish development cycle enabled by the old technology stack, mainly caused by the old CMS (Content Management System) system. Other goals were to get rid off vendor locking and to build the site by using widely used modern web technologies.

In addition to choosing programming languages and database engines there was a need to make choices regarding server environments and products to be used from a cloud computing provider. The infrastructure choices were important as the site in question attracts relatively heavy traffic.

1.2 Motivation

Resources in software projects are often limited. Because resources are limited it is crucial that limited resources are spent as efficiently as possible. For example software developers time should mainly be used writing software and not for example by managing servers.

Difficulties of managing server infrastructure were also noticed and largely mitigated in Alma Talent Oy. The mitigation was achieved by using PaaS (Platform as a Ser-vice) cloud services. PaaS services offer many benefits that make server management easier.

After PaaS entry to the market there has been some developments in the cloud computing field. One of the most significant new developments came in the form of FaaS that offer many same benefits as PaaS. FaaS also has its own advantages and disadvantages compared to PaaS.

Function as a service paradigm has great promises. Cloud services offering FaaS

1.3. Research questions and goals 3 typically make a promise that developers using their product are mainly able to focus on writing code, not on managing servers. This is a bold promise and this master’s thesis explores how accurate this promise is in practice. FaaS platforms also promise responsive and fast scaling in response to a load and their pricing models are attractive.

1.3 Research questions and goals

Research questions:

1. Is it possible to use FaaS as a frontend server?

2. Is FaaS feasable option as a frontend server cost and performance vice?

The goal of this thesis besides answering the research questions is to find out advan-tages and disadvanadvan-tages of using FaaS, and to document problems unique aspects relating to this computing paradigm.

Talouselama.fi is a media and news website that covers mainly business related topic.

The website is usually under relatively heavy traffic and it is updated frequently by developers. These premises set some limits to underlying technologies. The underlying server technology must allow for quick development cycles and the site has to serve all readers even under heavy traffic.

The website in question being a commercial product sets some limitations as well.

Because it is a commercial product availability has to be high and this availability should be achieved with reasonable costs.

1.4 Research methods

Thesis uses both qualitative and quantitative research methods and focuses on few selected QoS (Quality of Service) measurements. Measurements where possible ware made from two different frontend server solutions focusing on selected QoS attributes. This part of the thesis forms the quantitative part of the thesis.

QoS attributes were measured from the new implementation running on FaaS plat-form. Some attributes were also measured on PaaS platform, although program

1.5. Scope of the thesis 4 running in PaaS was not the same as the one running in FaaS. This was done in order to have some baseline to compare FaaS platform’s performance. Data was also gathered from old www.talouselama.fi where possible.

Main source of data for QoS calculations came from self diagnostics and analytic tools provided by the service provider. In cases where QoS attribute data was not available by the service provider, measurements were made with different tools such as Apache Jmeter. Quality of service measurements and their results are shown and analyzed in chapter 5.

Another method used in this thesis is qualitative research method. Qualitative research part of this thesis focuses mainly on developer experience. Developer ex-perience in FaaS context aims to find out how easy it is to maintain and develop a website program that is to be hosted in FaaS.

Developer experience part of the thesis relies on experiences gathered by me and the team working on www.talouselama.fi project. There were no formal interviews, developer experience was communicated via informal chatter among the team and written down on this thesis.

1.5 Scope of the thesis

The FaaS platform this thesis focuses on is AWS Lambda. AWS Lambda was selected because Amazon’s cloud computing service AWS (Amazon Web Service) is heavily used in Alma Talent Oy. The scope of this work is limited to AWS Lambda and Amazon’s cloud because it is not practical to use many cloud computing providers at the same time. Using many providers is not practical because every service has their own limitations and they each have a learning curve. Also some backend services were already built using AWS so changing to another service was not a practical choice.

An alternative choice for running frontend code in www.talouselama.fi project was Amazon’s PaaS service AWS Elastic Beanstalk. AWS Elastic Beanstalk is widely used within the Alma Talent Oy. Alma Talent Oy uses AWS Elastic Beanstalk service to host other media sites. As a proven solution it was known to be working for this particular use case. It has many advantageous features that allow services to scale and to run various types of software code written in any programming language available.

1.6. Structure of the thesis 5 Because it was unclear whether or not AWS Lambda was a suitable option to host a web application of this scale it was required that the www.talouselama.fi web application was designed in a way that it could be run in both AWS Elastic Beanstalk and AWS Lambda. Because of this interoperability, AWS Elastic Beanstalk was used as a comparison tool to compare against AWS Lambda’s features.

This thesis focuses on cloud computing services that execute frontend code which is then sent to the user. This thesis mainly ignores other servers needed for the media site. For example servers needed for running backend code are ruled out of this thesis’ scope.

1.6 Structure of the thesis

The Second chapter focuses on theory behind the thesis. It describes what servers are and how they are used in web environment. Second chapter also describes what QoS means and how those attributes are calculated. Also main concepts behinds FaaS and PaaS such as different kinds of virtualization are covered.

The Third chapter focuses on specific aspects of AWS Lambda FaaS platform. It describes properties of AWS Lambda and also advantages and disadvantages of using the system. Third chapter also lists and describes limits enforced on AWS Lambda by the service provider.

The Fourth chapter focuses on technical implementation of www.talouselama.fi web-site. Chapter covers also why certain technical choices were made and how they affected the whole project.

The Fifth chapter focuses on results of the projects and their analysis. Metrics from different implementations are compared to each other where possible.

The Sixth and final chapter of the thesis focuses on conclusions. Final chapter aims to answer research questions of the thesis and also to further contemplate if the FaaS implementations are something to pursue also in the future.

6