11
Micro services Deepak Singhvi 11-01-17

Microservices forscale

Embed Size (px)

Citation preview

Page 1: Microservices forscale

Micro services

Deepak Singhvi11-01-17

Page 2: Microservices forscale

X Axis Horizontal Scaling(Scale by cloning)

Y Axis Functional Decomposition(Scale by splitting Different things)

Z Axis Data Partitioning(Scale by splitting similar things)

Scale! Near infinite scale

No split, and single monolithic architecture.

Page 3: Microservices forscale

Scalability - Resource usage should increase linearly (or better) with load. - Design for 10x growth in data, traffic, users, etc.Availability - Resilience to failure - Graceful degradation - Recoverability from failureLatency - User experience latency - Data latencyManageability - Simplicity - Maintainability - DiagnosticsCost - Development effort and complexity - Operational cost

Inspiration from Randy Shoup

Page 4: Microservices forscale

“Architectural StrategiesStrategy 1: Partition Everything

How do you eat an elephant? One bite at a time.

Strategy 2: Async EverythingGood things comes to one who waits…

Strategy 3: Automate EverythingGive a man a fish and he eats the fish for a day…Teach a man to fish and he eats fist everyday

Strategy 4: Remember Everything failsBe Prepared

Page 5: Microservices forscale

Partitioning Business ServiceMicro services small set of services which works collectively as a single (or multiple as well) unit.

Micro services highly decoupled and focus on doing a small task at a time.

Any kind of communication with between services would require a knowledge about each other’s location.

If we have multiple environments (dev, sit, uat, prod) then configuring, managing, deploying the services challenging if it is not automated as it involves issues in deployment time, monitoring. Adding additional nodes for the services in the distributed environment would need better management and collaboration.

Page 6: Microservices forscale

How do we do it…There are number of tools are technology. For this study I have taken Spring + Netflix components.Spring Cloud provides tools for developers to quickly build some of the

common patterns in distributed systems. Netflix OSS is a set of frameworks and libraries that Netflix wrote to solve some

interesting distributed-systems. Netflix open source has contribute many project to spring cloud tools.

Page 7: Microservices forscale

ComponentsSpring Cloud + Netflix Eureka + Netflix Zuul + Ribbon + Feing + Docker

Page 8: Microservices forscale

Lets jump to demo and code

Page 9: Microservices forscale

Who is who

EurekaEureka, Netflix OSS project, is a service registry. Each micro service registers itself with Eureka, and then consumers of that service know how to find it using the service directory.

ZuulZuul is the front door for all requests, as an edge service application. Zuul is built to enable dynamic routing, monitoring, resiliency and security.

RibbonRibbon is a Inter Process Communication (remote procedure calls) library with built in software load balancers.

FeingFeign is a declarative web service client. It makes writing web service clients easier

DockerDocker is an open-source project that automates the deployment of applications inside software containers..

Page 10: Microservices forscale

You can download code from github

https://github.com/deepaksinghvi/microservice

Page 11: Microservices forscale

Thank You!