Microservices Roundtable Puneet Sachdev 21 Apr 2018

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

APIs and Microservices

121 Test Automation Day


Puneet Sachdev
Chief Architect, NIIT Technologies
[email protected]
https://www.linkedin.com/in/puneetsachdev/ 21st April 2018
1
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
2
© 2018 NIIT Tech | www.niit-tech.com | Confidential
3
© 2018 NIIT Tech | www.niit-tech.com | Confidential
Microservices vs. SOA vs. APIs

Microservices is about
splitting a single application
into smaller pieces which are
independent and have their
own lifecycle

4
© 2018 NIIT Tech | www.niit-tech.com | Confidential
Microservices vs. SOA vs. APIs

SOA is about integrating


CRM DW Finance Loyalty different applications which
can be internal or 3rd party

5
© 2018 NIIT Tech | www.niit-tech.com | Confidential
Microservices vs. SOA vs. APIs

SOA Microservices
• Integration between different applications • Splitting an application into smaller pieces
• Dominated by proprietary stacks • Dominated by Open Source components from
organizations like Netflix
• Smart Pipes, Dumb Endpoints • Dumb pipes, Smart Endpoints
• Typically Hub-n-Spoke. Technology • Completely Distributed
Monoliths
APIS
• APIs are interfaces which are exposed either internally and/or externally and have governance
and management around it

6
© 2018 NIIT Tech | www.niit-tech.com | Confidential
Microservices Reference Architecture

Microservices Technology
Stack
• Open Source
• Lightweight
• Based on
• Spring
• Netflix
• Docker, k8s

7
© 2018 NIIT Tech | www.niit-tech.com | Confidential
Concepts to be explored

1. Service Discovery (using Eureka/Kubernetes)


• Microservices applications run in containerized/virtualized and cloud environments where their actual locations change
dynamically
• How does a client of a service discover the location?

2. Circuit Breakers (using Hystrix)


• Microservices applications have many moving parts and span across multiple boundaries
• How to prevent a network or service failure from cascading to other services?

3. Client Side Load Balancing (using Ribbon/Kubernetes)


• Dumb pipes and smart endpoints. Where does this leave load balancing?

4. Proxy (using Zuul/Kubernetes)


• With diverse traffic hitting microservices, how to get an ability to provide intelligent filters on requests

5. Monitoring (using Hystrix Monitor/Prometheus+Grafana)


• When things fail, it is extremely important to note what is failing
• How to monitor in near real time many microservices?

8
© 2018 NIIT Tech | www.niit-tech.com | Confidential
Codebases

1. Pure Netflix & Spring (Eureka, Hystrix, Ribbon, Zuul, Spring Config, Spring Boot)
https://github.com/psachdev6375/microservices-bootcamp.git

2. Docker-Netflix-Spring (Docker, Eureka, Hystrix, Ribbon, Zuul, Prometheus, Grafana, Spring)


https://github.com/psachdev6375/docker-microservices-bootcamp.git

3. Docker-k8s-Netflix-Spring (Docker, k8s, Hystrix, Prometheus, Grafana, Spring)


https://github.com/psachdev6375/k8s-microservices-bootcamp.git

9
© 2018 NIIT Tech | www.niit-tech.com | Confidential
Scenario

Subject Verb Article Adjective Noun


Service Service Service Service Service

You saw the leaky seat

Sentence
Service

Code: https://github.com/psachdev6375/microservices-bootcamp.git
10
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Pure Netflix, Spring Boot implementation
Code: https://github.com/psachdev6375/microservices-bootcamp.git

11
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Subject Verb Article Adjective Noun
Service Service Service Service Service

Eureka

1. Start Eureka Server


Sentence 2. Check Eureka console
3. Start Sentence Service
Service 4. See Circuit Breaker in action
5. See Hystrix Dashboard

Code: https://github.com/psachdev6375/microservices-bootcamp.git
12
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Subject Verb Article Adjective Noun
Service Service Service Service Service

Eureka
1. Start Eureka Server
Zuul 2. Check Eureka console
3. Start Sentence Service
4. See Circuit Breaker in action
Sentence 5. See Hystrix Dashboard
Service 6. All services running

Code: https://github.com/psachdev6375/microservices-bootcamp.git
13
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Subject Verb Article Adjective Noun
Service Service Service Service Service

Eureka
1. Start Eureka Server
2. Check Eureka console
Zuul 3. Start Sentence Service
4. See Circuit Breaker in action
Sentence 5. See Hystrix Dashboard
Service 6. All services running
7. Zuul Proxy

Code: https://github.com/psachdev6375/microservices-bootcamp.git
14
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Subject Verb Article Adjective Noun
Service Service Service Service Service
Noun
Service

Eureka 1. Start Eureka Server


2. Check Eureka console
Zuul 3. Start Sentence Service
4. See Circuit Breaker in action
5. See Hystrix Dashboard
Sentence 6. All services running
Service 7. Zuul Proxy
8. Scaling Noun Service

Code: https://github.com/psachdev6375/microservices-bootcamp.git
15
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Docker, Docker-Compose, Netflix, Spring Boot,
Prometheus, Grafana implementation
https://github.com/psachdev6375/docker-microservices-bootcamp.git

16
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Adjective Article Noun Subject Verb

Monitoring endpoint /prometheus


Concepts
• Discovery (eureka)
• Circuit Breakers (hystrix)
• Client Side LB (ribbon) Eureka Prometheus
• Proxy (zuul)
• Containers (docker)
• Monitoring & Alerts Zuul
(Prometheus)
• Dashboard (Grafana)
Sentence Grafana

https://github.com/psachdev6375/docker-microservices-bootcamp.git
17
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Docker, Kubernetes, Hystrix, Spring Boot,
Prometheus, Grafana implementation
https://github.com/psachdev6375/k8s-microservices-bootcamp.git

18
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Kubernetes Cluster

Adjective Article Noun Subject Verb


Pods Pods Pods Pods Pods

Concepts
• Discovery (k8s)
• Circuit Breakers (Hystrix)
• Load Balancing (k8s Adjective Article
Noun Service
Subject
Verb Service
Service Service Service
services)
• Proxy (k8s services)
• Containers
• Container Orchestration Grifana Prometheus Sentence
(k8s) Pods Pods Pods
• Monitoring & Alerts
(Prometheus)
• Dashboard (Grafana)
Grifana Prometheus Sentence
Service Service Service

https://github.com/psachdev6375/k8s-microservices-bootcamp.git
19
© 2018 NIIT Tech | www.niit-tech.com | Confidential © 2018 NIIT Tech | www.niit-tech.com | Confidential
Thank You
Puneet Sachdev
Chief Architect, NIIT Technologies
[email protected]
https://www.linkedin.com/in/puneetsachdev/
20
© 2018 NIIT Tech | www.niit-tech.com | Confidential

You might also like