microservices pattern language – live blogging from spring days

Microservice s Pattern Language
Speaker: Chris Richardson – @crichardson
See list of all blog posts from conference

Modern software development:moving fast and not breaking things!
Do this with DevOps, Continuous Deployment/Delivery and small autonomous teams

Monolith

  • Not an anti-pattern because it makes sense at one point
  • Can deploy frequently at the beginning
  • Then it grows. Quickly
  • Then ball of mud
  • Get stuck with obsolete tech stack that used when started project

Microservices

  • Architectural styles
  • set of services
  • loosely coupled
  • organized around business capabilities
  • tackle complexity through modularization
  • Improved scalability is secondary (“monoliths can scale quite well”)
  • Each service has own private data store/schema (doesn’t need own database)

Benefits

  • Once agree on APIs cn develop with less communication and integration
  • Easier to understand develop/test
  • Less potential for jar hell
  • Start up time faster which imporves MTTR (mean time to recover)
  • Know who owns each service – with monolith, everyone is responsible so nobody really is
  • Can fail safely with new technology because only affects one service

Downside – Complexity

  • Now have messaging/remote calls
  • Deal with timeouts and partial failures – circuit breaker pattern
  • Multiple databases and transaction management – need series of local transactions
  • Queries more complicated – can’t just join with SQL. Need to call multiple APIs or replicate data
  • Need a lot of automation; a lot of production applications /services
  • New feature needs multiple services to be deployed in right order

Your monolith will grow forever and never get better. Automation makes microservices better. But need some automation as pre-req for successful microservices

Pattern language

  • To solve architectural problems
  • See patterns on microservices.io
  • Chris writing a book on the topic – currently available through Manning Early Access Program (MEAP)
  • Example of a pattern for dealing with querying data from multiple sources: CQRS – command query responsibility segregation – see CQRS pattern on web
  • Chris is still creating new patterns so remember to check back on the site

Overall, I like that more of the presentation was about microservices than the patterns themselves. It shows why this is important and gives the background to read the patterns. I like the patterns he chose to show.

spring boot and actuators – live blogging from spring days

Spring Boot and Actuators
Speaker: John Humphreys
See list of all blog posts from conference

Spring Boot

  • makes it easy to create standalone apps
  • opinionated view of which third party libraries to use
  • 9 lines of code to get coding
  • can embed Tomcat or Undertwo in your app
  • No Spring config needed as defaults
  • Makes uberwar
  • Add 1 lines to run war as init.d service
  • many integrations
  • only need two maven dterations

9 lines of code
the 9 lines of code to get started are an annotation and a one ine main method
SpringApplcation run (MyApp.class,args);
The other lines are imports/class name/braces/etc

Annotation
@SpringBootApplicatoin replaces need for many other common spring annotations

  • @Configuraton – define beans in Java
  • EnableAutoConfiguration – configure beans
  • @ComponentScan – search for and wire up classes

Add an endpoint to actually do something. map URLs and functionality

Spring Boot Inititialzr – enter dependencies you want online and it gives you a working spring boot web service without needing dependencies

Maven

  • spring-boot-starter-pom parent pom so can get started.
  • spring-boot-starter-web dependency for deploying to Tomcat
  • spring-boot-starter-actuator – for monitoring the application
  • spring-boot-starter-hateos- for adding monitoring as REST endpoint and in browser
  • spring-boot-maven-plugin – creates uber war. has option to embed init.d support by setting &ltexecutable>true</executable>
  • spring-boot-admin-server-ui – minotrs and lets interact with app – just flag with @EnableAdminServer, can expose with JMX

application.properties – lets override defaults

actuator

  • for monitoring
  • provides a lot of URLs by default and can add more of your own
  • Each cluster has own actuator
  • Masks passwords by default
  • Very customizable
  • Can show live thread dumps
  • Text based – use UI dependency to see graphically

Overall – cool to see it built live – pieces are easy to understand. I didn’tknow what n actuator was so learned that too. I’ve only een the very basics of Spring Boot so this was a great first talk for me to hear. An embedded Tomcat is interesting. Easy because one thing. Tomcat has frequent patches though so definitely would want continuous deployment!

Live Blogging from Spring Days New York

Tuesday

Wednesday

Overall comments:
I learned a lot so definitely worth attending! I would have liked a speaker “test your hardware opportunity” in the morning. Most of the speakers needed help to get settled.