Microservices and IBM Bluemix meetup presentation

Download Microservices and IBM Bluemix meetup presentation

Post on 12-Apr-2017




5 download


PowerPoint Presentation

Microservices and IBM BluemixTony ErwinBluemix UI ArchitectIBM Cloud Bluemixaerwin@us.ibm.com@tonyErwin

Carlos FerreiraPrinciple Technical Product ManagerIBM Cloud BluemixCarlos.Ferreira@us.ibm.com@carlosTweets

2015 IBM Corporation


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



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 coupledSmall and focused on completing one taskCommunication typically done through language-neutral APIs, typically an Hypertext Transfer Protocol (HTTP)-based resource API using REST2


Comparing monolithic and microservices architectures3


Benefits of microservices for developersEnables you to avoid large code base & easier to maintain or add to featuresUse existing skills, or the most optimal languageImproves deployment times and load times for IDEMakes debugging easierEnables teams to work more independently of each otherSimplifies tracking code dependenciesEnables complete ownership by a self-contained single team, from definition through development, deployment, operations, and sunsettingMakes it easier to scale bottlenecks4


Benefits of microservices for businessAgility easier to respond to new customer and market needs Allows for more frequent delivery and faster delivery times which means quicker feedback cycles and pivotingSmaller focused teams that align with business revenue and cost centers means:Improved productivityBetter visibility to where resources are allocatedUsage enables movement from low impact business areas to new or higher impact business areasBetter user experienceResponse times enabled by scaling individual microserviceAvailability enabled by resiliencyuser experienceEnables new business models API Economy5


Example business drivers6

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


Moving from monolithic applications to microservices7

Monolithic appMicro services


Benefits from microservices for operationsFewer reviews and approvals versus monolith applicationsEnables service management teams to more easily support multiple product and service teamsEnables automating deployment, logging, and monitoring practices across multiple microservice project teamsEasier to identify problems and get supportApplications become more resilient as you adopt a microservices architectural style8


Customers interviewed expect to realize a cost savings of 3 to 1 by automating much of the infrastructure and platform as a service (PaaS)


What to avoid9


Dontforget about DevOpsmanage your own infrastructurecreate too many microservicesmake services too granular or require too many dependencies10


Dont even think about microservices without DevOpsMicroservices cause an explosion of moving parts. It is not a good idea to attempt toimplement microservices without serious deployment and monitoring automation. You shouldbe able to push a button and get your app deployed. In fact, you should not even do anything.Committing code should get your app deployed through the commit hooks that trigger thedelivery pipelines in at least development. You still need some manual checks and balancesfor deploying into production. See Chapter 3, Microservices and DevOps on page 39 tolearn more about why DevOps is critical to successful microservice deployments.1.3.3 Dont manage your own infrastructureMicroservices often introduce multiple databases, message brokers, data caches, and similarservices that all need to be maintained, clustered, and kept in top shape. It really helps if yourfirst attempt at microservices is free from such concerns. A PaaS, such as IBM Bluemix orCloud Foundry, enables you to be functional faster and with less headache than with aninfrastructure as a service (IaaS), providing that your microservices are PaaS-friendly.1.3.4 Dont create too many microservicesEach new microservice uses resources. Cumulative resource usage might outstrip thebenefits of the architecture if you exceed the number of microservices that your DevOpsorganization, process, and tooling can handle. It is better to err on the side of larger services,and only split when they end up containing parts with conflicting demands for scaling,lifecycle, or data. Making them too small transfers complexity away from the microservicesand into the service integration task. Dont share microservices between systems.10

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



Design and test for failureMind-set shift: acceptance of the fact that isolated failures are inevitableDesign and test to keep the system functioning for as long as possiblePatterns:Circuit breaker - Fall back logic ensures failures do not adversely affect the entire systemBulkhead Partitioning to isolate other software and hardware based system failures12


Circuit Breaker pattern13


Bulkhead pattern14


Netflix Application Architecture

EdgeServicesHTTP APIAuthA/B TestsMember DataRecommendationsMovie DataRatingsSimilar MoviesNetwork BoundaryXBOXWeb SiteCall CentreAndroidIPhoneWiiPS3Client CodeClient Adapter CodeServer CodeDecompose application into many calls to microservicesDevice makes only one call to the API to minimise WAN latency

API Gateway pattern16


Interprocess communicationSynchronous HTTP-based mechanisms, such as Representational State Transfer (REST) or WebSockets, which enable keeping a communication channel between browser and server for request/responseAsynchronous messaging using a message broker or event driven17


Synchronous messaging is a simple and familiar mechanism, which is firewall-friendly. Thedisadvantage is that it does not support other patterns, such as a publish/subscribe model.The publish/subscribe messaging style is more flexible than point-to-point queuing, because itenables multiple receivers to subscribe to the flow of messages. This enables moremicroservices to be easily added on to the application.It also does not allow queuing of requests, which can act as a kind of shock absorber.Asynchronous messaging decouples the services from each other in time, enabling thesending thread to get on with work while the messaging system takes responsibility for themessage, keeping it safely until it can be delivered to the destination.With synchronous applications, both the client and server must be simultaneously available,and the clients always need to know the host and port of the server, which is not alwaysstraightforward when services are auto-scaling in a cloud deployment. In such scenarios, oneof the service discovery mechanisms described previously is required.Alternatively, an asynchronous mechanism uses a message broker, which decouples themessage consumers and producers. The message broker buffers messages until theconsumer is able to process them.A further benefit of messaging is that the back-end applications behind the queue candistribute workload among several clients. This type of worker offload scenario enablesdevelopers to build scalable, responsive applications. Implementing one or more instances ofa back-end worker application enables the putting application to continue its work without theneed to wait for the back-end application to complete.There are pros and cons to both approaches. Most applications use a combination of the twoapproaches to suit their needs.17

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 & DevOpsSummary of a microservice architecture



How is this different than service-oriented architecture?Are not discovered at run timeDo not require mediationBusiness motivation is focused on immediate ROI and not enterprise business tranformational or driven primarily by reuse



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



DevOpsIs 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 microservicesCommonly includes the following processes:Agile practices (http://agilemanifesto.org/principles.html)Continuous integrationRelease automationFunctional unit testingSystem integration testingService and infrastructure monitoringAPI microservice management21


Testing a complex system requires suites of unit and integration tests,and a testing framework that simulates failed or failing components,service degradation, stress testing, and the overall systems behaviorover the course of a typical day. Such test frameworks ensure systemcorrectness and its overall resilience, and in turn can be used as amonitoring tool.Because of the focus on ensuring that the system behaves well whena component fails, it is not uncommon to test failure in the productionenvironment in a microservices architecture. Automated tests thatforce a component to fail enable testing the ability of the system torecover, and testing the monitoring capabilities.Monitoring In addition to conventional monitoring systems, well-designed servicescan provide additional health check information usingpublish/subscribe over a messaging queue. In this way, informationcan be collected by the monitoring service, providing rich health andconfiguration indicators.These indicators in turn can be used to ensure that the services haveenough capacity to serve current request volume, and comparecurrent performance against expectations. Custom health checks canbe registered to gather additional data. All collection information canthen be aggregated, and displayed in the monitoring dashboard.DevOps The operations challenge of keeping microservices up and runningmeans that you need high-quality DevOps skills embedded within yourdevelopment team. The team needs to be operationally focused andproduction aware.21

Why DevOps is critical to the success of Microservices?Microservices = enable agility which means more apps and more frequent deploymentsWithout DevOps automation it become cost prohibitive to broadly adopt microservicesAutomation demands that there be standardizationPlatform as service enables standardization



What DevOps tasks can be automated?Provisioning infrastructure and configurationApplication deployment and database changesDevelopment driven testing including:Functional unit testsSystem integration testsUser acceptance testsPerformance testsSecurity testsControlled failure resiliency tests23


Service AService B

Client Side RoutingRuntime RegistryMetricsElastic Auto ScalingService BService BFault avoidancePlatform supported testing methodologiesCanary testing, A/B testingIncrementally move traffic to new service deployments

Fault IsolationFine grained decoupled services architectureClient library mediated external callse.g. enforced hygiene - separate request thread pool, standard approach for timeoutsStateless servicesDynamic routing to route around failurese.g. Circuit breakers

Fault DetectionMonitoring metrics for failuresClient 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 B1Elastic Auto ScalingService B1Service B1Real time metrics from client library on service failure and performanceAnalysis of metrics can result in service marked down circuit breakerService registry enables dynamic routing for load, canary test, circuit breaker1% traffic - Canary test for new service B implementation. Fast rollback if errors foundElastic AutoScale groups provide scale out and restart capabilitiesEdge ServiceEdge Service provides dynamic routing, load shedding, canary test, stress testCloud Native Approaches for ResilienceEmbrace Failure

Controlled failure resiliency tests25Trigger chaos events during business hoursPeople are around to a) respond to them and b) fix them. Decide what level of mystery you wantLog faiure test triggered event but not the details of the chaosSimulates 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 modesKilling process instances is just one way to simulate failure but doesnt cover all possible optionsNetwork failure, storage failures and othersEnable failure resiliency tests to be triggered via APIsDont trigger sequential eventsOne chaos event at a time and build it into you your schedulePlay around with the event probabilityEvents 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.


Microservice API managementEstablish 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 APIAccess controlsPlansThreshold limitsDesign guidanceAnalytics of usage and availabilityAvailability across public cloud, private cloud, on-premise, or multi geographic regions26


Good reads!!27

Automate d...