Introduction to micro-services @DevOps pune Meetup

26
INTRODUCTION TO MICROSERVICE @DevOps Pune 13 th March 2016

Transcript of Introduction to micro-services @DevOps pune Meetup

Page 1: Introduction to micro-services @DevOps pune Meetup

INTRODUCTION TO MICROSERVICE

@DevOps Pune 13th March 2016

Page 2: Introduction to micro-services @DevOps pune Meetup

AGENDA Service Oriented Architectures Micro-services Architecture Why it is helpful Insights about Docker and MEAN Stack Role of Docker Demo (Micro-services based MEAN stack application on DOCKER)

Page 3: Introduction to micro-services @DevOps pune Meetup

WHO AM I? Cloud and DevOps Engineer DevOps by Profession and developer by Heart Blogger (oss-world.blogspot.in) Linkedin: https://in.linkedin.com/in/rahulkhengare

Page 4: Introduction to micro-services @DevOps pune Meetup

TARGET AUDIENCE Knowledge about web based applications Basics of Docker

Page 5: Introduction to micro-services @DevOps pune Meetup

SERVICE ORIENTED ARCHITECTURES

Page 6: Introduction to micro-services @DevOps pune Meetup

MONOLITHIC APPLICATION

UI Components

Business Logic

Database

User

Shopping Application

OS

Page 7: Introduction to micro-services @DevOps pune Meetup

MONOLITHIC All functionality is in single process Macro or single tier application Resides on single machine Front end, business logic and data access merged in single code

Page 8: Introduction to micro-services @DevOps pune Meetup

BENEFITS OF MONOLITHIC Easy to Develop Easy to Test Easy to Scale: Just run multiple instances of application on different servers Easy Deployment Process (just one war file in case of JAVA)

Page 9: Introduction to micro-services @DevOps pune Meetup

DRAWBACKS OF MONOLITHIC Manageability of code Difficult to deploy or rebuild Stuck with same technology stacks Scaling of Application Rigorous testing after change deployment Application Downtime

Page 10: Introduction to micro-services @DevOps pune Meetup

MICRO-SERVICES Composed of small, independent, narrowly-focused processes communicating with each other using language independent APIs Like UNIX commands, which are designed to do one single thing but can be piped together to perform some complex operations Loosely coupled, fine-grained, follows the Single Responsibility Principle Resource Independent Netflix, Amazon, LinkedIn, Groupon, PayPal, Airbnb, The Guardian are using already

Page 11: Introduction to micro-services @DevOps pune Meetup

MICRO-SERVICE APPLICATION

UI Component

sBusiness Logic

Inventory

User

Shopping Application

OS

UI Component

sBusiness Logic

OS

UI Component

sBusiness Logic

Cart/checkout

OS

UI Component

sBusiness Logic

Users

OS

LOAD BALANCER

Orders/shipping

Page 12: Introduction to micro-services @DevOps pune Meetup

WHY TO USE MICRO-SERVICES Technology agnostic Independent Rapid Deployment Helps replacing individual services using API Failure Isolation Scalability Flexibility

Page 13: Introduction to micro-services @DevOps pune Meetup

LETS BUILD MICRO-SERVICES

LO AD

BAL A N CER

1 MONOLITHIC APP ~ 100 MICRO-SERVICES

Page 14: Introduction to micro-services @DevOps pune Meetup

QUESTIONS?? How to architect my application? How to manage micro-services locally? How to ensure latest version of application? How to deploy them to production? What technology should I use?

Page 15: Introduction to micro-services @DevOps pune Meetup

TECHNOLOGY INSIGHTS

Page 16: Introduction to micro-services @DevOps pune Meetup

WHAT IS DOCKER Open Source Container Framework Helps developer or sysadmin to develop, ship, and run distributed applications Operating system level virtualization Container uses kernel features such as CGROUPS, NAMESPACES, SELINUX, AUFS Docker images are IMMUTABLE

Page 17: Introduction to micro-services @DevOps pune Meetup

VIRTUAL MACHINE VS DOCKER CONTAINER

Page 18: Introduction to micro-services @DevOps pune Meetup

DOCKER FLOW

Page 19: Introduction to micro-services @DevOps pune Meetup

HOW DOCKER HELP Docker Mission: Build, ship, run any application anywhere Use as platform for management of application containers Create a Docker container of your micro-services Run each micro-service in separate container Scaling is fun with Docker Use of Docker compose will stack your micro-service application as single application

Page 20: Introduction to micro-services @DevOps pune Meetup

MEAN STACK

Page 21: Introduction to micro-services @DevOps pune Meetup

DEMO

Page 22: Introduction to micro-services @DevOps pune Meetup

ONLINE TEST APP Docker Host

SERVERNGINX Docker

Test functionalitycontainer

MongoDB container

Security functionality

containerCLIENT APP Container

PORT 5000

PORT 80PORT 5002

PORT 5001

PORT 27017

Page 23: Introduction to micro-services @DevOps pune Meetup

TARGET APPLICATIONS Not suitable for simple applications Highly scalable applications Distributed functionality

Page 24: Introduction to micro-services @DevOps pune Meetup

CHALLENGES How to break application in micro-services Unmanageability Performance about series of dependent services Learning curve for new developer

Page 25: Introduction to micro-services @DevOps pune Meetup

ANY QUESTIONS??

Page 26: Introduction to micro-services @DevOps pune Meetup

THANK YOU!!