Building Resilient
Microservices
Gurpreet S. Sachdeva
Aricent
Who AM I?
• Java / Cloud Technology Enthusiast
• Director – Technology @ Aricent, Gurgaon
• Co-Founder Delhi/NCR JUG
• I blog @ www.thistechnologylife.com
• Java Code Geek partner
• @gssachdeva
• https://www.linkedin.com/in/gurpreets
Microservices Evolution
https://www.morpheusdata.com/blog/2014-10-24-the-new-rea
What Exactly is a Microservice
The term "Microservice Architecture" has sprung up over
the last few years to describe a particular way of designing
software applications as suites of independently
deployable services. While there is no precise definition of
this architectural style, there are certain common
characteristics around organization around business
capability, automated deployment, intelligence in the
endpoints, and decentralized control of languages and
data.
http://martinfowler.com/articles/microservices.html
Microservice Properties
Microservice Polyglot Architecture
OPERATIONAL MATURITY IS VITAL
http://martinfowler.com/bliki/MicroservicePrereq
uisites.html
• Not all monoliths are bad applications
Traditional Application Architecture
• Easy to
• Develop, Test, Deploy
Scale Cube
Y-Axis Scaling
• Apply X-axis and Z-axis scaling to each service
independently
• Partitioning Strategies
• Noun
• Verb
• SRP
• Unix Utilities
Conway’s Law
“Organizations which design systems ... are constrained to
produce designs which are copies of the communication
structures of these organizations”
-Melvin Conway, 1968
Can your teams be organized around microservices
Popular Examples
http://techblog.netflix.com
~ 600 services
http://highscalability.com/amazon-
architecture
100-150 services to build a page
http://www.addsimplicity.com/downlo
ads/eBaySDForum2006-11-29.pdf
http://queue.acm.org/detail.cfm?
id=1394128
Monolith First
http://martinfowler.com/bliki/MonolithFirst.html
Microservices – Inner & Outer
Architecture
Microservices – Inner & Outer
Architecture
Facets of Monitoring
12 Factor App Principles
Design for Failure
• Failure will ALWAYS occur
• Dependent services may be unavailable
or too slow to respond
• Horizontal clustering
• Resilience Patterns to the rescue
• CicuitBreaker, Bulkhead, Caching,
Timeout, Retry, Messaging, etc.
Netflix OSS Projects
Over 100 NetflixOSS projects @ netflix.github.com
Cloud Foundry to Rescue
• Many moving parts
• Orchestration => Cloud Foundry
Data Strategy
• Multiple microservices NOT to share the same database
model and perform updates on it
• Separation of at least read/write access
• Ideally: Separate data stores for each service
Inter-Service Communication
• In a monolith architecture, most of the communication is
synchronous
• Synchronous communication
• Mostly REST is used, Other choices: Protocol Buffers,
thrift
• May require asynchronous communication as well
• ZeroMQ, RabbitMQ, Kafka
How to Test?
http://martinfowler.com/articles/microservice-testing
Continuous Delivery
• Reliable Software Releases through Build,
Test and Deployment Automation
• DONE = Shippable into Production
Continuous Integration Tool Set
Prepare for DevOps
Devops (From Verticals to
collaborative teams)
Spring Boot
• Opinionated Spring application architecture - Convention
over Configuration
• Production-ready features, externalized configuration,
metrics and health checks
• Spring Cloud – Umbrella project for cloud connectors, on
top of Spring Boot
Take Aways
Microservices aren’t micro!
Everything comes at a price
No framework is a silver bullet
THANK YOU

Building Resilient Microservices

Editor's Notes

  • #8 Problem starts when Technical debt builds up Hard to change without breaking stuff Expensive QA & test cycles Long term commitment to a technology stack