Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

A Shift from Monolith to Microservice using Docker

325 Aufrufe

Veröffentlicht am

Presented this to the students of Vellore Institute of Technology on 18-March-2019.

Veröffentlicht in: Technologie
  • Real Ways To Make Money, Most online opportunities are nothing but total scams! ★★★ https://tinyurl.com/y4urott2
    Sind Sie sicher, dass Sie …  Ja  Nein
    Ihre Nachricht erscheint hier
  • Gehören Sie zu den Ersten, denen das gefällt!

A Shift from Monolith to Microservice using Docker

  1. 1. Introduction to Docker
  2. 2. $whoami Principal Development Engineer at DellEMC 1st half of my career was in CGI & VMware 2nd half of my career has been in System Integration Testing Docker Captain (since 2016) Docker Bangalore Meetup Organizer ( 7600+ Registered Users) Founder of DockerLabs Ajeet Singh Raina Twitter: @ajeetsraina GitHub: ajeetraina
  3. 3. - My Personal Blog website - Built on WordPress, Hosted on One.com - Recently Completed 4th Year - 175+ blogs on Docker | Kubernetes | Cloud - Monthly close to 1 million visitors per month $curl www.collabnix.com
  4. 4. - A Shift from Monolithic to Microservices Architecture - Traditional Software Development Workflow(with/without Docker) - What is Docker? What problem does it solve for us? - Docker Vs Linux Containers - Docker Vs Virtual Machine - Docker Underlying Technology - Running Your First Docker Container - Demo - Using Docker: Build, Ship and Run Workflow - Demo - Building Your Docker Image using Dockerfile - Demo Agenda – Morning Session
  5. 5. - Introduction to Docker Networking - Introduction to Docker Swarm - How Docker Swarm Mode works? - Running Web Application using Docker Swarm Mode - Demo - Test Drive Docker & Docker Swarm on Raspberry Pi – Let’s make it happen ! - How to contribute towards Docker Community? Agenda – Afternoon Session
  6. 6. A Shift from Monolithic to Microservice Architecture
  7. 7. A Close Look at Monolithic Browser Client App Storefront UI Module Catalog Module Reviews Module Orders Module HTML REST/JSON Database
  8. 8. A Close Look at Monolithic Browser Client App Storefront UI Module Catalog Module Reviews Module Orders Module WAR Tomcat HTML REST/JSON Database
  9. 9. Simple to Develop, Test, Deploy & Scale - Simple to develop because of all the tools and IDEs support to that kind of application by default. - Easy to deploy because all components are packed into one bundle. - Easy to scale the whole application. Benefits of Monolith
  10. 10. Successful Application keep growing.. - Very difficult to maintain - One component failure will cause the whole system to fail. - Very difficult to understand and create the patches for monolithic applications. - Adapting to new technology is very challengeable. - Take a long time to startup because all the components need to get started. Disadvantages of Monolith
  11. 11. Today - Apps are constantly developed - Built from loosely coupled components - Newer version are deployed often - Deployed to a multitude of servers Customer/ Clients/ Users Data Storage Data Storage Data Storage
  12. 12. Microservice Architecture Catalog Service Reviews Service Order Service … Service Catalog Database Reviews Database Order Database … Database API Gateway Storefront UI Browser Mobile Device REST REST HTML REST
  13. 13. - Can scale independent microservices separately. No need to scale the whole the system - Can use the latest technologies to develop the microservices. - One component failure will not cause entire system downtimes. - When developing an overall solution we can parallel the microservices development task with the small teams. So it helps to decrease the development time. Benefits of Microservices
  14. 14. Once upon a time…a Software Stack
  15. 15. Now much more distributed & complex…
  16. 16. Let’s start with simple analogy.. You are a shipping company
  17. 17. Let’s start with simple analogy.. The customer asked you to ship potatoes
  18. 18. Let’s start with simple analogy.. Hence, you said “BIG YES” and you fitted it with pianos
  19. 19. Let’s start with simple analogy.. Another customer asked to ship bottles of liquor
  20. 20. Let’s start with simple analogy.. Things goes really mess up when liquor spill over your pianos
  21. 21. Let’s start with simple analogy.. Your employed crew is worried how to handle all these differences
  22. 22. Problem Statements.. - Size of goods - Forms of goods Requirement is to keep it safe and stable during the transport
  23. 23. What shall we do?
  24. 24. An Effort to solve the problem Complexity
  25. 25. Every possible good to ship X Every Possible way to Ship
  26. 26. Enter….Internodal Container
  27. 27. That’s what Docker is all about..
  28. 28. What is Docker and what problem does it solve?
  29. 29. Docker is an open software development platform which help you to Build, Ship and Run your applications along with all its dependencies allowing portability among any system ranging from small IoT device like Raspberry Pi, Desktop, Workstation, Server to the Cloud.
  30. 30. • Standardized packaging for software and dependencies • Isolate apps from each other • Share the same OS kernel • Works for all major Linux distributions • Containers native to Windows Server 2016 & 1809 What is Docker?
  31. 31. What is Docker? Refers to several things in 2019  Docker as a “Company”  Docker as a “Product”  Docker as a “Platform”  Docker as a “CLI Tool”  Docker as a “Computer Program”
  32. 32. Docker Presence
  33. 33. History of Docker  A Company as well as Product – 6 Years Old company Developed by DotCloud Inc. ( Currently Docker Inc.) A Framework they built their PaaS upon. Released it as open source 3 and 1/2 years back Cross-platform nature and friendliness towards System Admin and Developers Possible to set up in any OS, be it Windows, OSX, Linux, Solaris - It work the same way  Guaranteed to run the same way - Your development desktop, a bare-metal server, virtual machine, data center, or cloud
  34. 34. Today Docker runs on
  35. 35. Docker Vs Linux Container
  36. 36. Docker hold just 5% of whole Container Code
  37. 37. Docker Vs Linux Container Docker Linux Containers Implementation of kernel-sharing applications isolation technology which is not VM. Popularly refers to LXC. It delivers containers that include a complete Linux system, much like VM, with its own file system, networking and multiple applications Encourages applications to be broken down into their separate processes and provides tools to do that. Its granular approach Uses an init system that can manage multiple processes. Entire app runs as one. Docker used LXC in the past but replaced it with Containerd. Containerd is used for single application containers LXC is able to run multiple applications inside system containers
  38. 38. Traditional Software Development WorkFlow (without Docker)
  39. 39. Traditional Software Development WorkFlow (with Docker)
  40. 40. Docker Vs VM
  41. 41. Docker Containers are NOT VMs
  42. 42. Virtual Machine
  43. 43. Containers
  44. 44. Docker Container Vs VM
  45. 45. Comparing Docker & VM Virtual Machines Docker Each VM runs its own OS Container is just a user space of OS Boot up time is in minutes Containers instantiate in seconds VMs snapshots are used sparingly Images are built incrementally on top of another like layers. Lots of images/snapshots Not effective diffs. Not version controlled Images can be diffed and can be version controlled. Docker hub is like GITHUB Cannot run more than couple of VMs on an average laptop Can run many Docker containers in a laptop. Only one VM can be started from one set of VMX and VMDK files Multiple Docker containers can be started from one Docker image
  46. 46. Docker Vocabulary
  47. 47. Image Layers Kernel Alpine Linux Install Python and Pip Upgrade Pip Copy Requirements Install Requirements …
  48. 48. Basic Docker CLIs Pulling Docker Image $ docker pull ajeetraina/hellowhale Listing out Docker Images $ docker image ls Running Docker Containers $ docker run –d –p 5000:5000 –-name hellowhale ajeetraina/hellowhale Stopping the container $ docker stop hellowhale (or <container id>)
  49. 49. Using Docker – Build, Ship & Run WorkFlow
  50. 50. Build. Ship. Run.
  51. 51. - Create DockerHub Account(if not completed) - Open https://play-with-docker.com - Hello World Example - Build Your First Docker Image & Push it to DockerHub Demo
  52. 52. Building Docker Containers & Microservices
  53. 53. Introducing Dockerfile Series of instructions to build Docker Images
  54. 54. Dockerfile – Example
  55. 55. Each Dockerfile creates a Layer 69 Kernel Alpine Linux Install Python and Pip Upgrade Pip Copy Requirements Install Requirements …
  56. 56. - Building Nginx Server using Dockerfile Demo
  57. 57. Compose is a tool for defining and running multi-container Docker applications Docker Compose
  58. 58. Reference  https://github.com/collabnix/dockerlabs  https://docs.docker.com  http://www.collabnix.com
  59. 59. - Introduction to Docker Networking - Introduction to Docker Swarm - How Docker Swarm Mode works? - Running Web Application using Docker Swarm Mode - Demo - From Local Desktop to Cloud in 5 Minutes - Demo - Test Drive Docker & Docker Swarm on Raspberry Pi – Let’s make it happen ! - Demonstrating Cool Docker Projects - Demo - 5 Tips to become Docker Captain - How to contribute towards Docker Community? Agenda – Afternoon Session
  60. 60. Introduction to Docker Networking
  61. 61. Why do we need Docker networking?
  62. 62. Getting Started with Docker Swarm
  63. 63. Let’s start with Single Docker Host A Docker Host http://collabnix.com/getting-started-with-docker-swarm/
  64. 64. You start adding more hosts.. http://collabnix.com/getting-started-with-docker-swarm/
  65. 65. But Wait.. Service Discovery Scalability High Availability Failure Management Scheduling Rolling Updates Container Security
  66. 66. Docker Swarm comes for rescue.. http://collabnix.com/new-docker-1-12-comes-with-built-in-distribution-orchestration-system/
  67. 67. What is Swarm Mode? • A swarm consists of one or more nodes: physical or virtual machines running Docker Engine. • It was introduced first under Docker 1.12 release. • It enables the ability to deploy containers across multiple Docker hosts, using overlay networks for service discovery with a built-in load balancer for scaling the services. http://collabnix.com/docker-1-12-swarm-mode-under-the-hood/
  68. 68. Building Docker Swarm Topology
  69. 69. Introduction to Docker Networking
  70. 70. Building Swarm Cluster on Raspberry Pi Running Portainer on Raspberry Pi Demo
  71. 71. Thank You