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

Dockerizing Rails

Igbanam
August 31, 2019

Dockerizing Rails

This introduces the concepts of Docker to the application developer. This is how one can go from a proof of concept to a resilient application under load

Igbanam

August 31, 2019
Tweet

More Decks by Igbanam

Other Decks in Technology

Transcript

  1. Why Dockerize? ◎ Have many commands do you use to

    setup your development environment? ◎ How easy is it to deploy your app? ◎ How much downtime does your deploy cost? 3
  2. Today, we shall talk about ◎ Rails ◦ Fast Prototyping

    ◦ Continuous Deployment ◎ Docker ◦ Compose ◦ Swarm (vs. Kubernetes) ◎ Live Deployments ◦ Demo 9
  3. 11

  4. 12 Ruby on Rails Principles ◎ Programmer Happiness ◎ Convention

    over Configuration ◎ Progress over Stability More at Rails Doctrine
  5. 16 Brief History of Deployments ◎ FTP (Shared Hosting) ◎

    Rsync ◎ SSH + Script ◦ Ruby’s Capistrano ◎ Virtual Machine ◦ Platform-as-a-Service ◎ Containers
  6. 17

  7. Virtualization ◎ Hardware-level ◎ Heavyweight ◎ Slow provisioning ◎ Limited

    Performance ◎ Fully isolated ◎ More secure Difference between Virtualization and Containerization Containerization ◎ OS-level ◎ Lightweight ◎ Real time provisioning and scalability ◎ Native performance ◎ Process-level isolation ◎ Less secure (ish) 18
  8. Docker Constituents ◎ Images ◎ Containers ◎ Engine ◎ Swarm

    Image An image is a blueprint of a machine. Here we describe configurations and constituents of the machine. Think of it as a “class” 20
  9. Docker Constituents ◎ Images ◎ Containers ◎ Engine ◎ Swarm

    Container A container is an instantiated image. Complete isolated process environment where the service (your app) runs. 22
  10. Docker Constituents ◎ Images ◎ Containers ◎ Engine ◎ Swarm

    Engine Containers need a host machine to run on. The engine serves this purpose. 24
  11. Docker Constituents ◎ Images ◎ Containers ◎ Engine ◎ Swarm

    Swarm A collection of engines (as nodes) within a cluster. Also an orchestration tool for deployments 26
  12. Docker Constituents Volumes Filesystems within your containers Nodes Engines within

    a Swarm Stacks Managing services in a swarm. Compose is the definition. Services …provided by the container. This could be your app. Networks Define the topology of your platform. 27
  13. Small ToDo App (Underbelly) Read Database (SQL) Write DB (NoSQL)

    Cache (Redis) MSG Broker (Kafka) API Server (Rails) Logs Monitoring Tools 30
  14. “ “Logic Complexity is solved with abstraction. Process Complexity is

    solved with automation.” ~ I’m paraphrasing Uncle Bob 31
  15. Three Pillars of Good Software Team ◎ Conway's Law ◎

    Agile teams ◎ Autonomy Processes ◎ Collaboration ◎ Testing ◎ Releases Architecture ◎ Monolith ◎ Distributed ◦ Microservices 35
  16. Swarm ◎ Familiar API ◎ Built on building blocks ◎

    Optimized for speed ◎ Built-in load-balancing ◎ Volumes across containers ◎ Automatic Network Config ◎ Self-discovery within cluster 38 Swarm vs. Kubernetes Kubernetes ◎ Novel API ◎ Isolated Concept ◎ Optimized for resilience ◎ Manual load-balancing ◎ Volume within pods ◎ Manual Networking ◎ Containers muse identify