microservice architecture

Download MicroService Architecture

Post on 14-Jan-2015

13.081 views

Category:

Documents

4 download

Embed Size (px)

DESCRIPTION

SOA, service-­oriented architectures, burst on the scene in the new millennium as the latest technology to support application growth. In concert with the Web, SOA ushered in new paradigms for structuring enterprise applications. At the Forward Internet Group in London, we are implementing SOA in unusual ways. Rather than a few, business­related services being implemented per the original vision, we have developed systems made of myriads of very small, usually short­lived services. In this workshop, we will start by exploring the evolution of SOA implementations by the speaker. In particular, lessons learned from each implementation will be discussed, and re­application of these lessons on the next implementation. Challenges (and even failures) will be explicitly identified. We will arrive at a model of the current systems: An environment of very small services that are loosely coupled into a complex system. We explore the demise of acceptance tests in this complex environment, and the clever replacement of business metrics in their stead. Finally, we will conclude with the surprising programmer development process impacts of this architecture. Indeed, bedrock principles of Agile have been rendered unnecessary, something that equally surprised us. (Presented at Agile India 2013)

TRANSCRIPT

  • 1. Service Architecture:A Personal Journey of DiscoveryFred Georgefredgeorge@acm.org@fgeorge52Copyright 2012 by Fred George. All rights reserved. 1

2. In the Beginning...Copyright 2012 by Fred George. All rights reserved. 2 3. 2004:1M loc - Largest CertifiedJ2EE ApplicationCopyright 2012 by Fred George. All rights reserved. 3 4. It StartedWell...Martin Fowlerconsulted, thenjoined ThoughtWorksCopyright 2009 by Fred George 4 5. What I Found in 20041M locs2,000 tests70% success rate on Acceptance Test was AcceptableBug database with over 1000 entriesStill being changedNew tests almost non-existentCopyright 2012 by Fred George. All rights reserved. 5 6. Unit Test CountsCopyright 2012 by Fred George. All rights reserved. 6 7. assertNotNull (new Loan(50)); Easy (reasonably) unit test On Saturday without interruptions 5 hours later, it passed!Copyright 2012 by Fred George. All rights reserved. 7 8. 2004:1M loc - Largest CertifiedJ2EE Application100K loc trying to get outJeff BayCopyright 2012 by Fred George. All rights reserved.8 9. Why? What Happened?Sloppy Lazy? Technical DebtNo power to refuse!Inexperienced!Copyright 2012 by Fred George. All rights reserved. 9 10. Evolution...Copyright 2012 by Fred George. All rights reserved. 10 11. 2005: SOA in Chinese Bank Cash,Loans Mortgage InsuranceBalancesCopyright 2012 by Fred George. All rights reserved.11 12. Solution: Pub/Sube d Events publishedc tInterested applications subscribej eApplications then publish interaction requestsR eUI elements render appropriate interactionsCopyright 2012 by Fred George. All rights reserved. 12 13. 2004: 20051M loc - Largest CertifiedJ2EE Application20 5K loc trying to getout100K loc trying to get outCopyright 2012 by Fred George. All rights reserved. 13 14. 2005: Medical Systems Information NuggetsCopyright 2012 by Fred George. All rights reserved.14 15. From:CAT Scan About: Jane Doee d Urgency: Time: 23 Apr 2012 20:13:45Concern c t Summary Validity: 26 Apr 2012 20:13:45j eOnly relevantuntil...R eInformation NuggetsCopyright 2012 by Fred George. All rights reserved.15 16. 2005: Services forInvestment Managementp ePrototyping new system architecturet yoBaysian Service Principles (Jeff Bay)t Its okay to run more than one version at the sametimer oYou can only deploy one service at a time Decoupling result: Deploying 3 times a day! PCopyright 2012 by Fred George. All rights reserved. 16 17. 2006: Batch ProcessingReplacement OrdersClient needed to replace parts on cars Many variations based on car, location of carVendor estimated 15- months 18Unacceptable to businessCopyright 2012 by Fred George. All rights reserved. 17 18. 2006: Batch ProcessingReplacement OrdersCopyright 2012 by Fred George. All rights reserved. 18 19. Refined Packet Design ? Addr ? ? ?? ? ? ? VIN ? ?Date? ? ? Name ?Copyright 2012 by Fred George. All rights reserved.19 20. ? Addr ? ? ? ?dJoin TableeNeed VINNeed zzzInject aaa r kse e v ei wNeed AddrInject Namel e 9 DNeed NameNeed rrrInject VIN i nCopyright 2012 by Fred George. All rights reserved.20 21. New Observations andRevelationsServices are like Classes Small, crisp conceptualization Services got very tiny (100 loc)Smalltalk message passing perfect for servicesEncapsulation Database segregated among services w/o sharing Service publishes conclusions, not raw dataCopyright 2012 by Fred George. All rights reserved.21 22. New Problems andChallengesd ?WTF is going on ?r eCycles, lost packetsNeeded to redefine tracking, loggingv eInexperienced team in defining serviceslApproach compromised in Release 2 i D e Won award at TW Tech Day... for being a bad idea!Copyright 2012 by Fred George. All rights reserved. 22 23. 2004: 2005 20061M loc - Largest CertifiedJ2EE Application 200 500 loc20 5K loc trying to getoutCopyright 2012 by Fred George. All rights reserved. 23 24. Experiences at...Copyright 2012 by Fred George. All rights reserved. 24 25. 2007: Forward Needs toMonitor AdWords Accountse dtPub/sub model based on Linda Spaces (tuples)Segregate databases to servicescDefine agent services for each usereStart to automate activities and recommendationsjOff-shore for implementationsolutionR e CTO killed it (former Oracle executive)Replaced with a more traditional, SQL DB-drivenCopyright 2012 by Fred George. All rights reserved. 25 26. 2008: CardWalle dFront-end automated Card Wall in Agilee rBack-end emerged as a set of services analyzing datai vl One service, one role D Migrated to Hadoop Cluster as it grewePost alerts (with recommendations) to usersCopyright 2012 by Fred George. All rights reserved. 26 27. New Observations andRevelationsServices became disposableLoosely coupled via RESTful Json packets or DB Albeit still knowledgeable about flowSelf-monitoring services replaces Unit TestsBusiness monitoring replaces Acceptance TestsServices language-agnosticCopyright 2012 by Fred George. All rights reserved. 27 28. Current State...Copyright 2012 by Fred George. All rights reserved. 28 29. Copyright 2012 by Fred George. All rights reserved. 29 30. Copyright 2012 by Fred George. All rights reserved. 30 31. Design: Events, not EntitiesCopyright 2012 by Fred George. All rights reserved. 31 32. Design: History, not CurrentCopyright 2012 by Fred George. All rights reserved. 32 33. Legacy SystemWebWeb Services ServicesETL/Biz Biz Data Muddling DataData ReportingCopyright 2012 by Fred George. All rights reserved. 33 34. Cloud of SignalsEmail Read PostcodeEmail Address NamePostal Address Server Load URL RequestCopyright 2012 by Fred George. All rights reserved.34 35. Data Ecosystem ProducersKafka ConsumersPostal AddressApp RAppHiveService Email Address MonitoringWeb ServerURL Request Apps/3rd Party ServicesNameWeb HooksCopyright 2012 by Fred George. All rights reserved.35 36. Cross-sell TrackingCopyright 2012 by Fred George. All rights reserved. 36 37. User Paths Through SiteCopyright 2012 by Fred George. All rights reserved. 37 38. Agile Best Practices Not UsedTrust w Stand ups collocation Unit testsStory narratives Acceptance testsSmall,Retrospectives Refactoringshort-livedEstimates PatternsappsResults,Iterationsnot blame Continuous integrationMandatory pairingContinuousdeploymentCopyright 2012 by Fred George. All rights reserved. 38 39. What About Technical Debt? Sloppy Lazy?Technical Debt No power to refuse!Inexperienced!Copyright 2012 by Fred George. All rights reserved.39 40. Conclusions (so far)...Copyright 2012 by Fred George. All rights reserved. 40 41. Summary Principles ofServicesVery, very smallLoosely coupled (including flow)Multiple versions acceptable (encouraged?)Self-execution monitoring of each servicePublish interesting stuff (w/o requirement)Application seems to be poor conceptualizationCopyright 2012 by Fred George. All rights reserved. 41 42. Living Software SystemLong-lived system; short-lived services (human body)Extremely dynamic with continuous deployments 5- minutes between deployments typical10Accept it is complex (especially for testing) Acceptance test on business outcomes insteadRadical impact to processes (Anarchy)There will be a learning curve for developers!Copyright 2012 by Fred George. All rights reserved. 42 43. Service Architecture:A Personal Journey of DiscoveryFred Georgefredgeorge@acm.org@fgeorge52Copyright 2012 by Fred George. All rights reserved. 43