Spring Cloud provides tools to help developers quickly build distributed applications and patterns such as configuration management, service discovery, circuit breakers, routing, and more. It aims to make building cloud native applications easier, especially for smaller companies and development teams. Some key Spring Cloud components include Spring Cloud Config for externalized configuration, Netflix Eureka for service discovery, Hystrix for circuit breaking, Zuul for API routing, and Sleuth/Zipkin for distributed tracing.
2. What is spring cloud
Spring Cloud provides tools for developers to quickly build
some of the common patterns in distributed systems (e.g.
configuration management, service discovery, circuit
breakers, intelligent routing, micro-proxy, control bus, one-
time tokens, global locks, leadership election, distributed
sessions, cluster state).
They will work well in any distributed environment, including
the developer’s own laptop, bare metal data centres, and
managed platforms such as Cloud Foundry.
3. Why Spring cloud
• Cloud native apps are good thing but not easy.
• It is easy for big companies to put lot of resources to
succeed in cloud native but what about little guys.
• Why do we want to reinvent wheels when somebody
wants to build a cloud native apps?
• Follows spring boot model providing defaults for cloud
native app with ability to easy to configure them.
4. Spring cloud components
• Configuration
• Service discovery
• Circuit breakers
• Routing and messaging
• API Gateway
• Tracing
• CI Pipelines and testing.
• Growing….
5. Configuration
• We want to remove the configuration
out of the application to a centralized
store across all environments.
• Spring cloud Config Server can use Git,
SVN, filesystem and Vault to store
config
• Config clients (microservice apps)
retrieve the configuration from the
server on startup •
• Can be notified of changes and process
changes in a refresh event
6. Service Discovery
• Service Discovery allows micro
services to easily discover the
routes to the services it needs to
use
• Netflix Eureka
• Zookeeper
• Consul
7. Routing and messaging
• Your cloud native app will be
composed of many micro-services
so communication will be critical
• Spring Cloud supports
communication via HTTP requests
or via messaging
• Routing and Load Balancing:
• Netflix Ribbon and Open Feign
• Messaging:
• RabbitMQ or Kafka
8. API Gateway
• API Gateways allow you to
route API requests (internal or
external) to the correct service.
• Netflix Zuul
• Leverages service discovery
and load balancer
• Spring Cloud Gateway
9. Circuit Breaker
• Failure is inevitable, but your
user’s don’t need to know.
• Circuit breakers can help an
application function in the face
of failure
• Netflix Hystrix
10. Tracing
• A single request to get data from your application may
result in an exponentially larger number of requests to
various micro-services
• Tracing these requests through the application is critical
when debugging issues
• Spring Cloud Sleuth and Zipkin
11. CI Pipeline and Testing
• Building, testing, and deploying the various services is
critical to having a successful cloud native application
• Spring Cloud Pipelines is an opinionated pipeline for
Jenkins or Concourse that will automatically create
pipelines for your apps
• Spring Cloud Contract allows you to accurately mock
dependencies between services using published
contracts.
14. Take away
The main takeaways from the above table are:
• Spring Cloud has a rich set of well-integrated Java libraries to address all runtime concerns as
part of the application stack. As a result, the microservices themselves have libraries and runtime
agents to do client-side service discovery, load balancing, configuration update, metrics tracking,
etc. Patterns such as singleton clustered services and batch jobs are managed in the JVM too.
• Kubernetes is polyglot, doesn't target only the Java platform, and addresses the distributed
computing challenges in a generic way for all languages. It provides services for configuration
management, service discovery, load balancing, tracing, metrics, singletons, scheduled jobs on the
platform level and outside of the application stack. The application doesn't need any library or
agents for client side logic and it can be written in any language.
• In some areas, both platforms rely on similar third-party tools. For example, the ELK and EFK
stacks, tracing libraries, etc. Some libraries, such as Hystrix and Spring Boot, are useful equally
well on both environments. There are areas where both platforms are complementary and can be
combined together to create a more powerful solution ( KubeFlix and Spring Cloud
Kubernetes are such examples).
https://www.youtube.com/watch?v=Q0kj_34dr3g