Transcript
Page 1: Microservices and IBM Bluemix meetup presentation

© 2015 IBM Corporation

Microservices and IBM Bluemix

Tony ErwinBluemix UI ArchitectIBM Cloud [email protected]@tonyErwin

Carlos FerreiraPrinciple Technical Product ManagerIBM Cloud [email protected]@carlosTweets

Page 2: Microservices and IBM Bluemix meetup presentation

2#IBMBluemix

Agenda

• The motivation for when to use or not use Microservices• Elements of a Microservice architecture • Why DevOps is critical to the success of Microservices?• Key capabilities required to develop Microservices in Bluemix• Re-architecting the Bluemix UI with a microservices architecture

Page 3: Microservices and IBM Bluemix meetup presentation

3#IBMBluemix

What are microservices?

• Is an architecture style, in which large complex software applications are composed of one or more services.

• Can be deployed independently of one another and are loosely coupled

• Small and focused on completing one task• Communication typically done through language-neutral APIs,

typically an Hypertext Transfer Protocol (HTTP)-based resource API using REST

Page 4: Microservices and IBM Bluemix meetup presentation

4#IBMBluemix

Comparing monolithic and microservices architectures

Page 5: Microservices and IBM Bluemix meetup presentation

5#IBMBluemix

Benefits of microservices for developers

• Enables you to avoid large code base & easier to maintain or add to features

• Use existing skills, or the most optimal language• Improves deployment times and load times for IDE• Makes debugging easier• Enables teams to work more independently of each other• Simplifies tracking code dependencies• Enables complete ownership by a self-contained single team,

from definition through development, deployment, operations, and sunsetting

• Makes it easier to scale bottlenecks

Page 6: Microservices and IBM Bluemix meetup presentation

6#IBMBluemix

Benefits of microservices for business

• Agility easier to respond to new customer and market needs • Allows for more frequent delivery and faster delivery times

which means quicker feedback cycles and pivoting• Smaller focused teams that align with business revenue and

cost centers means:• Improved productivity• Better visibility to where resources are allocated• Usage enables movement from low impact business areas to

new or higher impact business areas• Better user experience

• Response times enabled by scaling individual microservice• Availability enabled by resiliency• user experience

• Enables new business models – API Economy

Page 7: Microservices and IBM Bluemix meetup presentation

7#IBMBluemix

Example business drivers

See interview with Stefan Piesche CTO to see Constant Contact’s motivation for adopting microservices: https://www.youtube.com/watch?v=oKMGObPMvBw

Page 8: Microservices and IBM Bluemix meetup presentation

Moving from monolithic applications to microservices

8

Monolithic app Micro services

Scaling Scaling

Page 9: Microservices and IBM Bluemix meetup presentation

9#IBMBluemix

Benefits from microservices for operations

• Fewer reviews and approvals versus monolith applications• Enables service management teams to more easily support

multiple product and service teams• Enables automating deployment, logging, and monitoring

practices across multiple microservice project teams• Easier to identify problems and get support• Applications become more resilient as you adopt a

microservices architectural style

Page 10: Microservices and IBM Bluemix meetup presentation

10#IBMBluemix

What to avoid

Page 11: Microservices and IBM Bluemix meetup presentation

11#IBMBluemix

Don’t…

• forget about DevOps• manage your own infrastructure• create too many microservices• make services too granular or require too many dependencies

Page 12: Microservices and IBM Bluemix meetup presentation

12#IBMBluemix

Agenda

• The motivation for when to use or not use Microservices• Elements of a Microservice architecture • Why DevOps is critical to the success of Microservices?• Key capabilities required to develop Microservices in Bluemix• How Microservices are utilized to design and implement

Bluemix

Page 13: Microservices and IBM Bluemix meetup presentation

13#IBMBluemix

Design and test for failure

• Mind-set shift: acceptance of the fact that isolated failures are inevitable

• Design and test to keep the system functioning for as long as possible

• Patterns:• Circuit breaker - Fall back logic ensures failures do not

adversely affect the entire system• Bulkhead – Partitioning to isolate other software and hardware

based system failures

Page 14: Microservices and IBM Bluemix meetup presentation

14#IBMBluemix

Circuit Breaker pattern

Page 15: Microservices and IBM Bluemix meetup presentation

15#IBMBluemix

Bulkhead pattern

Page 16: Microservices and IBM Bluemix meetup presentation

Netflix Application Architecture

EdgeServices

Auth A/B Tests

Member Data

Recommendations

Movie Data Ratings Similar

Movies

Network Boundary

XBOX Web Site Call Centre Android IPhone Wii PS3

Client Code

Client Adapter Code

Server Code

• Decompose application into many calls to microservices

• Device makes only one call to the API to minimise WAN latency

Page 17: Microservices and IBM Bluemix meetup presentation

17#IBMBluemix

API Gateway pattern

Page 18: Microservices and IBM Bluemix meetup presentation

18#IBMBluemix

Interprocess communication

• Synchronous HTTP-based mechanisms, such as Representational State Transfer (REST) or WebSockets, which enable keeping a communication channel between browser and server for request/response

• Asynchronous messaging using a message broker or event driven

Page 19: Microservices and IBM Bluemix meetup presentation

#IBMBluemix

• Focused business capability

• Cross-functional teams

• Communication via API ONLY!!

• Decoupled & asynchronous using messaging / events to remove peer-to-peer dependencies

• REST communication

• Decentralized & isolated data

• Designed and tested for failure

• Evolutionary design with pluggable architecture

• Enabled by continuous delivery & DevOps

Summary of a microservice architecture

Page 20: Microservices and IBM Bluemix meetup presentation

20#IBMBluemix

How is this different than service-oriented architecture?

• Are not discovered at run time• Do not require mediation• Business motivation is focused on immediate ROI and not

enterprise business tranformational or driven primarily by reuse

Page 21: Microservices and IBM Bluemix meetup presentation

21#IBMBluemix

Agenda

• The motivation for when to use or not use Microservices• Elements of a Microservice architecture • Why DevOps is critical to the success of Microservices?• Key capabilities required to develop Microservices in Bluemix• Re-architecting the Bluemix UI with a microservices architecture

Page 22: Microservices and IBM Bluemix meetup presentation

22#IBMBluemix

DevOps

• Is the set of concepts, practices, tools, and team organizational structures that enable organizations to more quickly release new capabilities to their clients. Organizations that adopt DevOps are more easily able to release and monitor their microservices

• Commonly includes the following processes:• Agile practices (http://agilemanifesto.org/principles.html)• Continuous integration• Release automation• Functional unit testing• System integration testing• Service and infrastructure monitoring• API microservice management

Page 23: Microservices and IBM Bluemix meetup presentation

23#IBMBluemix

Why DevOps is critical to the success of Microservices?

• Microservices = enable agility which means more apps and more frequent deployments

• Without DevOps automation it become cost prohibitive to broadly adopt microservices

• Automation demands that there be standardization• Platform as service enables standardization

Page 24: Microservices and IBM Bluemix meetup presentation

24#IBMBluemix

What DevOps tasks can be automated?

• Provisioning infrastructure and configuration• Application deployment and database changes• Development driven testing including:

• Functional unit tests• System integration tests• User acceptance tests• Performance tests• Security tests• Controlled failure resiliency tests

Page 25: Microservices and IBM Bluemix meetup presentation

Service A

Service B

Client Side Routing

Runtime Registry

Metrics

Elastic Auto Scaling

Service B Service B

Fault avoidancePlatform supported testing methodologies

Canary testing, A/B testingIncrementally move traffic to new service deployments

Fault IsolationFine grained decoupled services architectureClient library mediated external calls

e.g. enforced hygiene - separate request thread pool, standard approach for timeouts

Stateless servicesDynamic routing to route around failures

e.g. Circuit breakers

Fault DetectionMonitoring metrics for failures

Client library for external calls provides failure and performance metrics

RecoveryDynamic routing to route around failuresFast roll forward / rollback between versions

Cloud Native applications require new set of capabilities from Cloud PlatformNew “middleware” to enable cloud native applications e.g. Netflix OSS, Twitter FinagleAddress gap between IaaS/PaaS capabilities and platform needed by cloud native applications

Service B1

Elastic Auto Scaling

Service B1 Service B1

Real time metrics from client library on service failure and performance

Analysis of metrics can result in service marked down – circuit breaker

Service registry enables dynamic routing – for load, canary test, circuit breaker

1% traffic - Canary test for new service B implementation. Fast rollback if errors found

Elastic AutoScale groups provide scale out and restart capabilities

Edge Service

Edge Service provides dynamic routing, load shedding, canary test, stress test…

Cloud Native Approaches for Resilience“Embrace Failure”

Page 26: Microservices and IBM Bluemix meetup presentation

26#IBMBluemix

Controlled failure resiliency tests

Trigger chaos events during business hours• People are around to a) respond to them and b) fix them. Decide what level of mystery you want• Log faiure test triggered event but not the details of the chaos• Simulates a real outage because in the initial stages you need to triage the

monitoring and alerts to see where the failures are but it means that everyone knows to look out for strange things.

Have several failure modes• Killing process instances is just one way to simulate failure but doesn’t cover all

possible options• Network failure, storage failures and others• Enable failure resiliency tests to be triggered via APIsDon’t trigger sequential events• One chaos event at a time and build it into you your schedulePlay around with the event probability• Events should be infrequent and random and there may be none triggered for

several days. • Helps to test your on-call response to keep the unexpected nature of these

kinds of events real.

Page 27: Microservices and IBM Bluemix meetup presentation

27#IBMBluemix

Microservice API management

• Establish a practice for publishing, promoting and overseeing microservice application programming interfaces (APIs) in a secure, scalable environment.

• Capabilities include:• Creation of end user support resources that define and

document the API• Access controls• Plans• Threshold limits• Design guidance• Analytics of usage and availability• Availability across public cloud, private cloud, on-premise, or

multi geographic regions

Page 28: Microservices and IBM Bluemix meetup presentation

Good reads!!

28

Automate deployments using production-like environments and accelerate delivery cycles

A view into the cultural challenges of adopting DevOps and best practices Patterns for building resilient

and robust applications with Bluemix

Page 29: Microservices and IBM Bluemix meetup presentation

29#IBMBluemix

Agenda

• The motivation for when to use or not use Microservices• Elements of a Microservice architecture • Why DevOps is critical to the success of Microservices?• Key capabilities required to develop Microservices in

Bluemix• Re-architecting the Bluemix UI with a microservices architecture

Page 30: Microservices and IBM Bluemix meetup presentation

30

BenefitsMost control in the cloud.Necessary for some solutions.Infrastructure managed by SP.

Infrastructure as a ServiceCustomer Managed

Service Provider Managed

~ Days

Time CommitmentMinutes to provision VM.Time to configure software and apps varies.Maintenance/upgrades of OS, middleware, runtime.

IBM SoftLayer

Timing is critical…

~ Minutes

Code

Data

Runtime

Middleware

OS

Virtualization

Servers

Storage

Networking

~ Weeks

Core IT

Today’s apps must keep up with the speed of the app revolution.

Time to initial deployment

Page 31: Microservices and IBM Bluemix meetup presentation

31

~ Minutes

Platform as a ServiceCustomer Managed

Service Provider Managed

IaaS

BenefitsSetup environments and deploy apps very quickly.Infrastructure and platform managed by SP.

Time CommitmentMinutes to setup and deploy.Focus on your apps and their data.

Timing is critical…

~ Weeks

IBM Bluemix

~ Days

Time to initial deployment

Code

Data

Runtime

Middleware

OS

Virtualization

Servers

Storage

Networking

Core IT

Today’s apps must keep up with the speed of the app revolution.

Page 32: Microservices and IBM Bluemix meetup presentation

32#IBMBluemix

Foundational services

• Compute: Cloud Foundry, Containers and Virtual Images • Autoscale groups• Elastic load balancing• Runtime registry, load balancing, dynamic routing• Developer services – IDE, build, image creation & deployment• Canary testing, A/B testing and rolling upgrade• Metrics, monitoring, logging information for all service

invocations• Message queues• Event notifications and triggering actions• Orchestrate and coordinate the REST-based services• API management

*Some services aren’t available on Bluemix

Page 33: Microservices and IBM Bluemix meetup presentation

More openness and choice than ever before

33

You choose how you build, deploy, and manage your apps. Bluemix takes care of the rest.

ComputeChoose the level of infrastructure abstraction based on your app’s architectural needs.

Dev ToolingFrom editors to source code management to continuous delivery, you can use Bluemix’ powerful tooling or easily bring your own.

LocationDeploy apps to Bluemix Public (in a growing number of geos), your own dedicated cloud Bluemix, or one that runs within your data center (Local*).

ServicesPick from a catalog of IBM, third party, open source, or your own services to extend your apps.

IBM

Third Party

Open Source

Yours

Page 34: Microservices and IBM Bluemix meetup presentation

34#IBMBluemix

Bluemix Compute

Page 35: Microservices and IBM Bluemix meetup presentation

#IBMBluemix

Docker Containers— separation of concerns

Dan the DeveloperWorries about what’s “inside” the container• His code• His Libraries• His Package

Manager• His Apps• His Data

All Linux servers look the same

Oscar the Ops GuyWorries about what’s “outside” the container• Logging• Remote access• Monitoring• Network config

All containers start, stop, copy, attach, migrate, etc. the same way

Page 36: Microservices and IBM Bluemix meetup presentation

36#IBMBluemix

VMs vs Containers

AppA

Hypervisor (Type 2)

Host OS

Server

GuestOS

Bins/Libs

AppA’

GuestOS

Bins/Libs

AppB

GuestOS

Bins/Libs

VM

GuestOS

GuestOS A

pp A’

Host OS

Server

Bins/Libs

App A

Bins/Libs

App B

App B

App B

App B

’Container

Containers are isolated,but share OS and, whereappropriate, bins/libraries

…faster, less overhead

Page 37: Microservices and IBM Bluemix meetup presentation

#IBMBluemix

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1Appv1

Original

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1Appv1

Trial Ramp-down

Servicev1

Servicev1

Servicev1AppV2

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1Appv1

Ramp-up

The successor receives production traffic. It starts with low traffic and is ramped up during testing phase.

The original is disabled but available for instant roll-back.

The original group is scaled down and the successor continues as the new version.

Rolling deployments

1. 2.

4.3.

Instance Groups

Active Group – routing enabled

In-Active Group – routing disabled

Appv2

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1Appv2

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1

Servicev1Appv2

Servicev1

Servicev1

Servicev1Appv1

Up

Down

RoutedTraffic

Page 38: Microservices and IBM Bluemix meetup presentation

#IBMBluemix

Quick update propagationInformed resolutionFlexible resolution methods

Service Discovery – Bluemix Catalog

Page 39: Microservices and IBM Bluemix meetup presentation

39

IBM Enterprise Containers on Bluemix

Automate the build of Docker images

Manage and distribute Docker images in private image registries

Easily host containers in the cloud

Scale and auto-recovery built-in

Logging and Monitoring built-in

Page 40: Microservices and IBM Bluemix meetup presentation

Application Scaling & High Availability

Page 41: Microservices and IBM Bluemix meetup presentation

Monitor your apps in real time

41

Integrated diagnostics for detailed application behavior.

Page 42: Microservices and IBM Bluemix meetup presentation

42

Logging

Page 43: Microservices and IBM Bluemix meetup presentation

IBM Bluemix DevOps Services – Delivery Pipeline

• Integration test, System test, Production

• Automation ensures the same procedure in each environment

• Fully hosted, managed, and integrated in the cloud for the cloud

• Deploy to Bluemix Button

Page 44: Microservices and IBM Bluemix meetup presentation

#IBMBluemix

Delivery Pipeline for Containers on Bluemix

IBM ContainerImage Build

Service

Image Registry

Page 45: Microservices and IBM Bluemix meetup presentation

45#IBMBluemix

IBM Workload Scheduler

Page 46: Microservices and IBM Bluemix meetup presentation

46#IBMBluemix

IBM API Management

Page 47: Microservices and IBM Bluemix meetup presentation

47#IBMBluemix

Agenda

• The motivation for when to use or not use Microservices• Elements of a Microservice architecture • Why DevOps is critical to the success of Microservices?• Key capabilities required to develop Microservices in Bluemix• Re-architecting the Bluemix UI with a microservices

architecture

Page 48: Microservices and IBM Bluemix meetup presentation

48#IBMBluemix

IBM Bluemix

• IBM Bluemix:• Open-standards, cloud platform for building, running,

and managing apps• PaaS layer built on CloudFoundry

• Bluemix UI is the front-end, providing an alternative to the CF command line

Page 49: Microservices and IBM Bluemix meetup presentation

49#IBMBluemix

Bluemix UI on Bluemix: Nexus of the Universe?

Jerry: “What street are you on?”Kramer: “I'm on First and First. How can the same street intersect with itself? I must be at the Nexus of the Universe!”

Page 50: Microservices and IBM Bluemix meetup presentation

50#IBMBluemix

Bluemix UI – Major Sections

Home

Solutions (Marketing)

Pricing

Dashboard

Catalog

Orgs/Spaces

Page 51: Microservices and IBM Bluemix meetup presentation

51#IBMBluemix

Bluemix UI – Originally a Monolith

• Single-page application (SPA) to provide desktop-like experience in the browser

• All HTML, CSS, and JavaScript loaded within single web page and served from a single Java app

• State-of-the-art not all that long ago• Dojo + J2EE was the most common stack in IBM

when Bluemix UI dev started• SPA still popular (AngularJS, Ember.js etc.)

Page 52: Microservices and IBM Bluemix meetup presentation

52#IBMBluemix

Monolithic Architecture

Home Solutions Catalog Dashboard Pricing Orgs/ Spaces

CF Cloud Controller (and other APIs)

DB/2Bluemix UI Server

(Java)

Bluemix UI (Client)

Bluemix PaaS

Page 53: Microservices and IBM Bluemix meetup presentation

53#IBMBluemix

Challenges of Monolith

• How can we improve performance?• Volume of client-side requests create bottlenecks

• How do we integrate code from other teams using different stacks?

• How can we push smaller changes as they are ready?• Where do we find developers with Dojo experience?• How can we improve SEO?

Page 54: Microservices and IBM Bluemix meetup presentation

54#IBMBluemix

Promises of Microservices• Aids migration to more modern, lighter-weight stack without starting over• Improves performance and developer productivity

• Small services optimized for speed and page size– Use simplest approach that works– Bare bones HTML, CSS, JS– Node.js w/ Dust.js server-side templates

• Easier to find answers on Google, easier to find skilled developers• Allows more regular updates as loosely-coupled services can deploy at their

own schedule• Teams use stack of their choosing• Teams don’t have to wait on others

• Leads to improved SEO• Proxy facilitates “clean” URLs• Server side generation results in crawlable content

• Improves cross-team UI consistency via microservice composition

Page 55: Microservices and IBM Bluemix meetup presentation

55#IBMBluemix

Migration Phase 1

Solutions

Catalog Dashboard Pricing Orgs/ Spaces

CF Cloud Controller (and other APIs)

DB/2Bluemix UI

Server (Monolith)

Bluemix UI (Client)

Bluemix PaaS

Proxy

Common

IBM Data Cache

Cloudant NoSQL DB

Monitoring Framework

Home

Page 56: Microservices and IBM Bluemix meetup presentation

56#IBMBluemix

Composition w/ Microservices

header

footer

inline

combined

Common

Home

Page 57: Microservices and IBM Bluemix meetup presentation

57#IBMBluemix

Migration End Goal

Home Solutions Catalog DashboardPricing Orgs/ Spaces

CF Cloud Controller (and other APIs)

Bluemix UI (Client)

Bluemix PaaSProxy

Common

IBM Data Cache

Cloudant NoSQL DB

Monitoring Framework

Page 58: Microservices and IBM Bluemix meetup presentation

58#IBMBluemix

New Challenges

• More moving parts, more complexity• Collecting federated status, monitoring health of the

system• Seamless navigation with existing monolith• Developer skills (need to learn new stack, but will

ultimately be more productive)• Blue-green deployments

Page 59: Microservices and IBM Bluemix meetup presentation

59#IBMBluemix

Approach for Blue-Green –Change Route on Proxy

Homehome-XXX.bluemix.net

Solutionssolutions-XXX.bluemix.net

Bluemix UI Server classic-XXX.bluemix.net

Proxy

Commoncommon-XXX.bluemix.net

HomeHome-YYY.bluemix.net

Solutionssolutions-YYY.bluemix.net

Bluemix UI Server classic-YYY.bluemix.net

Proxy

Commoncommon-YYY.bluemix.net

Go Router

console.ng.bluemix.net console-YYY.ng.bluemix.net

Page 60: Microservices and IBM Bluemix meetup presentation

© 2015 IBM Corporation

Thank you!

Questions?


Top Related