Evaluation of “Serverless” Application Programming Model How and when to start Serverless ALGIRDAS GRUMULDIS Examiner Mihhail Matskin Academic adviser Anne Håkansson KTH ROYAL INSTITUTE OF TECHNOLOGY INFORMATION AND COMMUNICATION TECHNOLOGY Abstract Serverless is a fascinating trend in modern software development which consists of pay-as-you-go, autoscaling services. Promised reduction in operational and development costs attracts not only startups but also enterprise clients despite that serverless is a relatively fresh field where new patterns and services continue to emerge. Serverless started as independent services which solve specific problems (highly scalable storage and computing), and now it's become a paradigm shift how systems are built. This thesis addressed questions when and how to start with serverless by reviewing available literature, conducting interviews with IT professionals, analyzing available tools, identifying limitations of serverless architecture and providing checklist when serverless is applicable. The focus was on AWS serverless stack, but main findings are generic and hold for all serverless providers - serverless delivers what it promises, however, the devil is in the detail. Providers are continuously working to resolve limitations or building new services as solutions in order to make serverless the next phase of cloud evolution. The thesis work has been carried out at Scania It AB, Södertälje. Keywords Serverless; cloud computing; AWS Lambda Abstract Serverless är en fascinerande trend inom nutida mjukvaruutveckling som består av pay-as-you-go, autoscaling-tjänster. Löftet om reducerade kostnader för drift och utveckling attraherar såväl startupföretag som storföretag, trots att serverless är ett relativt nytt område där nya inriktningar och tjänster fortsätter att uppkomma. Serverless började som en oberoende tjänst som löste specifika problem (högt skalbar lagring och databehandling), och har nu blivit ett paradigmskifte för hur system byggs. Denna uppsats sökte svar på frågor om när och hur man ska börja med serverless genom att granska tillgängliga publikationer, genomföra intervjuer med IT-experter, analysera tillgängliga verktyg och identifiera begränsningarna i serverless-arkitekturen. Fokus ligger på AWS serverless stack, men de huvudsakliga slutsatserna är generiska och gäller för alla serverless-leverantörer – serverless håller vad den lovar, men djävulen bor i detaljerna. Tjänsteleverantörerna jobbar oavbrutet med att lösa begränsningarna eller skapa nya tjänster och lösningar som ska göra serverless till nästa fas i molnevolutionen. Avhandlingsarbetet har utförts på Scania It AB, Södertälje. Acknowledgments I would like to thank everyone who helped me get where I am today and shaped my journey. Especially I wish to express sincere gratitude to: Regina Dalytė Šileikienė for revealing how to solve complex problems Vilija Dabrišienė for showing the importance of seeking excellence Dennis Borger for awakening interest in Distributed systems Mihhail Matskin for patience and lessons in "it depends" and Web-Services Gabija Karpauskaitė and Cosar Ghandeharioon for assisting in a timely fashion when it mattered the most Malin Gustavsson, Rodrigo Cid and entire Scania IT team for kindness, friendliness, and support and to my family, who sometimes disagree with my decisions but always support and never stop believing in my abilities. i Table of Contents 1 Introduction ................................................................................................................. 1 1.1 Background ..................................................................................................................... 1 1.2 Problem............................................................................................................................. 2 1.3 Purpose ............................................................................................................................. 2 1.4 Goal ..................................................................................................................................... 2 1.4.1 Benefits ....................................................................................................................................... 2 1.5 Methodology .................................................................................................................... 2 1.6 Delimitations .................................................................................................................. 3 1.7 Outline ............................................................................................................................... 3 2 Serverless ..................................................................................................................... 4 2.1 Definition.......................................................................................................................... 4 2.2 Serverless Processing .................................................................................................. 5 2.2.1 Serverless Processing Model ............................................................................................. 5 2.2.2 Container Lifetime ................................................................................................................. 6 2.3 AWS Serverless platform ............................................................................................ 7 3 Deployment package size impact on cold-start............................................ 11 3.1 Methodology .................................................................................................................. 11 3.1.1 Scenarios ..................................................................................................................................12 3.2 Results ............................................................................................................................. 12 3.2.1 Different package and memory sizes, one dummy file. ........................................12 3.2.2 Big package, lots of small files .........................................................................................14 3.2.3 Big package, lots of small files, modules are loaded ..............................................15 3.3 Conclusions .................................................................................................................... 15 4 Serverless Application Programming model ................................................ 16 4.1 Development ................................................................................................................. 16 4.1.1 Infrastructure management .............................................................................................17 4.1.2 Deployment .............................................................................................................................17 4.1.3 Local development ...............................................................................................................17 4.2 Frameworks .................................................................................................................. 18 4.2.1 Chalice .......................................................................................................................................18 4.2.2 Apex ...........................................................................................................................................18 4.2.3 AWS SAM..................................................................................................................................19 4.2.4 Up ................................................................................................................................................20 4.2.5 The Serverless Framework (Serverless.com)...........................................................20 4.2.6 Summary ..................................................................................................................................22 4.3 Architecture and design ............................................................................................ 23 4.3.1 Code patterns .........................................................................................................................24 4.3.2 Files upload .............................................................................................................................26 4.3.3 State management................................................................................................................26 4.3.4 Emulation of server-client communication ...............................................................28 4.4 Security ........................................................................................................................... 29 4.5 Observability ................................................................................................................. 30 4.6 Optimizations ............................................................................................................... 31 4.7 Serverless applicability ............................................................................................. 32 4.7.1 Use cases ..................................................................................................................................33 4.7.2 Characteristics of serverless use-cases .......................................................................35 4.7.3
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages55 Page
-
File Size-