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

Container and microservices: a love story

Container and microservices: a love story

Qual'è la prima cosa che ti viene in mente se ti chiedessi di associare "container" e "architetture" ? Esatto ! Container e microservizi sono di fatto gli argomenti più chiacchierati degli ultimi anni e che spesso vanno a braccetto. Ma quand'è che i due mondi iniziano ad incontrarsi, se non nel tuo computer? Ti porterò la mia esperienza sul uso dei container per lo sviluppo di un applicativo con architettura a microservizi, partendo dalle scelte fatte fin dai primi momenti dello sviluppo fino ad arrivare alla sua messa in produzione.

Avatar for Thomas Rossetto

Thomas Rossetto

November 11, 2017

More Decks by Thomas Rossetto

Other Decks in Technology

Transcript

  1. MICROSERVICE’S PROS ▸ Relatively small ▸ Improve fault isolation ▸

    Develop & deploy independently ▸ Improves tuning & scaling CONTAINER AND MICROSERVICES: A ❤ STORY
  2. ▸ Additional complexity of a distributed system ▸ Testing is

    more complex ▸ Internal process for communication purpose ▸ A bad APIs design it’s very dangerous ▸ Development environment it’s hard to setup CONTAINER AND MICROSERVICES: A ❤ STORY MICROSERVICE’S CONS
  3. CONTAINER AND MICROSERVICES: A ❤ STORY Simulates isolate systems Usable

    in more OS Ready to use Easy to install Easy to use
  4. CONTAINER AND MICROSERVICES: A ❤ STORY Simulate isolate systems Usable

    in more OS Ready to use Easy to install Easy to use
  5. CONTAINER AND MICROSERVICES: A ❤ STORY DOCKER FOR MAC/WINDOWS Docker

    for Mac/Windows is an easy-to-install desktop app for building, debugging and testing Dockerized apps on a Mac/PC.
  6. CONTAINER AND MICROSERVICES: A ❤ STORY Simulate isolate systems Usable

    in more OS Ready to use Easy to install Easy to use
  7. CONTAINER AND MICROSERVICES: A ❤ STORY DOCKER IMAGE FROM ruby

    RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails File: ./my_app/Dockerfile
  8. CONTAINER AND MICROSERVICES: A ❤ STORY DOCKER IMAGE FROM ruby

    RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails File: ./my_app/Dockerfile
  9. CONTAINER AND MICROSERVICES: A ❤ STORY DOCKER IMAGE FROM ruby

    RUN apt-get update -qq && apt-get install -y build- essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails File: ./my_app/Dockerfile
  10. CONTAINER AND MICROSERVICES: A ❤ STORY DOCKER IMAGE FROM ruby

    RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails File: ./my_app/Dockerfile
  11. CONTAINER AND MICROSERVICES: A ❤ STORY DOCKER IMAGE FROM ruby

    RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /my_app WORKDIR /my_app RUN gem install rails File: ./my_app/Dockerfile
  12. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  13. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  14. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  15. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  16. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  17. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  18. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  19. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  20. CONTAINER AND MICROSERVICES: A ❤ STORY version: '3' services: web:

    build: ./my_app command: bash -c "bundle install --path=/cache && rails s -p 3000 -b '0.0.0.0'" ports: - "4000:3000" volumes: - ./my_app/my_rails_app:/myapp - ./my_app/gem_cache:/cache depends_on: - db db: image: postgres DOCKER COMPOSE File: ./docker-compose.yml
  21. CONTAINER AND MICROSERVICES: A ❤ STORY ▸ Microservices ▸ Docker

    compose ▸ How portable and repeatable development environment save your time! …WHAT HAVE WE SEEN TODAY?
  22. CONTAINER AND MICROSERVICES: A ❤ STORY SO, WHY I’M IN

    ❤? ▸ Microservices architecture gave me a new point of view ▸ Thanks to microservices, I found a way to use and understand containers ▸ Life is too short for waste your time
  23. “YOUR WORK IS GOING TO FILL A LARGE PART OF

    YOUR LIFE, AND THE ONLY WAY TO BE TRULY SATISFIED IS TO DO WHAT YOU BELIEVE IS GREAT WORK. AND THE ONLY WAY TO DO GREAT WORK IS TO LOVE WHAT YOU DO.” STEVE JOBS CONTAINER AND MICROSERVICES: A ❤ STORY