Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Microservice architecture with
Spring Cloud and Netflix OSS
Who am I?
Denis Danov
Software Engineer
&
Consultant at Dreamix Ltd.
www.dreamix.eu
Microservice architecture introduction
o What is a microservice?
o How to develop microservices?
o Microservice properties
n Small and singly focused
n Loosly-coupled and simple
n Technology agnostic
n Independent deplo...
o Spring Boot
n Simple infrastructure
n Few dependencies
n REST integrated
n Messaging support
n Uniform operations and me...
o Spring Cloud
n Distributed/versioned
configuration
n Service registration and
discovery
n Routing
n Service-to-service c...
Simple application
Production ready
o Having your code done is not the
same as production ready.
o You have to think how to monitor
your appl...
Architecture components
We have our microservice now it
needs a good environment to live in
Spring Cloud Dependency
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<a...
o The 12 Factor manifesto talks
about externalizing that which
changes from one environment to
another from the applicatio...
Key points
o Server:
n Dependency:
spring-cloud-config-server
n Annotation:
@EnableConfigServer
@SpringBootApplication
pub...
o In the cloud, services are often
ephemeral and it's important to
be able to talk to these services
abstractly, without w...
Key points
o Server:
n Dependency:
spring-cloud-starter-eureka-server
n Annotation:
@EnableEurekaServer
@SpringBootApplica...
o Edge services sit as intermediaries
between the clients and the service.
o Proxy requests from an edge-service
to mid-ti...
Key points
o Server:
n Dependency:
spring-cloud-starter-zuul - proxy
spring-cloud-starter-feign - HTTP REST client
n Annot...
o Log aggregation and analysis.
o Essential part of microservice
environment.
o ELK=Elastic+Logstash+Kibana
o Logback
Logg...
o Distributed tracing lets us trace
the path of a request from one
service to another.
o It's very useful in understanding...
Key points
o Server:
n Dependency:
zipkin-server
zipkin-autoconfigure-ui
n Annotation:
@EnableZipkinServer
o Client:
n Dep...
o We often assume that services
will always be up and responding
to requests.
o We need to be a bit more
defensive in any ...
Key points
o Server:
n Dependency:
spring-cloud-starter-hystrix-dashboard
n Annotation:
@EnableHystrixDashboard
o Client:
...
o All this is a long process of
discovery.
o Capture all this in your Maven
starter with auto-configuration
o It is not ne...
o There are different log
aggregation and analysis
alternatives:
n EKK=Elastic+Kinesis+Kibana (AWS)
n Graylog - nice alert...
Kubernetes/Kubeflix
o Language and technology agnostic
o Reduces the need for:
n discovery service
n client-side loadbalan...
JHipster microservices
Resources
o https://github.com/dndanoff/microservices
o 12 Factor Application
o Spring Cloud Project
o Spring Cloud Docs
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Microservices with Spring Cloud and Netflix OSS
Upcoming SlideShare
Loading in …5
×

Microservices with Spring Cloud and Netflix OSS

1,014 views

Published on

The presentation will introduce the audience to microservice architecture and how it is different from a monolithic one. It will focus on the different components that are necessary for a microservice architecture such as discovery service, configuration service, api gateway and others. For each one of the components will be highlighted why they are important for this type of architecture and how to implement them with Spring Boot and Netflix stack.

Published in: Software
  • Be the first to comment

Microservices with Spring Cloud and Netflix OSS

  1. 1. Microservice architecture with Spring Cloud and Netflix OSS
  2. 2. Who am I? Denis Danov Software Engineer & Consultant at Dreamix Ltd. www.dreamix.eu
  3. 3. Microservice architecture introduction
  4. 4. o What is a microservice? o How to develop microservices?
  5. 5. o Microservice properties n Small and singly focused n Loosly-coupled and simple n Technology agnostic n Independent deployable units o Distributed system n Patterns common to all distributed systems lead to boilerplate code n configuration management, service discovery, circuit breakers, intelligent routing, messaging service etc.
  6. 6. o Spring Boot n Simple infrastructure n Few dependencies n REST integrated n Messaging support n Uniform operations and metrics n Logging n Simple deployment
  7. 7. o Spring Cloud n Distributed/versioned configuration n Service registration and discovery n Routing n Service-to-service calls n Load balancing n Circuit Breakers n Distributed messaging o Netflix OSS n Archaius n Eureka n Zuul n Feign n Ribbon n Hystrix
  8. 8. Simple application
  9. 9. Production ready o Having your code done is not the same as production ready. o You have to think how to monitor your application metric in production. o Spring Actuator exposes applciation metric which can be sent and displayed from another tool such as Graphite
  10. 10. Architecture components We have our microservice now it needs a good environment to live in
  11. 11. Spring Cloud Dependency <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud- dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
  12. 12. o The 12 Factor manifesto talks about externalizing that which changes from one environment to another from the application itself o Cloud Config Server takes care to centralize, externalize, and dynamically update application configuration. Configuration
  13. 13. Key points o Server: n Dependency: spring-cloud-config-server n Annotation: @EnableConfigServer @SpringBootApplication public class CloudConfigApplication o Client: n Dependency: spring-cloud-starter-config n Properties: Specify config server address
  14. 14. o In the cloud, services are often ephemeral and it's important to be able to talk to these services abstractly, without worrying about the host and ports for these services. o Eureka Service Discovery
  15. 15. Key points o Server: n Dependency: spring-cloud-starter-eureka-server n Annotation: @EnableEurekaServer @SpringBootApplication public class DiscoveryApplication o Client: n Dependency: spring-cloud-starter-eureka n Annotation: @EnableDiscoveryClient n Properties: Specify eureka server address Change config address to service name
  16. 16. o Edge services sit as intermediaries between the clients and the service. o Proxy requests from an edge-service to mid-tier services with a microproxy. o API gateways are used whenever a client - like a mobile phone or HTML5 client - requires API translation. o Zuul, Ribbon, Spring Retry Edge Services: API gateways
  17. 17. Key points o Server: n Dependency: spring-cloud-starter-zuul - proxy spring-cloud-starter-feign - HTTP REST client n Annotation: @EnableZuulProxy @EnableDiscoveryClient @SpringBootApplication public class ApiGatewayApplication @FeignClient("team-mservice") public interface CompanyClient
  18. 18. o Log aggregation and analysis. o Essential part of microservice environment. o ELK=Elastic+Logstash+Kibana o Logback Logging
  19. 19. o Distributed tracing lets us trace the path of a request from one service to another. o It's very useful in understanding where a failure is occurring in a complex chain of calls. o Zipkin server and Sleuth Distributed tracing
  20. 20. Key points o Server: n Dependency: zipkin-server zipkin-autoconfigure-ui n Annotation: @EnableZipkinServer o Client: n Dependency: spring-cloud-starter-sleuth spring-cloud-starter-zipkin n Configuration: ZipkinSpanReporter Bean
  21. 21. o We often assume that services will always be up and responding to requests. o We need to be a bit more defensive in any code that connects to other services. o There have to be a usefull fallback mechanism o Hystrix Resilience, circuit-breaker
  22. 22. Key points o Server: n Dependency: spring-cloud-starter-hystrix-dashboard n Annotation: @EnableHystrixDashboard o Client: n Dependency: spring-cloud-starter-hystrix spring-boot-starter-actuator n Configuration: @HystrixCommand(fallbackMethod = "fallback")
  23. 23. o All this is a long process of discovery. o Capture all this in your Maven starter with auto-configuration o It is not needed to reinvent the wheel.
  24. 24. o There are different log aggregation and analysis alternatives: n EKK=Elastic+Kinesis+Kibana (AWS) n Graylog - nice alerts Alternatives
  25. 25. Kubernetes/Kubeflix o Language and technology agnostic o Reduces the need for: n discovery service n client-side loadbalancing n edge-service proxy
  26. 26. JHipster microservices
  27. 27. Resources o https://github.com/dndanoff/microservices o 12 Factor Application o Spring Cloud Project o Spring Cloud Docs

×