Microservice platforms are finally becoming a reality: Mesos, Kubernetes, and a whole bunch of PaaS-style offerings are available, but the reality is that these platforms still don’t provide everything you need in order to build a fully functional microservice ecosystem. Come to this session to learn about the essential deployment, orchestration, and glue components that often have to be self-assembled. The presentation begins by looking at deployment techniques and tools and examines where to test (QA, staging, or production), how to test (integration and contracts), and how to separate deployment and release. It then discusses orchestration, configuration, and service discovery. Finally it looks at essential glue such as logging, monitoring, and alerting.
2. Today
• What is a ‘microservice ecosystem’?
• Local dev of services becomes challenging
• Think about your build pipeline(s)
• Testing requires a paradigm shift
• Push to production as early as possible
24/11/2016 @danielbryantuk
3. @danielbryantuk
• Chief Scientist at OpenCredo, CTO at SpectoLabs
ü Transforming organisations through technology and teams
ü Agile, Lean, Architecture, CI/CD, DevOps
ü Microservices, cloud, Containers, Java, Go, Docker, Kubernetes
• London Java Community Associate
• Adopt OpenJDK and JSR
• InfoQ Editor, DZone MVB, VOXXED, O'Reilly
24/11/2016 @danielbryantuk
4. My Biggest Claim to Fame in Microservices?
24/11/2016 @danielbryantuk
6. So, What is a microservice?
“Loosely coupled service oriented architecture
with bounded contexts”
Adrian Cockcroft
“Applications that fit in your head”
James Lewis
24/11/2016 @danielbryantuk
7. Why? The move towards Cloud-native
• Hypothesis-driven business (and development)
• Microservice architecture (and 'Micro' teams)
• Devops mindset/culture (shared, learning/feedback & Mechanical sympathy)
• Continuous delivery
• Automated, self-service platform
Hat tip @caseywest
24/11/2016 @danielbryantuk
13. What do I mean by ‘ecosystem’?
• Build
– Local development, pipelines and integration
• Test
– From local integration to End-to-end
• Deploy
• Operate
• Observe
– Monitoring/logging/alerting
24/11/2016 @danielbryantuk
14. Don’t forget about (RE)ArchitecturE Complexity
24/11/2016 @danielbryantuk
16. What do I mean by ‘ecosystem’?
• Build
– Local development, pipelines and integration
• Test
– From local integration to End-to-end
• Deploy
• Operate
• Observe
– Monitoring/logging/alerting
24/11/2016 @danielbryantuk
19. Developing Locally
• The naive approach
– Replication of env per service
– …and dependencies and data stores and...
– Soon gets crazy
• Local profiles + mocking/stubbing
– Spring profiles + Mockito etc
24/11/2016 @danielbryantuk
23. Key lesson learned (the Hard Way)
• Push through to production as early as possible!
• Detect and fix issues
– Technology
– Process
– People
24/11/2016 @danielbryantuk
30. My Opinions
• BDD critical paths throughout application
– Including API journey
• Contract tests (failure is a conversation)
• BDD services API (e.g. Serenity BDD)
• Component test and unit test (as normal)
– Maven surefire/failsafe
24/11/2016 @danielbryantuk
31. Final Words on Testing
• Don’t forget the ‘ilities”
• Security / reliability
– ZAP (from the OWASP team)
– github.com/continuumsecurity/bdd-security
• Performance / scalability
– Jmeter (Jenkins Performance plugin)
– Gatling
– flood.io
24/11/2016 @danielbryantuk
36. Building Blocks
• HashiCorp Terraform
– VMWare? cloud-init and vcloud-tools
– “Boot my secure government cloud”
• “CAPS”
– Chef, Ansible, Puppet, SaltStack
– Automated sysadmin
• Docker / Ami / RPM / JAR
– Machine vs Os/lang artifact
• Standardise on an OS
– Amazon Linux vs mainstream distros
24/11/2016 @danielbryantuk
44. Start with the Basics
• Health checks
– Coda Hale (DropWizard) Metrics
– Spring Boot actuator
• KPIs for apps (and business)
– Assertions / invariants
– Throughput
– Queue length
24/11/2016 @danielbryantuk
45. Logging
• What every engineer should know
• 10 Tips for Proper Application Logging
• ElasticSearch-Logstash-Kibana (ELK)
– Buffer/proxy log sending or…
– Mount directory into container
24/11/2016 @danielbryantuk
46. Monitoring
• Push
– Spring Boot actuator e.g. InfluxDbExporter
• Pull
– E.g. Telegraf (shout to Tareq Abedrabbo)
• InfluxDB vs prometheus vs graphite vs
opentsdb
• Information radiators
– Aggregate vs individual
24/11/2016 @danielbryantuk
51. Summary
• development of 3+ services is challenging
• Think about your build pipeline(s)
• Testing requires a paradigm shift
• Operations requires much more automation
• Push through to prod as early as possible
24/11/2016 @danielbryantuk
54. Logging vs monitoring
• Logging
– Primarily used post-incident
– Machine readable
– Hard to do right
– Noise/signal
• Monitoring
– Useful in Real time during incident
– Trend analysis
– Easier to do
24/11/2016 @danielbryantuk