240 likes | 514 Views
Extinction of Dinosaurs -> Rise of Microservices. Dinosaurs. What were they like? Big Heavy Clumsy Ancient Why did they extinct ? Massive asteroid impact Catastrophic effect on an environment Haven‘t adapted fast enough They didn't have a space program ;-). A little bit of context.
E N D
Dinosaurs • What were they like? • Big • Heavy • Clumsy • Ancient • Why did they extinct? • Massive asteroid impact • Catastrophic effect on an environment • Haven‘t adapted fast enough • They didn't have a space program ;-)
A little bit of context • Enterprise Applications • Client-side user interface • HTML pages and javascript • Running on user’s machine • Server-side application • Handle HTTP requests • Execute domain logic • Access database • Select and populate HTML • Database
Monolith vs. Microservices • Monolith • All functionality in single process • Scales by replicating the monolith • Microservices • Every element of functionality in a separate process • Scales by replicating services
What is it? “Java, the Unix way” -- James Lewis @ 33rd Degree 2012 “Fine grained SOA” -- Adrian Cockcroft (Netflix)
What is it? • Set of small services • Separate processes • Lightweight communication • Organized around business capabilities • Independently deployable • Scalable
Services not Libraries • Component – independently replaceable and upgradeable • Libraries • Components linked in a program • Called using in-memory function calls • Services • Independently deployable and runnable • Called using web service request or RMC – more expensive • More explicit component interface
Dumb pipes and smart endpoints • Dumb pipes • Lightweight communication • HTTP or lightweight messaging • “Be of the web, not behind the web” -- Ian Robinson • Smart endpoints • As decoupled and cohesive services as possible • Doing routing and choreography decisions
Component types • Clients • Business components • Handlers • Data access components
Single component modules • Schema • OXM • Component • Server
Integrations • Interface versioning • Tolerant Reader • “Be conservative in what you do, be liberal in what you accept from others.” -- Jon Postel • Consumer-Driven Contracts • Error Handling • Client vs. Server exceptions
Supporting functions • Logging & traceability • Unique Process Call ID • salsa.OrderManager#enterOrder.ProductManager#validateOrder • Client Trace ID • 4aacef0f2a69469d:-36fc953d:1449aee3f22:5730 • Monitoring • JMX & Rest • Info, stats, probes • Centralized configuration
Pros vs. Cons Summary Pros • Microservice is „small“ • Can be deployed independently • Development scalability • Improved fault isolation • Eliminates long-term commitment to a technology Cons • Complexity of distributed system • Testing • Inter-service communication • Distributed transactions • Coordination between teams (?) • Management and deployment complexity • Resources consumption
Questions? About microservices and things we do, carnivorous plants, chameleons, crickets, ground worms or dinosaurs?
Frameworks • JCore • Spring, Spring WS • Hibernate / JPA • Embedded Jetty • Liquibase • Constretto
Decentralized Governance • Use right language for the job • Tools prior written-down standards • Checkstyle, FindBug, SonarQube
Organized around Business Capabilities “Any organization that designs a system will produce a design whose structure is a copy of the organization's communication structure.” -- Melvyn Conway, 1967
Traditional organization • Focus on technology layer • Changes lead to cross team projects • Logic is forced to “home” layer – logic everywhere
Infrastructure & Automation • Git on Gerrit • Every component is separate project • Build pipeline • Gerrit -> staging -> peer reviews -> merge build • Automate deployments and testing • System “configuration” verification and propagation