Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Intro to Serverless, tools and use cases

Aletheia
January 12, 2018

Intro to Serverless, tools and use cases

A comprehensive introduction to Serverless technologies, available tools both cloud independent and AWS specific, plus some use cases with architecture discussion

Aletheia

January 12, 2018
Tweet

More Decks by Aletheia

Other Decks in Programming

Transcript

  1. Intro to Serverless, tools and use cases Luca Bianchi —

    Neosperience @bianchiluca medium.com/@aletheia github.com/aletheia it.linkedin.com/in/lucabianchipavia
  2. Who am I? • Chief Technology Officer @ Neosperience •

    Working on a lot of bleeding edge technologies • Passionate developer: love writing code, hate meetings The Neosperience Cloud • Software as a service cloud for Digital Customer Experience processes 
 (Psychographics, Loyalty & Gamification, Proximity, Content, etc.) • Built on AWS, 95% on Serverless technologies • Moved from VMWare, to EC2, to Elastic Beanstalk, to Serverless • Dozens of micro and nano services The Digital Customer Experience Company, aims to change the way brands and customers interact with an approach of a software vendor targeting Digital Customer Experience as the evolution of Marketing automation.
  3. Serverless Meetup Began as a joke, after too many beers

    456 members and growing Hosted the first italian JeffConf 
 (https://goo.gl/mqvnsR) Monthly meetup Events with other communities Wants to build a network of 
 serverless meetups
  4. Agenda “Serverless” disclaimer What is “Serverless”? The Serverless Manifesto Events,

    streams and triggers Serverless development, tools and vendors Use Case: your nightmare before Christmas The good, the bad and the ugly of Serverless development A point on Serverless architectures
  5. What is Serverless? “Serverless architecture replaces long-running virtual machines with

    ephemeral compute power that comes into existence on request and disappears immediately after use. Use of this architecture can mitigate some security concerns such as security patching and SSH access control, and can make much more efficient use of compute resources. These systems cost very little to operate and can have inbuilt scaling features.” — ThoughtWorks, 2016
  6. The Serverless Manifesto Function as the unit of deployment and

    scaling Implicitly fault-tolerant Metrics No machines, VMs, or containers Bring Your Own Code Stateless Never pay for idle Scales per request
  7. It all started with an event.. • events are a

    great way to decouple services • largely abused in the last decade (ESB) • now revamped with CQRS and Event Sourcing to handle microservices communication • serverless functions handle events • need a different approach on architectures
  8. AWS Lambda is a compute service that lets you run

    code without provisioning or managing servers. AWS Lambda executes your code only when needed and scales automatically, from a few requests per day to thousands per second. Service released on Nov, 2014 Introduces Event-Driven programming model Provides a context and an event object AWS Lambda
  9. CloudFormation Cloud Services become a part of your project Infrastructure-as-code

    A scripting language for the cloud Defines AWS resources 
 (Lambda, S3Buckets, DynamoTables, etc) Manages resource lifecycle Example: creating a DynamoDB Table https://docs.aws.amazon.com/AWSCloudFormation/ latest/UserGuide/Welcome.html
  10. What is AWS SAM? github.com/awslabs/serverless-application-model “The goal of AWS SAM

    is to define a standard application model for serverless applications.”
  11. In other (technical) words? AWS::Serverless Transform (CloudFormation) Special serverless resources

    (e.g. AWS::Serverless::Function) Pretty similar to Serverless Framework’s syntax (yaml) Natively supported by AWS SAM Local (github.com/awslabs/aws-sam-local)
  12. My Personal “wishes” for AWS SAM More transparency (make it

    public, or even customizable?) Custom Transforms (endless possibilities!)
  13. It is the night before Christmas 
 and you’re just

    leaving.. …then your manager steps into the office.. …with another great idea: 
 an url-tracker!
  14. IDEA: Make it Serverless! Focus only on your code No

    infrastructure to manage (your IT guy has a family, too) Scales up to production requirements Can be released within minutes Use DynamoDB and GSI Serverless does not mean spaghetti-code!
  15. The good Fast deployments Serverless.yml makes things easy Infrastructure versioning

    Test environments IAM permissions management DynamoDB scales automatically Serverless strips unwanted dependencies A/B testing with Lambda is very easy Progressive rollout are made possible with a single click
  16. The bad CloudFormation is not so easy to write Not

    every service is scriptable Support for 3rd party services is very bad No Lambda lifecycle callbacks Lambda cold start matters No GPU support (yet) Serverless Framework is not an AWS tool
  17. The ugly Lambda support is up to NodeJS 6.10 Maximum

    resorce limit up to 200 CloudFront distribution needs some tune-up Communication between Lambdas is up to you
  18. • In 2015 Tim Wagner, General Manager @ AWS Serverless

    Compute, presented to the ServerlessConf the so-called Serverless Manifesto. • In 2017 Danilo Poccia, Technical Evangelist @ AWS, talking at JeffConf asked “what would be having that manifesto translated into a checklist to evaluate Serverless compliance of an architecture?” • So, we turned it into a “Serverless Scorecard” Evaluating a serverless architecture (aka how big is my serverless?) The Serverless Scorecard Function as the unit of deployment and scaling Implicitly fault-tolerant Metrics No machines, VMs, or containers Bring Your Own Code Stateless Never pay for idle Scales per request
  19. AWS Cloud9 Features Full-fledged IDE & Dev tools Cost-saving settings

    (hibernation) Integrated web terminal * (EC2 or SSH environment) Built-in Lambda support Live debugging capabilities (only Node.js for now) Collaborative coding/debugging * No SSH keys or IAM credentials to configure locally (!) SAM-local integration (local testing & deployments)
  20. AWS Cloud9 Dev Tools AWS CLI (1.11), sam-local (0.2.4) git,

    gcc, c++, Docker (17.03) node (6.11.4), npm, nvm, coffeescript python (2.7.12 & 3.6.2), virtualenv, pip, pylint, boto3 PHP (5.6), MySQL (14.14), Apache (2.4) ruby (2.4.1), rails (5.1.4) Go (1.9.1) Java docs.aws.amazon.com/cloud9/latest/user-guide/ami-contents.html
  21. AWS Cloud9 Limitations & “wishes” Max 20 env per user,

    100 per account Max 10 open env per user Max 8 members in each env EC2 instance maintenance is still on you (OS updates, etc.) No Python debugging No “offline” support Only SAM-focused Lacking AWS Console integration “Primitive" Lambda testing ⚡ (e.g. no event generation)
  22. no servers have been harmed to build this presentation CREDITS

    A special thanks to Alex Casalboni (@alexcasalboni) for letting me copy some of his slides and many interesting talks on serverless we have every day.