Friday, August 18, 2017

Microservices Architecture – Spring Boot, Spring Cloud and Netflix OSS Infrastructure

Microservices Architecture – Spring Boot, Spring Cloud and Netflix OSS Infrastructure

What is "Microservices"?
  • A suite of small services that use lightweight mechanism like REST to communicate with each other. 
  • These services are built around business capabilities and independently deployable by fully automated deployment machinery.
Why Micro Services Architecture?
We chose micro services architecture to write each functionality as a separate service for core and API functionality and it helps us to achieve the continuous delivery and integration.
Frameworks
There are couple of frameworks available in different software ecosystems that make it easy to create distributed applications using microservices architecture.
  1. Java – Spring Cloud using Netflix OSS
  2. Node.js – Seneca
  • The reference architecture developed by us builds on the Spring Cloud ecosystem.
  • There are number of components available within the Spring Cloud and Netflix OSS ecosystem that solve common problems for distributed applications
    (e.g. configuration management, service discovery, circuit breakers, intelligent routing etc).
Patterns in Micro Services Architecture :
  • API Gateway
  • Service Registry
  • Service Discovery
Patterns in Micro services Architecture
API Gateway
  • Choose to build the application as a set of micro-services.
  • Decide how the application client’s will interact with the micro services
  • With a monolithic application there is just one set of (typically replicated, load-balanced) endpoints.
  • In a micro services, architecture, however each micro services exposes a set of what are typically fine-grained endpoints.
Service Registry
  • Service registry helps to determine the location of service instances to send request to the corresponding services.
  • Here, we have used the Netflix Eureka to register a service that are available to be registered in service registry server and it can be identified through the router.
Service Discovery
  • In a monalithic application, services invoke one another through language-level method or procedure calls.
  • But, in a modern icro services based application typically runs in a virtualized environments where the number of instances of service and their locations changes dynamically
  • Each service can be identified using router that are registered with service registry server


Microservices Architecture using Netflix Components :
We have used the Netflix components to accomplish the above microservices architecture patterns.
Operations ComponentSpring Cloud, Netflix OSS
Service Discovery ServerNetflix Eureka
Edge ServerNetflix Zuul
Central Configuration ServerSpring Cloud Config Server
Dynamic Routing and Load BalancerNetflix Ribbon
OAuth 2.0 protected API’sSpring Cloud + Spring Security OAuth2
Circuit BreakerNetflix Hystrix
MonitoringNetflix Hystrix Dashboard and Turbine
Centralized Log AnalysisELK (Elasticsearch,Logstash,Kibana)

Major Components of Netflix :
Netflix Eureka – Service Discovery Server
Netflix Eureka allows micro services to register themselves at runtime as they appear in the system landscape.
Netflix Ribbon – Dynamic Routing & Load Balancer
Netflix Ribbon can be used by service consumers to look up services at runtime. Ribbon uses the information available in Eureka to locate appropriate service instances. If more than one instance is found, Ribbon will apply load balancing to spread the requests over the available instances. Ribbon does not run as a separate service but instead as an embedded component in each service consumer.

Netflix Zuul – Edge Server & API gatewayer
Zuul is (of course) our gatekeeper to the outside world, not allowing any unauthorized external requests pass through. Zulu also provides a well-known entry point to the micro services in the system landscape. Using dynamically allocated ports is convenient to avoid port conflicts and to minimize administration but it makes it of course harder for any given service consumer. Zuul uses Ribbon to look up available services and routes the external request to an appropriate service instance.

Spring Boot & Spring Cloud Netflix OSS – Micro Service Architecture



Micro Services with Spring Boot :
Spring Boot is a brand new framework from the team at Pivotal, designed to simplify the bootstrapping and development of a new spring application. The framework takes an opinionated approach to configuration, freeing developers from the need to define boilerplate configuration.
Spring Cloud Netflix :
Spring cloud Netflix provides Netflix OSS integrations for spring boot apps through auto configuration and binding to the spring environment and other spring programming models. With a few simple annotations we can quickly enable and configure common patterns inside application and to build large distributed systems with Netflix components. There are lot of features available with spring cloud Netflix. Here, we have listed some of the common features we have implemented with micro services with spring boot and Netflix,

Service Discovery
  • Eureka instances can be registered and clients can discover the instances using spring managed beans.
Service Creation
  • An embedded Eureka server can be created with declarative Java Configuration
External Configuration
  • A bridge from the Spring Environment(enables native configuration of Netflix components using Spring Boot conventions)
Router and Filter
  • Automatic registration of Zuul filters, and a simple convention over configuration approach to reverse proxy creation

No comments:

Post a Comment

உப்பு மாங்காய்

சுருக்குப்பை கிழவி. சுருக்கங்கள் சூழ் கிழவி. பார்க்கும் போதெல்லாம் கூடையுடனே குடியிருப்பாள். கூடை நிறைய குட்டி குட்டி மாங்காய்கள். வெட்டிக்க...