Top Banner
Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin
26

Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Dec 19, 2015

Download

Documents

Arleen Bennett
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Migrating a Monolithic App to Microservices on Cloud Foundry

Brian K. Martin, Bluemix Architect, @bkmartin

Tony Erwin, Bluemix UI Architect, @tonyerwin

Page 2: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Agenda

• Introduction to the Bluemix UI• Bluemix UI Microservices

Architecture• Features for Cloud Foundry to

Support Microservices

@bkmartin @tonyerwin

Page 3: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Agenda

• Introduction to the Bluemix UI• Bluemix UI Microservices

Architecture• Features for Cloud Foundry to

Support Microservices

@bkmartin @tonyerwin

Page 4: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

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 5: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Bluemix UIHome

Solutions (Marketing)

Pricing

Dashboard

Catalog

Orgs/Spaces

Page 6: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Bluemix UI 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 7: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Monolithic Architecture

HomeHome SolutionsSolutions CatalogCatalog DashboardDashboard PricingPricing Orgs/ SpacesOrgs/

Spaces

CF Cloud Controller (and other APIs)CF Cloud Controller (and other APIs)

SQL DBSQL DBBluemix UI Server

(Java)Bluemix UI Server

(Java)

Bluemix UI (Client)

Bluemix PaaS

Page 8: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

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 9: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Agenda

• Introduction to the Bluemix UI• Bluemix UI Microservices

Architecture• Features for Cloud Foundry to

Support Microservices

@bkmartin @tonyerwin

Page 10: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

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 11: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Phase 1

SolutionsSolutions

CatalogCatalog DashboardDashboard PricingPricing Orgs/ SpacesOrgs/

Spaces

CF Cloud Controller (and other APIs)CF Cloud Controller (and other APIs)

SQLDBSQLDB

Bluemix UI Server (Monolith)

Bluemix UI Server (Monolith)

Bluemix UI (Client)

Bluemix PaaS

ProxyProxy

CommonCommon

Session Store

Session Store No SQLNo SQL Msq

QueueMsq

Queue MonitorMonitor

HomeHome

Page 12: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Composition w/ Microservices

header

footer

inline

combined

CommonCommon

HomeHome

Page 13: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

End Goal

HomeHome SolutionsSolutions CatalogCatalog DashboardDashboardPricingPricing Orgs/ SpacesOrgs/

Spaces

CF Cloud Controller (and other APIs)CF Cloud Controller (and other APIs)

Bluemix UI (Client)

Bluemix PaaSProxyProxy

CommonCommon

Session Store

Session Store No SQLNo SQL Msq

QueueMsq

Queue MonitorMonitor

Page 14: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

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 15: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

An Approach for Blue-Green – Just Change Route on Proxy

Homehome-XXX.bluemix.net

Homehome-XXX.bluemix.net

Solutionssolutions-XXX.bluemix.net

Solutionssolutions-XXX.bluemix.net

Bluemix UI Server classic-XXX.bluemix.net

Bluemix UI Server classic-XXX.bluemix.net

ProxyProxy

Commoncommon-XXX.bluemix.net

Commoncommon-XXX.bluemix.net

HomeHome-YYY.bluemix.net

HomeHome-YYY.bluemix.net

Solutionssolutions-YYY.bluemix.net

Solutionssolutions-YYY.bluemix.net

Bluemix UI Server classic-YYY.bluemix.net

Bluemix UI Server classic-YYY.bluemix.net

ProxyProxy

Commoncommon-YYY.bluemix.net

Commoncommon-YYY.bluemix.net

RouterRouter

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

Page 16: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Agenda

• Introduction to the Bluemix UI• Bluemix UI Microservices

Architecture• Features for Cloud Foundry to

Support Microservices

@bkmartin @tonyerwin

Page 17: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Context Path Routing• bluemix.net/login ->

login.bluemix.net/login• bluemix.net/account ->

account.bluemix.net/account• To efficiently share user state and

allow individual microservices to be updated independently, we need a built-in ability to bind context paths to apps and have gorouter routing

Page 18: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Application Versions• CF has no formal concept of an

application version• Would it be helpful to add a formal

concept of version so that a given application name can have many versions installed formally

• Current way– myapp-1.0 myapp-1.1

• The app name may be constantly changing which is harder for mgmt, CMDB, etc

Page 19: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Advanced Routing Policies• When rolling out new versions of

microservices how can you control which users are routed to the new version?

• Advanced routing policies could allow policies like random selection of a percentage of the popultion, specific user groups, etc

Page 20: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

“Private” Applications

• An ability to hide microservices applications from public routing

• Applications to be declared public or private

• SDN for a space or org• How to authenticate/grant

access for routing

Page 21: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Composite Applications• What if you want to understand the

health and status of your complete microservice based application?

• A composite application could allow applications to be grouped for status and control (the latter seeming less useful)

• Could simplify blue-green deployment if multiple functions could be selected simultaneously

Page 22: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Service Registry

• Need a new way to discover the active endpoints for the microservices rather then hard coded paths and/or application names

• Service registry should have live status to allow fast failover to alternative services

Page 23: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Performance and Monitoring• When your application is broken

into many components, monitoring the performance and response time of each component becomes even more important to diagnose problems

• Common dashboards that can aggregate stats from many applications are required

Page 24: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Log Analysis for Problems

• Common log aggregation platforms (ELK) solve most of the problem but it has been hard to correlate across applications for a given user

• Solution: use common correlators across your microservices to track individual users

Page 25: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

Testing

• How to insure compatibility of microservices as they are being deployed

• Integrated to your CI/CD pipeline, but is there anything else that could be done?

Page 26: Migrating a Monolithic App to Microservices on Cloud Foundry Brian K. Martin, Bluemix Architect, @bkmartin Tony Erwin, Bluemix UI Architect, @tonyerwin.

IBM Bluemix

Free 30 day trial at http://www.bluemix.net

Email: [email protected]: @bkmartin

Email: [email protected]: @tonyerwin