Spring Cloud | Features, Config, Data Flow, Stream

Spring Cloud

Spring Cloud offers basic & improved Spring & Spring Boot Framework concepts.

Spring Cloud refers to a Spring unit that offers the Rapid Application Development (RAD) feature to the Spring framework. One can rapidly make cloud-based share with the assistance of Framework of Spring Cloud.

Spring Cloud offers tools to developers for building some common patterns at distributed systems fast. For instance service discovery, configuration management, circuit breakers, micro-proxy, intelligent routing, bus control, global locks, tokens for the one-time, leadership election, cluster state, and distributed sessions.

Spring Cloud Features

The great section of Spring Cloud makes the Spring Boot concept. It’s made upon other collective spring framework building-blocks like:

  1. Service-to-Service Call
  2. Distributed Messaging
  3. Intelligent routing & service discovery
  4. Distributed Configuration
  5. Load Balancing
  6. Global Locks
  7. Leadership Election

Service Discovery & Intelligent Routing

When making micro-services at Spring Cloud, there’s the main concern of dealing with the 1st primary micro-services which includes configuration service & discovery service.

The diagram above shows a set of 4 micro-services. The between connection every service shows dependency. Every service depends on every other. Configuration package lies on the top, & the services discovery are below. There are 2 micro-services which are Movie Service & Recommendation Service.

•	Service discovery & Intelligent Routing

Service-to-Service calls

It’s the method of “how micro-service communicates with every dependent micro-services through Eureka server or service registry.” There’s a sequence that follows a service-to-service call.

  1. Service registering
  2. Registry fetching
  3. Downstream service finding
  4. Resolving Fundamental IP address
  5. Call rest Endpoint

Leadership Election

This allows an application to a job with a different application through a third-party system. A leadership election is utilized to offer global ordering or global state minus sacrificing availability.

Load Balancing

This efficiently shares network traffic with multiple server pools or backend servers. Load balancing objective helps in maximizing throughput, increase efficiency, reduce response time & optimize resource usage. It prevents the overload of every single resource. Utilizing more load-balancing with components increases reliability & availability via redundancy.

Global Locks

These are utilized in ensuring that no 2 threads consecutively access a similar resource at a similar time. Programmer utilizes a mechanism for removing such situation known as a lock. Every thread 1st gets the lock, works on resources, & releases lock for a different thread.

Distributed Messaging

Distributed system for messaging offers the advantage of reliability, persistence, and scalability. Messaging pattern goes with Publish-Subscribe model. In Pub-Sub model, a message sender is known as a publisher & the message receiver is known as subscriber. RabbitMQ and Apache Kafka are popular high output messaging systems.

Distributed Configuration

This helps in configuring all instances of every micro-service. “Spring-cloud config server” offer client-side sustenance for external configuration in a distributed system. Distributed configurations, helps a central place in managing external features for applications through every environment.

Components of Spring Cloud

  • Service Discovery
  • Configuration
  • CI Pipeline & Testing
  • Circuit Breakers
  • API Gateway
  • Routing & Messaging
  • Tracing

Configuration

This component offers the server-side & client-side sustenance for distributed system external configuration. We manage external properties using config servers to apps across every environment. Spring-Cloud config server uses Git, filesystem, SVN (Apache Subversion), & Vault to keep config. Config customer’s micro-service application retrieve configuration customer from a server at startup.

Service Discovery

This is an automatic devices & services detection through the network. Service discovery means the way an app & micro-services joins in a spread environment. Service detection implementations are comprised of

  1. Clients who connect to central server are able to update & retrieve an address.
  2. The central server maintains some global view of the address.

The 2 discovery patterns includes

Client-side discovery

Here the client is in charge of determining accessible network location services. A client utilizes a load-balancing procedure to choose available services & make some requests. A good example of client-side pattern is Netflix OSS.

Server-side discovery

Here the customer makes a HTTP-request to service via a balancer load. Load balancer links with service registry & route every call to an accessible service instance. Same with client-side discovery, the service instance is registered & deregistered with service registry. AWS Elastic Load Balancer (ELB) is a good case of server-side discovery. Elastic Load Balancer balances internet external-traffic.

Circuit Breakers

Hystrix is a library created by Netflix. It uses a circuit breakers design. Circuit breakers compute the time to open & close a circuit & what it can do just in case there is a failure. When every service fails at other point, a circuit breaker deals with the failures elegantly. The circuit breaker comes with three states: HALF-OPEN, CLOSED, & OPEN State.

CLOSED State

Here Circuit-breaker remains at CLOSED state & each calls a pass-by to supplier micro-services. It replies minus any latency.

OPEN State

Here circuit breaker takes back the error call minus function execution.

HALF-OPEN

Here circuit changes to HALF-OPEN when it has a timed out function execution. It tests the underlying issues still occurs or not. It’s a monitoring & feedback mechanism. This makes a test call towards supplier micro-services to look if it recovered. If call to a supplier remains timed-out and the circuit stays in OPEN state. When call goes back to success, circuit-switched to the CLOSED state. Circuit-breaker takes back every external-call to service with error in HALF-OPEN State.

Routing & Messaging

A cloud application is made of numerous micro-services so communication is serious. Spring Cloud deals with communication through HTTP requests or messages. Routing utilizes Netflix Ribbon & Open Feign as messaging utilizes Rabbit MQ or Kafka.

API Gateway

This enables one to channel API-request either internal or external to join services. Furthermore, it also offers a library for building API gateway at the uppermost of MVC Spring. This aims to offer cross-cutting worries to them, like monitoring and security.

API Gateway Features

  1. Capable to match-routes on every requested attribute
  2. Made at Spring-framework, project reactor & Spring-Boot(2.0)
  3. Path rewriting
  4. Predicates & filters are precise to routes
  5. Spring Cloud-Discovery customer integration
  6. Integration of Hystrix circuit-Breaker
  7. Rate Limiting Request
  8. Simple to write filters and predicates

Tracing

Tracing refers to a single application to have information from the application. Tracing outcomes in an exponentially big number of demands to more micro-services.

Zipkin refers to a scattered tracing tool specifically made for examining latency issues inside the micro-service architecture. This disclosure HTTP-endpoint is utilized for gathering input information. If tracing is needed to the project, we need to add spring-cloud-starter-Zipkin dependence.

In micro-services, traffic-volume input is very high, thus cannot gather just other amounts of information.

Cl Pipeline & Testing

This is an opinionated pipeline for Concourse & Jenkins, which makes the pipeline automatic for application. Creating, testing, & deploying numerous services are serious to have a fruitful cloud-native app.

Jenkins pipeline offers some set of tools made for simple modeling & extra improved delivery pipeline-like code. Pipeline definition is printed into a text file known as Jenkinsfile.

CI pipeline has 2 syntaxes. They include Declarative & Scripted pipelines. The syntaxes are categorized into 2 parts. These include Steps, & Stages. Steps remain the basic pipeline part as they inform Jenkins-server on what needs to be done. Stages are major sections of the pipeline. Stages sensibly group some steps that are displayed on the pipeline’s outcome screen.

Tableau Interview Questions

Spring MVC Interview Questions

Windows 12 lite – Fake News

Download Windows 11 Disc Image (ISO File)

Terry White

Terry White is a professional Drupal & WordPress developer, Web developer, Web designer, Software Engineer, and Blogger. He strives for pixel-perfect design, clean robust code, and a user-friendly interface. If you have a project in mind and like his work, feel free to contact him

View all posts by Terry White →

Leave a Reply

Your email address will not be published. Required fields are marked *