$30 off During Our Annual Pro Sale. View Details »

TeqNation: Building Serverless Applications

TeqNation: Building Serverless Applications

Maintaining servers is boring and tedious, even with properly automated processes in place. So, why don’t you build your next product using NO servers whatsoever? Wait, wut!? Who wouldn’t want this!

In this talk I will show what serverless is, place it in context, and show you why it’s such an interesting concept. I will show you how you can deploy your apps without maintaining any servers, while still making your application scale infinitely, on-demand and cost effective.

This is going to be awesome, don’t miss out!

Sander van de Graaf

April 26, 2018
Tweet

More Decks by Sander van de Graaf

Other Decks in Technology

Transcript

  1. BUILDING SERVERLESS APPLICATIONS

    View Slide

  2. SANDER VAN DE GRAAF.
    Cloud Solutions Architect / Consultant
    15+ years large scale applications
    5+ years AWS experience
    AWS APN Ambassador
    http://twitter.com/svdgraaf
    http://linkedin.com/in/svdgraaf
    http://svdgraaf.nl
    [email protected]

    View Slide

  3. View Slide

  4. WHAT IS SERVERLESS?

    View Slide

  5. PERSPECTIVE.
    •VM's
    •Hardware abstraction
    •Unit of scale: machines

    WHAT IS SERVERLESS?

    View Slide

  6. PERSPECTIVE.
    •VM's
    •Hardware abstraction
    •Unit of scale: machines
    •Containers
    •OS abstraction
    •Unit of scale: application

    WHAT IS SERVERLESS?

    View Slide

  7. PERSPECTIVE.
    •VM's
    •Hardware abstraction
    •Unit of scale: machines
    •Containers
    •OS abstraction
    •Unit of scale: application
    •Serverless
    •Runtime abstraction
    •Unit of scale: functions
    WHAT IS SERVERLESS?

    View Slide

  8. PERSPECTIVE.
    •VM's
    "I want to configure machines, storage, networking and my OS"
    •Containers
    "I want to run servers, configure applications and control scaling"
    •Serverless
    "Run my code when it's needed"
    WHAT IS SERVERLESS?

    View Slide

  9. PERSPECTIVE.
    By Simon Wardley: https://twitter.com/swardley/status/951783539334352896
    WHAT IS SERVERLESS?

    View Slide

  10. WHAT IS SERVERLESS?
    "An application running on 3rd
    party services (BAAS) and/or using
    serverless computing (FAAS)"
    - Martin Fowler
    WHAT IS SERVERLESS?

    View Slide

  11. WHAT IS SERVERLESS?
    "An application running on 3rd
    party services (BAAS) and/or using
    serverless computing (FAAS)"
    - Martin Fowler
    WHAT IS SERVERLESS?

    View Slide

  12. BAAS/FAAS.
    WHAT IS SERVERLESS?
    •BAAS: Backend As A Service
    - Databases: Parse/Firebase/etc
    - Authentication: Auth0, AWS Cognito
    - etc...
    •FAAS: Functions As A Service

    View Slide

  13. PROVIDERS.
    Google
    Cloud Functions
    Azure
    Functions
    AWS
    Lambda
    WHAT IS SERVERLESS?

    View Slide

  14. WHY SERVERLESS?

    View Slide

  15. PATCHING?!
    Patching? YAY!

    Said no one ever.
    WHY SERVERLESS?

    View Slide

  16. PATCHING?!
    WHY SERVERLESS?

    View Slide

  17. PATCHING?!
    WHY SERVERLESS?

    View Slide

  18. RUNTIMES.
    •C# .net core 1.0/2.0
    •Go 1.x
    •Java 8
    •NodeJS 4.3, 6.10
    •Python 2.7, 3.6
    WHY SERVERLESS?

    View Slide

  19. EVENT BASED.
    • API Gateway
    • AWS IoT
    • Alexa Skills Kit
    • Alexa Smart Home
    • CloudWatch Events
    • CloudWatch Logs
    • CodeCommit
    • Cognito Sync Trigger
    • DynamoDB
    • Kinesis
    • S3
    • SNS
    WHY SERVERLESS?

    View Slide

  20. STATELESS.
    Event
    doStuff(event)
    Time

    WHY SERVERLESS?

    View Slide

  21. STATELESS.
    doStuff()
    Time
    doStuff()
    doStuff()
    doStuff()
    doStuff()
    doStuff()
    doStuff()
    doStuff()








    WHY SERVERLESS?

    View Slide

  22. SCALABLE BY DEFAULT.
    Seconds
    WHY SERVERLESS?
    Provisioned
    Servers
    Requests /
    second
    0
    100
    200
    300
    400
    0 10 20 30 40 50 60 70 80 90 100 110 120 130
    Requests

    View Slide

  23. SCALABLE BY DEFAULT.
    Seconds
    WHY SERVERLESS?
    Provisioned
    Servers
    Requests /
    second
    0
    100
    200
    300
    400
    0 10 20 30 40 50 60 70 80 90 100 110 120
    Requests
    130

    View Slide

  24. COSTS.
    Pay per usage
    VM's: per minute
    WHY SERVERLESS?

    View Slide

  25. COSTS.
    Pay per usage
    VM's: per minute
    Lambda: Per 100ms + per request
    WHY SERVERLESS?

    View Slide

  26. COSTS.
    Pay per usage
    VM's: per minute
    Lambda: Per 100ms + per request
    $0.000000208 / 100ms
    +
    $0.0000002 / request

    View Slide

  27. FREE STUFF!
    WHY SERVERLESS?

    View Slide

  28. FREE STUFF!
    400.000 GB-seconds / month
    1 Million requests / month
    WHY SERVERLESS?

    View Slide

  29. EXAMPLES.

    View Slide

  30. SIMPLE WEBSITE.

    View Slide

  31. CRON.

    View Slide

  32. JOB QUEUEUEUEUE.

    View Slide

  33. RESILIENT UPLOADING.

    View Slide

  34. SERVERLESS LORAWAN.

    View Slide

  35. View Slide

  36. View Slide

  37. View Slide

  38. View Slide

  39. View Slide

  40. SERVERLESS LORAWAN.
    https://www.thethingsnetwork.org/docs/applications/http/

    View Slide

  41. View Slide

  42. FRAMEWORKS.
    •Serverless Framework: serverless.com
    •Zappa: zappa.io
    •Chalice: github.com/aws/chalice

    View Slide

  43. DEMO

    View Slide

  44. View Slide

  45. View Slide

  46. View Slide

  47. View Slide

  48. View Slide

  49. SERVERLESS.
    •serverless.yml

    View Slide

  50. SERVERLESS.
    •Serverless functions

    View Slide

  51. SERVERLESS.
    •Deploy
    •pipenv run serverless deploy

    View Slide

  52. SERVERLESS.
    •Setup ttn webhook
    •https://console.thethingsnetwork.org/applications/my-svdgraaf-
    application/integrations

    View Slide

  53. SERVERLESS.
    •Simulate device
    •echo "20.3" | xxd -pu | xargs ttnctl devices simulate my-test-device

    View Slide

  54. SERVERLESS.
    •Show logs
    •https://console.aws.amazon.com/cloudwatch/home?region=us-
    east-1#logs:prefix=/aws/lambda/ttn-serverless

    View Slide

  55. SERVERLESS.
    •Call back

    View Slide

  56. SERVERLESS.
    •Show logs
    •https://console.aws.amazon.com/cloudwatch/home?region=us-
    east-1#logStream:group=/aws/lambda/ttn-serverless-dev-downlink

    View Slide

  57. SERVERLESS.
    •Show data
    •https://console.thethingsnetwork.org/applications/my-svdgraaf-
    application/devices/my-test-device/data

    View Slide

  58. CONCLUSION.
    •Cost effective infrastructure
    •Event based
    •Stateless
    •Highly scalable out of the box

    View Slide

  59. QUESTIONS?
    Cloud Solutions Architect / Consultant
    15+ years large scale applications
    5+ years AWS experience
    AWS APN Ambassador
    http://twitter.com/svdgraaf
    http://linkedin.com/in/svdgraaf
    http://svdgraaf.nl
    [email protected]
    SANDER VAN DE GRAAF.

    View Slide