building resilient microservices

29
Building Resilient Microservices Gurpreet S. Sachdeva Aricent

Upload: indicthreads

Post on 06-Apr-2017

370 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Building Resilient Microservices

Building Resilient Microservices

Gurpreet S. SachdevaAricent

Page 2: Building Resilient Microservices

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

Page 4: Building Resilient Microservices

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

Page 5: Building Resilient Microservices

Microservice Properties

Page 6: Building Resilient Microservices

Microservice Polyglot Architecture

Page 7: Building Resilient Microservices

OPERATIONAL MATURITY IS VITALhttp://martinfowler.com/bliki/MicroservicePrerequisites.html

• Not all monoliths are bad applications

Page 8: Building Resilient Microservices

Traditional Application Architecture

• Easy to• Develop, Test, Deploy

Page 9: Building Resilient Microservices

Scale Cube

Page 10: Building Resilient Microservices

Y-Axis Scaling

• Apply X-axis and Z-axis scaling to each service independently

• Partitioning Strategies• Noun• Verb• SRP• Unix Utilities

Page 11: Building Resilient Microservices

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

Page 12: Building Resilient Microservices

Popular Examples

http://techblog.netflix.com ~ 600 serviceshttp://highscalability.com/amazon-architecture 100-150 services to build a pagehttp://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf http://queue.acm.org/detail.cfm?id=1394128

Page 13: Building Resilient Microservices

Monolith Firsthttp://martinfowler.com/bliki/

MonolithFirst.html

Page 14: Building Resilient Microservices

Microservices – Inner & Outer Architecture

Page 15: Building Resilient Microservices

Microservices – Inner & Outer Architecture

Page 16: Building Resilient Microservices

Facets of Monitoring

Page 17: Building Resilient Microservices

12 Factor App Principles

Page 18: Building Resilient Microservices

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.

Page 19: Building Resilient Microservices

Netflix OSS Projects

Over 100 NetflixOSS projects @ netflix.github.com

Page 20: Building Resilient Microservices

Cloud Foundry to Rescue• Many moving parts• Orchestration => Cloud Foundry

Page 21: Building Resilient Microservices

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

Page 22: Building Resilient Microservices

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

Page 23: Building Resilient Microservices

How to Test?

http://martinfowler.com/articles/microservice-testing

Page 24: Building Resilient Microservices

Continuous Delivery• Reliable Software Releases through

Build, Test and Deployment Automation

• DONE = Shippable into Production

Page 25: Building Resilient Microservices

Continuous Integration Tool Set

Page 26: Building Resilient Microservices

Prepare for DevOps

Devops (From Verticals to collaborative teams)

Page 27: Building Resilient Microservices

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

Page 28: Building Resilient Microservices

Take AwaysMicroservices aren’t micro!Everything comes at a priceNo framework is a silver bullet

Page 29: Building Resilient Microservices

THANK YOU