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

Vms, Serverless, or Containers

Terrence Ryan
December 14, 2017

Vms, Serverless, or Containers

An exploration of how and why to choose between these technologies

Terrence Ryan

December 14, 2017
Tweet

More Decks by Terrence Ryan

Other Decks in Technology

Transcript

  1. ‹#›
    @tpryan
    Terry Ryan
    Developer Advocate
    VM, Serverless, or
    Containers ¯\_(ツ)_/¯

    View Slide

  2. ‹#›
    @tpryan
    Who are you?

    View Slide

  3. ‹#›
    @tpryan
    Disclaimer

    View Slide

  4. ‹#›
    @tpryan
    Disclaimer

    View Slide

  5. ‹#›
    @tpryan
    Finances
    Developers System Admins

    View Slide

  6. ‹#›
    @tpryan
    01 Introduction
    What’s the problem?

    View Slide

  7. ‹#›
    @tpryan
    Computing options
    are confusing.

    View Slide

  8. ‹#›
    @tpryan
    There is money on
    the table.

    View Slide

  9. ‹#›
    @tpryan
    Where there is money
    there is FUD.

    View Slide

  10. ‹#›
    @tpryan
    Virtual Machines
    OS OS
    Containers Serverless
    OS

    View Slide

  11. ‹#›
    @tpryan
    02 Virtual Machines
    Everyone’s first step
    OS OS

    View Slide

  12. ‹#›
    @tpryan
    Hypervisor
    Virtual Machines
    OS OS
    OS

    View Slide

  13. ‹#›
    @tpryan
    Virtual Machines - Pros
    • Eliminate direct hardware costs
    Finances Developers
    • No significant changes
    System Admins
    • Eliminates toil associated with
    hardware.
    • Allows continued use of system
    configuration and optimization
    skills.

    View Slide

  14. ‹#›
    @tpryan
    Virtual Machines - Cons
    • Can lead to billing surprises
    Finances Developers
    • Might be environment
    differences that cause bugs.
    System Admins
    • Loss of control
    • Problems can occur in the
    space that they used to control
    but now don’t.

    View Slide

  15. ‹#›
    @tpryan
    Iceberg

    View Slide

  16. ‹#›
    @tpryan
    Radio Show

    View Slide

  17. ‹#›
    @tpryan
    VM Mitigation
    • Move risk from cloud provider to
    cloud customer
    Discounts Unstable VM
    • Dramatically reduced cost
    • Resource isn’t guaranteed
    Custom VMs
    • Constrain resources to your
    processing need

    View Slide

  18. ‹#›
    @tpryan
    Demo: 100,000,000 Digits of Pi

    View Slide

  19. ‹#›
    @tpryan
    03 Serverless
    That can’t be right

    View Slide

  20. ‹#›
    @tpryan
    • Marketing term (but a very relevant one)
    Serverless

    View Slide

  21. ‹#›
    @tpryan
    • Pay per use
    • Code is the deliverable
    • APIs provide interaction
    • Hardware is abstracted
    Serverless

    View Slide

  22. ‹#›
    @tpryan
    Serverless Computing
    • REST APIs
    • Microservices
    • Mobile Backends
    • Entire web applications
    Application Event
    • File writes
    • Queue messages
    • API calls
    Storage
    • Database
    • Data Warehouse
    • File storage

    View Slide

  23. ‹#›
    @tpryan
    Serverless - Pros
    • Pay only for exact use
    Finances Developers
    • Easier to create microservices
    • Easier to isolate services from
    other service
    System Admins
    • Eliminates most systems toil

    View Slide

  24. ‹#›
    @tpryan
    Serverless - Cons
    • Bursts can surprise you
    • Sustained usage will tend to be
    more expensive then you might
    expect
    Finances Developers
    • Most serverless systems
    require a proprietary interface
    • Existing apps require work to
    migrate
    • Constraints in what kinds of
    other operation you can do
    • Constraints in runtimes.
    System Admins
    • Eliminates most systems toil
    • (Might be threatening if all of it
    gets replaced.)

    View Slide

  25. ‹#›
    @tpryan
    Demo: 0 to 100,000 strikes

    View Slide

  26. ‹#›
    @tpryan
    04 Containers
    Docker, Docker, Docker
    OS

    View Slide

  27. ‹#›
    @tpryan
    Matrix from Hell
    Dev 1 Laptop Dev 2 Laptop QA Stage Production
    OS
    ? ? ? ? ?
    Frontend
    ? ? ? ? ?
    Services
    ? ? ? ? ?
    Database
    ? ? ? ? ?
    Logs
    ? ? ? ? ?

    View Slide

  28. ‹#›
    @tpryan
    Matrix from Hell
    Dev 1 Laptop Dev 2 Laptop QA Stage Production
    OS
    OS X Windows Debian Debian Debian
    Frontend nginx
    (homebrew)
    nginx
    (download)
    nginx
    (apt-get)
    nginx
    (apt-get)
    nginx
    (apt-get)
    Services php
    (homebrew)
    php
    (download)
    php
    (apt-get)
    php
    (apt-get)
    php
    (apt-get)
    Database mysql
    (download)
    mysql
    (download)
    mysql
    (apt-get)
    mysql
    (apt-get)
    mysql
    (apt-get)
    Logs
    /usr/local/etc/nginx/logs/ C:\nginx-1.9.5\logs /var/log/nginx/ /var/log/nginx/ /var/log/nginx/

    View Slide

  29. ‹#›
    @tpryan
    It worked fine in dev
    It worked fine in dev
    Ops Problem now
    Ops Problem now

    View Slide

  30. ‹#›
    @tpryan
    Back your shit up
    Back your shit up
    Your laptop’s going to prod
    Your laptop’s going to prod

    View Slide

  31. ‹#›
    @tpryan
    Hypervisor
    Virtual Machines
    OS OS
    OS

    View Slide

  32. ‹#›
    @tpryan
    Container Host
    Containers
    OS

    View Slide

  33. ‹#›
    @tpryan
    Dockerfile
    FROM php:5.6-apache
    RUN apt-get update && apt-get -y install \
    curl \
    php5-mysqlnd \
    php-pear \
    zlib1g-dev
    RUN docker-php-ext-install mysqli
    COPY php.ini /usr/local/etc/php/
    COPY startup.sh /usr/local/bin/
    RUN chmod 755 /usr/local/bin/startup.sh
    ADD default /var/www/html
    CMD ["/usr/local/bin/startup.sh"]

    View Slide

  34. ‹#›
    @tpryan
    Matrix from Hell
    Dev 1 Laptop Dev 2 Laptop QA Stage Production
    OS
    Frontend
    Services
    Database
    Logs

    View Slide

  35. ‹#›
    @tpryan
    # FRONTEND AND SERVICES
    FROM nginx-php-fpm
    COPY nginx.conf /etc/nginx/nginx.conf
    ADD www /var/www/

    View Slide

  36. ‹#›
    @tpryan
    # BACKEND
    FROM ubuntu:12.04
    ADD ./mysql-setup.sh /tmp/mysql-setup.sh
    RUN /bin/sh /tmp/mysql-setup.sh
    EXPOSE 3306
    CMD ["/usr/sbin/mysqld"]

    View Slide

  37. ‹#›
    @tpryan

    View Slide

  38. ‹#›
    @tpryan
    # FRONTEND AND SERVICES
    FROM nginx-php-fpm
    COPY nginx.conf /etc/nginx/nginx.conf
    ADD www /var/www/
    # JUST SERVICES
    FROM nginx-php-fpm
    COPY nginx.conf /etc/nginx/nginx.conf
    ADD www /var/www/

    View Slide

  39. ‹#›
    @tpryan
    # FRONTEND AND SERVICES
    FROM nginx-php-fpm
    COPY nginx.conf /etc/nginx/nginx.conf
    ADD www /var/www/
    # FRONTEND
    FROM nginx
    COPY nginx.conf /etc/nginx/nginx.conf
    ADD www /var/www/

    View Slide

  40. ‹#›
    @tpryan

    View Slide

  41. ‹#›
    @tpryan
    # BACKEND
    FROM ubuntu:12.04
    ADD ./mysql-setup.sh /tmp/mysql-setup.sh
    RUN /bin/sh /tmp/mysql-setup.sh
    EXPOSE 3306
    CMD ["/usr/sbin/mysqld"]
    # BACKEND
    FROM ubuntu:12.04
    ADD ./mysql-setup.sh /tmp/mysql-setup.sh
    RUN /bin/sh /tmp/mysql-setup.sh
    EXPOSE 3306
    VOLUME ["/etc/mysql", "/var/lib/mysql"]
    CMD ["/usr/sbin/mysqld"]

    View Slide

  42. ‹#›
    @tpryan

    View Slide

  43. ‹#›
    @tpryan

    View Slide

  44. ‹#›
    @tpryan

    View Slide

  45. ‹#›
    @tpryan

    View Slide

  46. ‹#›
    @tpryan

    View Slide

  47. ‹#›
    @tpryan
    That’s a lot to manage.

    View Slide

  48. ‹#›
    @tpryan
    4 3 1

    View Slide

  49. ‹#›
    @tpryan

    View Slide

  50. ‹#›
    @tpryan

    View Slide

  51. ‹#›
    @tpryan

    View Slide

  52. ‹#›
    @tpryan

    View Slide

  53. ‹#›
    @tpryan
    Containers - Pros
    • Allows for better resource
    usage
    Finances Developers
    • Easier to create microservices
    • Easier to isolate services from
    other service
    • Less constraints then serverless
    System Admins
    • Separates the code from the
    system almost entirely
    • Strongly encourages developer
    to write easily logged,
    monitored and dignosed
    applications

    View Slide

  54. ‹#›
    @tpryan
    Containers - Cons
    • Still requires a sunk minimum
    cost
    Finances Developers
    • Microservices are great, until
    they aren’t and then they hurt.
    • Complexity
    System Admins
    • Containers tend to create
    additional layer of management
    • Complexity, complexity,
    complexity

    View Slide

  55. ‹#›
    @tpryan
    Container Mitigation
    • Bring a container, provider will
    host
    • GAE Flex
    • AWS has a thing
    • Azure has a thing
    • Other services
    Managed Container Hosting Managed Kubernetes
    • Provider runs Kubernetes for
    you, takes away a lot of
    complexity
    • Kubernetes Engine
    • AWS’s thing
    • Azure thing

    View Slide

  56. ‹#›
    @tpryan
    Demo: Launch all the things

    View Slide

  57. ‹#›
    @tpryan
    05 Conclusions
    Bring it home

    View Slide

  58. ‹#›
    @tpryan
    Workload
    • Consistent load
    • Lift and Shift
    • Licensed executables
    • Custom Hardware
    • GPUs
    • TPUs
    Virtual Machines Containers
    • Middle step
    • Variable load
    • Microservices
    • Diminishing Legacy Apps
    Serverless
    • Greenfield
    • Microservices
    • Unknown load

    View Slide

  59. ‹#›
    @tpryan
    Staffing
    • Serverless
    • Containers
    Developer Heavy Systems Heavy
    • VMs
    • Containers
    Some other
    • VMs

    View Slide

  60. ‹#›
    @tpryan
    Personally, I love
    Serverless, but use
    Containers

    View Slide

  61. ‹#›
    @tpryan
    Lock in
    • Every Cloud Provider
    • VMware
    • Virtual Box
    Virtual Machines Container
    • Every Cloud Provider
    • Docker
    • Kubernetes
    Serverless
    • Cloud Proprietary
    • No winners yet

    View Slide

  62. ‹#›
    @tpryan
    Containers, wherever you
    run them are a safe bet

    View Slide

  63. ‹#›
    @tpryan
    Ultimately I think
    Serverless will win out.

    View Slide

  64. ‹#›
    @tpryan
    Thank You
    terrenceryan.com
    @tpryan
    This preso: http://bit.ly/tpryan-ab2017
    Joind.in: https://joind.in/talk/
    73e71

    View Slide