MODERN IT ARCHITECTURE
2 ABOUT ME
3 ABOUT ME
AGENDA 1. KEY CONCEPTS Microservices, containers, etc. 2. HOLISTIC VIEW Making businesses agile 3. ARCHITECTURE Faster, flatter, and more flexible 4. LAB MATERIALS Hands-on workshop 4
REST API WHAT ARE MICROSERVICES? CLIENT SERVICE CONTAINER Small, autonomous services that work together. DATASTOR E CONTAINER 5
HOW SMALL IS SMALL? As Robert C. Martin put it: Gather together those things that change for the same reason, and separate those things that change for different reasons. 6 http://bit.ly/2rnzusz
WHAT IS A CONTAINER? A container image is a lightweight, stand-alone, executable package of a piece of software that includes their entire runtime environment all of the files necessary to run: Programing language System tools Libraries, settings, etc. 7
8 CONTAINERS ARE BORING
2000 2005 2010 2015 CONTAINER HISTORY 2008: LINUX CONTAINER PROJECT (LXC) 2013: DOTCLOUD BECOMES DOCKER 2000: JAILS ADDED TO FREEBSD 2003: SELINUX ADDED TO LINUX MAINLINE 2006: GENERIC PROCESS CONTAINERS 2008: KERNEL AND USER NAMESPACES 2013: RED HAT ENTERPRISE LINUX 2015: RHT CONTAINER PLATFORM 2001: LINUX -VSERVER PROJECT 2005: FULL RELEASE OF SOLARIS ZONES 2007: GPC RENAMED CONTROL GROUPS 2013: DOTCLOUD PYCON LIGHTNING TALK 2014: GOOGLE KUBERNETES 2015: STANDARDS VIA OCI AND CNCF 9
1 0 REST API REST API REST API REST API REST API BUT, ENABLE TRUE MICROSERVICES CLIENT CLIENT CLIENT CLIENT CLIENT SERVICE NodeJS Service Spring Boot Service JBoss EAP Service Tomcat Service CONTAINER CONTAINER CONTAINER CONTAINER CONTAINER DATASTOR E JBoss DG Datastore MySQL Datastore PostgreSQL Datastore MongoDB Datastore CONTAINER CONTAINER CONTAINER CONTAINER CONTAINER
1 1 MICROSERVICES ARE JUST SOA 2.0? Monolith SOA MSA
1 2 MICROSERVICES ARE NOT A TECH-ONLY DISCUSSION
CONWAY S LAW Organizations which design systems... are constrained to produce designs which are copies of the communication structures of these organizations 1 3 http://bit.ly/2sqmc1r
HOW WILL YOU ACHIEVE ORGANIZATION AGILITY? SOA/ ESB DevOps Eventdriven Microservices API 14
WHAT IS A MICROSERVICES ARCHITECTURE (MSA)? 1 5 http://bit.ly/2suuabg
1 6 PRINCIPLES AND PRACTICES Independence aids agility Modeled around business domains Culture of automation (DevOps) Isolate deployment and configuration changes (independence) Control costs more effectively (scaling) Release independently (deployment) Adopt technology more quickly (polyglot) Antifragile - increased robustness and resilience under pressure API / contract focused (promises) Decentralized data management
1 7 BENEFITS OF MSA? FAST TIME TO MARKET EFFICIENCY SCALABILITY Small autonomous services can be developed and delivered faster Automating delivery and monitoring of small services is easier Fine grained scalability is easier and uses less resources
1 8 REST API REST API REST API REST API CHALLENGES OF MSA? CLIENT CLIENT CLIENT CLIENT HOW DO I MANAGE THIS? NodeJS Service Spring Boot Service JBoss EAP Service Tomcat Service CONTAINER JBoss DG Datastore CONTAINER MySQL Datastore CONTAINER PostgreSQL Datastore CONTAINER MongoDB Datastore CONTAINER CONTAINER CONTAINER CONTAINER
!? 1 9 http://bit.ly/2sttwxs
2 0 WE NEED STANDARDS! How is incomplete or outdated documentation handled? How are new services integrated into the ecosystem? What if a downstream service you call takes longer than normal to respond? What action do you take? What is a good citizen service in your system? How should all services emit health and general monitoring-related metrics? Mandate connection pooling? Circuit breaker criteria? What about build, test, deploy, and release? Etc...
2 1 http://bit.ly/2sqbrd8
2 2 http://bit.ly/2snfcrd
2 3 http://bit.ly/2snbrch
2 4 It s about finding the right BALANCE between both CULTURE and TOOLS
2 5 CONTAINER APPLICATION PLATFORM Self-Service Standards-based Multi-language Web-scale Automation Collaboration Seamless Secure Open Source Enterprise Grade
CONTAINER DEPLOYMENT & MANAGEMENT OpenShift Container Platform provides features like: Deploy Independently CI/CD (DevOps) Scale Independently Antifragile Release Independently Polyglot 26
27 POLYGLOT
SETUP WORKSHOP ENVIRONMENT
Workshop Material http://naps-redhat.com/ Login Credentials http://naps-redhat.com/files/lab_info.xlsx OpenShift Console 1 OpenShift Console 2 https://master.ocp.naps-redhat.com:8443/console/ https://master.ocp.lab-emergent360.com:8443/console/ 29 Remote Desktop 1 Remote Desktop 2 Remote Desktop 3 Remote Desktop 4 Remote Desktop 5 https://85.190.181.16/guacamole/#/ https://31.220.69.63/guacamole/#/ https://85.190.177.63/guacamole/#/ https://85.190.180.29/guacamole/#/ https://153.92.39.111/guacamole/#/
COOLSTORE APPLICATION
3 1 COOLSTORE APPLICATION Online shop for selling products Web-based polyglot application using AngularJS Node Java with multiple frameworks (Spring, Java EE, etc) Microservices architecture Deployed using containers
3 2 COOLSTORE MICROSERVICES
3 3 COOLSTORE MSA Web UI Angular NodeJS Coolstore Gateway JBoss FIS Inventory Service JBoss EAP Catalog Service JWS Cart Service JBoss EAP PSQL PSQL
LAB 1 DEPLOYING A FAST-MOVING MONOLITH
SOURCE CONTROL MANAGEMENT 2 clone 1 fork Developer commit Developer Git Repository 3 4 pull request Project Git Repository 35
OPS DEV BUILDING CONTAINER IMAGES WITH SOURCE-TO-IMAGE (S2I) CODE Git Repository code BUILD Source-to-Image (S2I) Container Image Image Registry DEPLOY Application Container deploy 36
DEPLOY CODE WITHOUT BUILD DELAYS OpenShift write code JBoss Developer Studio rsync HotSwap Spring Boot Service CONTAINER Developer Shell rsync HotSwap JBoss EAP Service CONTAINER 37
BUILDING QUALITY INTO THE PROCESS 2 clone 1 fork Developer commit Developer Git Repository 3 4 pull request Project Git Repository review pull request 5 6 merge pull request Code Reviewer 38
CONTINUOUS DELIVERY PIPELINE Inventory TEST git push Team Git Repo Build JAR Build docker Image Deploy to INV TEST Run Tests in INV TEST CoolStore TEST CoolStore PROD Deploy to TEST Run Tests in in TEST Deploy to PROD (no traffic) Go Live Switch Production Traffic Approve? 39
END TO END ENVIRONMENT CONSISTENCY VCS (Git) JBDS Run Build CDK Nexus (Library Management) Deployment Pipeline Jenkins Test Automatic Testing Developer s Local Env (laptop, desktop) Release management 40
LAB 2 STRANGLING THE MONOLITH
STRANGLING THE MONOLITH DESIGN PATTERN Strangling - incrementally replacing functionality in app with something better (cheaper, faster, easier to maintain). As functionality is replaced, dead parts of monolith can be removed/retired. You can also wait for all functionality to be replaced before retiring anything! You can optionally include new functionality during strangulation to make it more attractive to business stakeholders. Time 42 http://paulhammant.com/2013/07/14/legacy-application-strangulation-casestudies
LAB 3 MICROSERVICE INTEGRATION PATTERNS
CLIENT AGGREGATION BENEFITS No development bottleneck on the server / ESB-style funnel Reuse of functionality DRAWBACKS Network bandwidth Unfriendly protocols - web proxies, ports, etc. Unnecessarily complicated 44
CHAINING BENEFITS Client code simpler - there is only one single entry into the chain Less network bandwidth DRAWBACKS Cascading failures Complex stack traces when things go wrong Exposes internal structure of application logic 45
Client SERVICE RESILIENCE PATTERN microservice API JBoss Fuse microservice API JBoss Fuse microservice API JBoss Fuse microservice API microservice microservice API microservice SLOW!! Chain reaction 46
API GATEWAY BENEFITS Encapsulates internal structure Less chatty network traffic Simplified client code DRAWBACKS Bottlenecking with the addition of new services 47
API GATEWAY MICROSERVICE COMPOSITION Auto-detects routes Application Container Camel route Camel Spring Boot Starter Configurations Auto-configure Camelcontext, register Camel utilities Auto-wires components Tomcat, Undertow JDBC Messaging (application.properties/yml) 48
THANK YOU plus.google.com/+redhat facebook.com/redhatinc linkedin.com/company/red-hat twitter.com/redhatnews youtube.com/user/redhatvideos
MICROSERVICES ARE NOT A TECH-ONLY DISCUSSION
VALUE OF SERVICE 51 51
IT COMMODITIZATION 52 52
Hystrix Fallback Slow! API Service Timeout microservice API JBoss Fuse No response! SaaS <camelcontext xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="direct:start"/> <hystrix> <to uri="http://fooservice.com/slow"/> <onfallback> <transform> <constant>fallback message</constant> </transform> </onfallback> </hystrix> <to uri="mock:result"/> </route> </camelcontext> 53
5 4 COOLSTORE APPLICATION Web UI NodeJS Coolstore Gateway JBoss FIS Turbine Server Hystrix Dashboard Inventory Service JBoss EAP Catalog Service JWS Cart Service JBoss EAP PSQL MongoDB
EVENT-DRIVEN MICROSERVICES SERVICE ROUTE SERVICE Rebalance traffics Redirect request to available Pods POD POD POD Health Checks periodically performs diagnostics on a running container. POD POD Replace failing pod Starts another pod and bind to service 55
Twitter FB Salesforce XML JSON HL7... RED HAT JBOSS FUSE REST API microservice Resource Connector Database Msg Broker SaaS. HTTP Kafka. Netty FTP 160+ Smart Endpoints. 56
RED HAT JBOSS FUSE microservice Enterprise Integration Patterns microservice microservice microservice microservice 57
3Scale API management API microservice by RED HAT JBOSS FUSE Swagger API Doc Exposes REST DSL External clients Community, Partners, Customers Consume API Data Format Transform microservice by RED HAT JBOSS FUSE microservice by RED HAT JBOSS FUSE 58
59
60 Inventory
Inventory Catalog 61
62
63
BLUE/GREEN DEPLOYMENT PART 1 CI/CD PIPELINE Approve? Deploy PROD (no traffic) Go Live Switch Traffic On deploy new version Inventory Green Inventory Blue Router 64
BLUE/GREEN DEPLOYMENT PART 2 CI/CD PIPELINE Approve? Deploy PROD (no traffic) Go Live Switch Traffic On Inventory Green switch production traffic Inventory Blue Router 65
6 6 * Field survey conducted by ActualTech Media of more than 1,200 IT professionals with regard to their thoughts around Software-defined storage (SDS) and Human-computer interaction (HCI).
Agile Integration Distributed Integration Lightweight Pattern Based Reusable Connectors Community Sourced Container Cloud native solutions Lean artifacts, individually deployable Container based scaling and high availability Cloud native solutions Lean artifacts, individually deployable Container based scaling and high availability API Well defined, reusable, and well managed end-points Ecosystem leverage Flexibility Scalability Re-Usability 67