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 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.
  2. ‹#› @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.
  3. ‹#› @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
  4. ‹#› @tpryan • Pay per use • Code is the

    deliverable • APIs provide interaction • Hardware is abstracted Serverless
  5. ‹#› @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
  6. ‹#› @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
  7. ‹#› @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.)
  8. ‹#› @tpryan Matrix from Hell Dev 1 Laptop Dev 2

    Laptop QA Stage Production OS ? ? ? ? ? Frontend ? ? ? ? ? Services ? ? ? ? ? Database ? ? ? ? ? Logs ? ? ? ? ?
  9. ‹#› @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/
  10. ‹#› @tpryan It worked fine in dev It worked fine

    in dev Ops Problem now Ops Problem now
  11. ‹#› @tpryan Back your shit up Back your shit up

    Your laptop’s going to prod Your laptop’s going to prod
  12. ‹#› @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"]
  13. ‹#› @tpryan Matrix from Hell Dev 1 Laptop Dev 2

    Laptop QA Stage Production OS Frontend Services Database Logs
  14. ‹#› @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"]
  15. ‹#› @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/
  16. ‹#› @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/
  17. ‹#› @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"]
  18. ‹#› @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
  19. ‹#› @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
  20. ‹#› @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
  21. ‹#› @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
  22. ‹#› @tpryan Lock in • Every Cloud Provider • VMware

    • Virtual Box Virtual Machines Container • Every Cloud Provider • Docker • Kubernetes Serverless • Cloud Proprietary • No winners yet