SlideShare a Scribd company logo
Микросервисы со Spring
Boot & Spring Cloud
L e a d S o f t w a r e E n g i n e e r a t E PA M
A l e k s a n d r B a r m i n
3 0 Н О Я Б Р Я
About Myself
Lead Software Engineer at EPAM
EPAM Lab mentor
CONTACTS
Email: Aleksandr_Barmin@epam.com
Twitter: @AlexBarmin
ALEKSANDR BARMIN
2
Agenda
• Why Spring?
• Configuration for a distributed environment.
• Service Discovery using the Spring Framework.
• Client-side Load Balancing.
• Server-side Load Balancing.
• Q&A Session.
3
Why Spring?
• Spring Framework is one of the most convenient ways to start a new Java-
based application.
• Spring Boot allows configuring subsystems just by adding dependencies.
• Spring Cloud focuses on providing good out-of-the-box experience for typical
use cases and extensibility mechanism to cover others.
• Spring Cloud takes a very declarative approach, and often you get a lot of
features with just a classpath change and/or an annotation.
Main Subprojects
• Spring Cloud Config
• Spring Cloud Netflix
• Spring Cloud Zookeeper
• Spring Cloud Gateway
• Spring Cloud OpenFeign
• Spring Cloud Security
• Spring Cloud Bus
• Spring Cloud Cluster
• Spring Cloud CLI
• Spring Cloud Commons
• Spring Cloud Connectors
• Spring Cloud Contract
• Spring Cloud Functions
• Spring Cloud anything
Demo Application
Микросервисы со Spring Boot & Spring Cloud
8
Spring Cloud Config
Reasoning
• Centralized external configuration management.
• Different configuration for different environment and profiles.
• Server:
• HTTP, resource-based API for external configuration.
• Encryption and decryption of property values.
• Embeddable using Boot Starter.
• Client:
• Binds to an external Config Server.
• Encryption and decryption of property values.
Spring Cloud Config Server
• Configuration Storage:
• Git Backend
• SVN Backend
• File System Backend
• JDBC Backend
• Composite Environment Repositories
Spring Cloud Config
12
Cloud Config
Server
Spring Boot
Application
GIT repository
SVN repository
Configuration
Database
bootstrap.yml
name: spring-boot-application
profiles: default, db, local
application.
yml
Spring Cloud Config Demo
14
Service Discovery
Reasoning
• Client-side service discovery allows services to find and communicate with
each other without hard coding hostname and port. The only “fixed point” in
such an architecture consists of a service registry, with which each service
has to register.
• A drawback is that all clients must implement a certain logic to interact with
this fixed point. This assumes an additional network round trip before the
actual request.
• To be informed about the presence of a client, they have to send a heartbeat
signal to the registry.
EUREKA
• Open Source
• The architecture is primarily
client/server, with a set of Eureka
servers per datacenter.
• Provides a weakly consistent view of
services, using best effort replication.
• Service registrations have a short
Time-To-Live (TTL), requiring clients to
heartbeat with the servers.
• Easy cluster administration and high
scalability.
• Can use additional tools like Ribbon (a
client-side load balancer).
• Eureka does not provide similar
guarantees, and typically requires
running ZooKeeper for services that
need to perform coordination or have
stronger consistency needs.
17
https://github.com/Netflix/eureka
Spring Cloud Netflix Eureka
18
Eureka Server
Some Business
Service
name:business-service
host:host.server
I’malive!
Gateway
Service
Client like
Web App
I need a response from the
business service!
Do you know where is the
business service?
Do some job for me pls!
This is the response you’ve
asked!
Service Discovery Demos
Микросервисы со Spring Boot & Spring Cloud
21
Declarative REST Client
Feign Client
• Feign client is a discovery-aware RestTemplate that uses interfaces to
communication with endpoints. This interfaces will be automatically
implemented at runtime, and instead of service-URLs it is using service-
names.
• We need to create an annotation with @EnableFeignClients to use it.
• In order to create Feign Client, an interface need to be created and
annotated with @FeignCleint(“service-name”) annotation.
• Eureka Client needs to be enabled as well.
Declarative REST Client Demo
Микросервисы со Spring Boot & Spring Cloud
Client-side Load Balancing
with Ribbon
Netflix Ribbon
Netflix Ribbon is an Inter Process Communication (IPC) cloud library. Ribbon primarily
provides client-side load balancing algorithms.
Netflix Ribbon also provides the following features:
• Service Discovery Integration – Ribbon load balancers provide service discovery in dynamic
environments like a cloud. Integration with Eureka and Netflix service discovery
component is included in the ribbon library.
• Fault Tolerance – the Ribbon API can dynamically determine whether the servers are up
and running in a live environment and can detect those servers that are down.
• Configurable load-balancing rules – Ribbon
supports RoundRobinRule, AvailabilityFilteringRule, WeightedResponseTimeRule out of the
box and supports defining custom rules.
Netflix Ribbon
Ribbon API enables us to configure the following components of the load
balancer:
• Rule – logic component which specifies the load balancing rule we are using
in our application.
• Ping – a component which specifies the mechanism we use to determine the
server’s availability in real-time.
• ServerList – can be dynamic or static. In our case, we are using a static list of
servers; hence we are defining them in the application configuration file
directly.
Client-side Load Balancing
with Ribbon Demo
Микросервисы со Spring Boot & Spring Cloud
Circuit Breaker
HYSTRIX
https://github.com/Netflix/Hystrix
• Provides fault tolerance and latency
tolerance.
• Defensive Programming with
Timeout.
• Defensive Programming with Limited
Thread Pool.
• Defensive Programming with Short
Circuit Breaker Pattern.
• Real time monitoring and alerting of
command center on failures.
Circuit Breaker Demo
Микросервисы со Spring Boot & Spring Cloud
35
Server side load balancing
and routing
ZUUL
• Open Source
• Full support HTTP/2
• Mutual TLS
• Adaptive Retries
• Configurable concurrency
limits
• Useful tools for debugging
async requests, retries and
routing
https://github.com/Netflix/zuul/wiki
Reasoning
Zuul could be used for solving the following tasks:
• Authentication
• Insights
• Stress Testing
• Canary Testing
• Dynamic Routing
• Service Migration
• Load Shedding
• Security
• Static Response handling
• Active/Active traffic management
Server side load balancing
and routing demo
Микросервисы со Spring Boot & Spring Cloud
Conclusion
• https://github.com/aabarmin/epam-dsc-2019
• “Cloud Native Java” by Josh Long
• https://spring.io/projects/spring-cloud
aabarmin
AlexBarmin
ABarmin
Микросервисы со Spring Boot & Spring Cloud
Микросервисы со Spring Boot & Spring Cloud
Ad

More Related Content

What's hot (20)

Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...
Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...
Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...
HostedbyConfluent
 
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix RibbonBetter Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
VMware Tanzu
 
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAXAlpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Richard Rabins
 
Service Discovery in Distributed Systems
Service Discovery in Distributed SystemsService Discovery in Distributed Systems
Service Discovery in Distributed Systems
Ivan Voroshilin
 
Netflix conductor
Netflix conductorNetflix conductor
Netflix conductor
Viren Baraiya
 
Service Discovery Like a Pro
Service Discovery Like a ProService Discovery Like a Pro
Service Discovery Like a Pro
Eran Harel
 
03 spring cloud eureka service discovery
03 spring cloud eureka   service discovery03 spring cloud eureka   service discovery
03 spring cloud eureka service discovery
Janani Velmurugan
 
API Gateway report
API Gateway reportAPI Gateway report
API Gateway report
Gleicon Moraes
 
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyA Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
HostedbyConfluent
 
Communication between cloud services
Communication between cloud servicesCommunication between cloud services
Communication between cloud services
Roi Ezra
 
Streaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby ChackoStreaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
VMware Tanzu
 
Confluent Operations Training for Apache Kafka
Confluent Operations Training for Apache KafkaConfluent Operations Training for Apache Kafka
Confluent Operations Training for Apache Kafka
confluent
 
Weblogic - clustering failover, and load balancing
Weblogic - clustering failover, and load balancingWeblogic - clustering failover, and load balancing
Weblogic - clustering failover, and load balancing
Vibrant Technologies & Computers
 
Microservices OSGi-running-with-apache-karaf
Microservices OSGi-running-with-apache-karafMicroservices OSGi-running-with-apache-karaf
Microservices OSGi-running-with-apache-karaf
Achim Nierbeck
 
What's new in ASP.NET vNext
What's new in ASP.NET vNextWhat's new in ASP.NET vNext
What's new in ASP.NET vNext
Gunnar Peipman
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
confluent
 
Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...
Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...
Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...
Till Rohrmann
 
Measure() or die()
Measure() or die()Measure() or die()
Measure() or die()
Tamar Duvshani Hermel
 
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
BIOVIA
 
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
PROIDEA
 
Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...
Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...
Look how easy it is to go from events to blazing-fast analytics! | Neha Pawar...
HostedbyConfluent
 
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix RibbonBetter Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
Better Deployments with Sub Environments Using Spring Cloud and Netflix Ribbon
VMware Tanzu
 
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAXAlpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Alpha Five v10.NEW APPLICATION SERVER. CODELESS AJAX
Richard Rabins
 
Service Discovery in Distributed Systems
Service Discovery in Distributed SystemsService Discovery in Distributed Systems
Service Discovery in Distributed Systems
Ivan Voroshilin
 
Service Discovery Like a Pro
Service Discovery Like a ProService Discovery Like a Pro
Service Discovery Like a Pro
Eran Harel
 
03 spring cloud eureka service discovery
03 spring cloud eureka   service discovery03 spring cloud eureka   service discovery
03 spring cloud eureka service discovery
Janani Velmurugan
 
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyA Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
HostedbyConfluent
 
Communication between cloud services
Communication between cloud servicesCommunication between cloud services
Communication between cloud services
Roi Ezra
 
Streaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby ChackoStreaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
Streaming with Spring Cloud Stream and Apache Kafka - Soby Chacko
VMware Tanzu
 
Confluent Operations Training for Apache Kafka
Confluent Operations Training for Apache KafkaConfluent Operations Training for Apache Kafka
Confluent Operations Training for Apache Kafka
confluent
 
Microservices OSGi-running-with-apache-karaf
Microservices OSGi-running-with-apache-karafMicroservices OSGi-running-with-apache-karaf
Microservices OSGi-running-with-apache-karaf
Achim Nierbeck
 
What's new in ASP.NET vNext
What's new in ASP.NET vNextWhat's new in ASP.NET vNext
What's new in ASP.NET vNext
Gunnar Peipman
 
How Apache Kafka® Works
How Apache Kafka® WorksHow Apache Kafka® Works
How Apache Kafka® Works
confluent
 
Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...
Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...
Future of Apache Flink Deployments: Containers, Kubernetes and More - Flink F...
Till Rohrmann
 
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
(ATS6-PLAT09) Deploying Applications on load balanced AEP servers for high av...
BIOVIA
 
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
JDD 2016 - Jacek Bukowski - "Flying To Clouds" - Can It Be Easy?
PROIDEA
 

Similar to Микросервисы со Spring Boot & Spring Cloud (20)

.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
Davide Benvegnù
 
Microservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eurekaMicroservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eureka
Binit Pathak
 
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Nikhil Hiremath
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
Uri Cohen
 
SAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High AvailabilitySAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High Availability
Gary Jackson MBCS
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
Huy Vo
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
cornelia davis
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
VMware Tanzu
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
Markus Eisele
 
saa3_wk5.pdf
saa3_wk5.pdfsaa3_wk5.pdf
saa3_wk5.pdf
Michgo1
 
How to build a Neutron Plugin (stadium edition)
How to build a Neutron Plugin (stadium edition)How to build a Neutron Plugin (stadium edition)
How to build a Neutron Plugin (stadium edition)
Salvatore Orlando
 
How to write a Neutron plugin (stadium edition)
How to write a Neutron plugin (stadium edition)How to write a Neutron plugin (stadium edition)
How to write a Neutron plugin (stadium edition)
salv_orlando
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
Eklove Mohan
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
Ranjan Baisak
 
Service Discovery in MicroServices
Service Discovery in MicroServicesService Discovery in MicroServices
Service Discovery in MicroServices
SRINIVAS KOLAPARTHI
 
Twelve Factor App
Twelve Factor AppTwelve Factor App
Twelve Factor App
Christ Ngantung
 
Serverless: The future of application delivery
Serverless: The future of application deliveryServerless: The future of application delivery
Serverless: The future of application delivery
Doug Vanderweide
 
Apinizer - Full API Lifecycle and Integration Platform
Apinizer - Full API Lifecycle and Integration Platform Apinizer - Full API Lifecycle and Integration Platform
Apinizer - Full API Lifecycle and Integration Platform
Mustafa Yildiz
 
OSGi compendium
OSGi compendiumOSGi compendium
OSGi compendium
Dario Bonino
 
.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric.NET microservices with Azure Service Fabric
.NET microservices with Azure Service Fabric
Davide Benvegnù
 
Microservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eurekaMicroservice creation using spring cloud, zipkin, ribbon, zull, eureka
Microservice creation using spring cloud, zipkin, ribbon, zull, eureka
Binit Pathak
 
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Externalized Distributed Configuration Management with Spring Cloud Config-Se...
Nikhil Hiremath
 
Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014 Cloudify workshop at CCCEU 2014
Cloudify workshop at CCCEU 2014
Uri Cohen
 
SAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High AvailabilitySAP on Azure Web Dispatcher High Availability
SAP on Azure Web Dispatcher High Availability
Gary Jackson MBCS
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
Huy Vo
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
cornelia davis
 
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps EnterpriseSpringOne Tour: An Introduction to Azure Spring Apps Enterprise
SpringOne Tour: An Introduction to Azure Spring Apps Enterprise
VMware Tanzu
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
Markus Eisele
 
saa3_wk5.pdf
saa3_wk5.pdfsaa3_wk5.pdf
saa3_wk5.pdf
Michgo1
 
How to build a Neutron Plugin (stadium edition)
How to build a Neutron Plugin (stadium edition)How to build a Neutron Plugin (stadium edition)
How to build a Neutron Plugin (stadium edition)
Salvatore Orlando
 
How to write a Neutron plugin (stadium edition)
How to write a Neutron plugin (stadium edition)How to write a Neutron plugin (stadium edition)
How to write a Neutron plugin (stadium edition)
salv_orlando
 
Getting to Walk with DevOps
Getting to Walk with DevOpsGetting to Walk with DevOps
Getting to Walk with DevOps
Eklove Mohan
 
Micro Services Architecture
Micro Services ArchitectureMicro Services Architecture
Micro Services Architecture
Ranjan Baisak
 
Service Discovery in MicroServices
Service Discovery in MicroServicesService Discovery in MicroServices
Service Discovery in MicroServices
SRINIVAS KOLAPARTHI
 
Serverless: The future of application delivery
Serverless: The future of application deliveryServerless: The future of application delivery
Serverless: The future of application delivery
Doug Vanderweide
 
Apinizer - Full API Lifecycle and Integration Platform
Apinizer - Full API Lifecycle and Integration Platform Apinizer - Full API Lifecycle and Integration Platform
Apinizer - Full API Lifecycle and Integration Platform
Mustafa Yildiz
 
Ad

More from Vitebsk DSC (20)

Community-Z
Community-ZCommunity-Z
Community-Z
Vitebsk DSC
 
How to exceed Customer's expectations by delivery complicated ML+RPA project
How to exceed Customer's expectations by delivery complicated ML+RPA projectHow to exceed Customer's expectations by delivery complicated ML+RPA project
How to exceed Customer's expectations by delivery complicated ML+RPA project
Vitebsk DSC
 
Аджайл майндсет. Что разрушает вашу команду?
Аджайл майндсет. Что разрушает вашу команду?Аджайл майндсет. Что разрушает вашу команду?
Аджайл майндсет. Что разрушает вашу команду?
Vitebsk DSC
 
Тестирование больших данных
Тестирование больших данныхТестирование больших данных
Тестирование больших данных
Vitebsk DSC
 
Amazon SQS или не все костыли одинаково бесполезны
Amazon SQS или не все костыли одинаково бесполезныAmazon SQS или не все костыли одинаково бесполезны
Amazon SQS или не все костыли одинаково бесполезны
Vitebsk DSC
 
Amazon Athena overview
Amazon Athena overviewAmazon Athena overview
Amazon Athena overview
Vitebsk DSC
 
Typical BA Mistakes ​in documentation
Typical BA Mistakes ​in documentationTypical BA Mistakes ​in documentation
Typical BA Mistakes ​in documentation
Vitebsk DSC
 
Boring is Fun!
Boring is Fun!Boring is Fun!
Boring is Fun!
Vitebsk DSC
 
На пути к совершенному инжинирингу
На пути к совершенному инжинирингуНа пути к совершенному инжинирингу
На пути к совершенному инжинирингу
Vitebsk DSC
 
Чего же ты хочешь, человек?
Чего же ты хочешь, человек?Чего же ты хочешь, человек?
Чего же ты хочешь, человек?
Vitebsk DSC
 
Растем вместе с eKIDS
Растем вместе с eKIDSРастем вместе с eKIDS
Растем вместе с eKIDS
Vitebsk DSC
 
Технологии беспилотных автомобилей
Технологии беспилотных автомобилейТехнологии беспилотных автомобилей
Технологии беспилотных автомобилей
Vitebsk DSC
 
Оптимизация потребления памяти в Java - делаем уборку правильно
Оптимизация потребления памяти в Java - делаем уборку правильноОптимизация потребления памяти в Java - делаем уборку правильно
Оптимизация потребления памяти в Java - делаем уборку правильно
Vitebsk DSC
 
Управляем эволюцией на лету
Управляем эволюцией на летуУправляем эволюцией на лету
Управляем эволюцией на лету
Vitebsk DSC
 
Жизнь после promises
Жизнь после promisesЖизнь после promises
Жизнь после promises
Vitebsk DSC
 
Выбираем стратегию создания бранчей
Выбираем стратегию создания бранчейВыбираем стратегию создания бранчей
Выбираем стратегию создания бранчей
Vitebsk DSC
 
Reactive programming для успеха вашего стартапа
Reactive programming для успеха вашего стартапаReactive programming для успеха вашего стартапа
Reactive programming для успеха вашего стартапа
Vitebsk DSC
 
Экстремальная оптимизация производительности на примере MongoDB Java Driver
Экстремальная оптимизация производительности на примере MongoDB Java DriverЭкстремальная оптимизация производительности на примере MongoDB Java Driver
Экстремальная оптимизация производительности на примере MongoDB Java Driver
Vitebsk DSC
 
Проблемы с производительностью приложений на AngularJS и способы их решения
Проблемы с производительностью приложений на AngularJS и способы их решенияПроблемы с производительностью приложений на AngularJS и способы их решения
Проблемы с производительностью приложений на AngularJS и способы их решения
Vitebsk DSC
 
Микросервисы на практике
Микросервисы на практикеМикросервисы на практике
Микросервисы на практике
Vitebsk DSC
 
How to exceed Customer's expectations by delivery complicated ML+RPA project
How to exceed Customer's expectations by delivery complicated ML+RPA projectHow to exceed Customer's expectations by delivery complicated ML+RPA project
How to exceed Customer's expectations by delivery complicated ML+RPA project
Vitebsk DSC
 
Аджайл майндсет. Что разрушает вашу команду?
Аджайл майндсет. Что разрушает вашу команду?Аджайл майндсет. Что разрушает вашу команду?
Аджайл майндсет. Что разрушает вашу команду?
Vitebsk DSC
 
Тестирование больших данных
Тестирование больших данныхТестирование больших данных
Тестирование больших данных
Vitebsk DSC
 
Amazon SQS или не все костыли одинаково бесполезны
Amazon SQS или не все костыли одинаково бесполезныAmazon SQS или не все костыли одинаково бесполезны
Amazon SQS или не все костыли одинаково бесполезны
Vitebsk DSC
 
Amazon Athena overview
Amazon Athena overviewAmazon Athena overview
Amazon Athena overview
Vitebsk DSC
 
Typical BA Mistakes ​in documentation
Typical BA Mistakes ​in documentationTypical BA Mistakes ​in documentation
Typical BA Mistakes ​in documentation
Vitebsk DSC
 
На пути к совершенному инжинирингу
На пути к совершенному инжинирингуНа пути к совершенному инжинирингу
На пути к совершенному инжинирингу
Vitebsk DSC
 
Чего же ты хочешь, человек?
Чего же ты хочешь, человек?Чего же ты хочешь, человек?
Чего же ты хочешь, человек?
Vitebsk DSC
 
Растем вместе с eKIDS
Растем вместе с eKIDSРастем вместе с eKIDS
Растем вместе с eKIDS
Vitebsk DSC
 
Технологии беспилотных автомобилей
Технологии беспилотных автомобилейТехнологии беспилотных автомобилей
Технологии беспилотных автомобилей
Vitebsk DSC
 
Оптимизация потребления памяти в Java - делаем уборку правильно
Оптимизация потребления памяти в Java - делаем уборку правильноОптимизация потребления памяти в Java - делаем уборку правильно
Оптимизация потребления памяти в Java - делаем уборку правильно
Vitebsk DSC
 
Управляем эволюцией на лету
Управляем эволюцией на летуУправляем эволюцией на лету
Управляем эволюцией на лету
Vitebsk DSC
 
Жизнь после promises
Жизнь после promisesЖизнь после promises
Жизнь после promises
Vitebsk DSC
 
Выбираем стратегию создания бранчей
Выбираем стратегию создания бранчейВыбираем стратегию создания бранчей
Выбираем стратегию создания бранчей
Vitebsk DSC
 
Reactive programming для успеха вашего стартапа
Reactive programming для успеха вашего стартапаReactive programming для успеха вашего стартапа
Reactive programming для успеха вашего стартапа
Vitebsk DSC
 
Экстремальная оптимизация производительности на примере MongoDB Java Driver
Экстремальная оптимизация производительности на примере MongoDB Java DriverЭкстремальная оптимизация производительности на примере MongoDB Java Driver
Экстремальная оптимизация производительности на примере MongoDB Java Driver
Vitebsk DSC
 
Проблемы с производительностью приложений на AngularJS и способы их решения
Проблемы с производительностью приложений на AngularJS и способы их решенияПроблемы с производительностью приложений на AngularJS и способы их решения
Проблемы с производительностью приложений на AngularJS и способы их решения
Vitebsk DSC
 
Микросервисы на практике
Микросервисы на практикеМикросервисы на практике
Микросервисы на практике
Vitebsk DSC
 
Ad

Recently uploaded (20)

Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdfThe Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
The Evolution of Meme Coins A New Era for Digital Currency ppt.pdf
Abi john
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 

Микросервисы со Spring Boot & Spring Cloud

  • 1. Микросервисы со Spring Boot & Spring Cloud L e a d S o f t w a r e E n g i n e e r a t E PA M A l e k s a n d r B a r m i n 3 0 Н О Я Б Р Я
  • 2. About Myself Lead Software Engineer at EPAM EPAM Lab mentor CONTACTS Email: [email protected] Twitter: @AlexBarmin ALEKSANDR BARMIN 2
  • 3. Agenda • Why Spring? • Configuration for a distributed environment. • Service Discovery using the Spring Framework. • Client-side Load Balancing. • Server-side Load Balancing. • Q&A Session. 3
  • 4. Why Spring? • Spring Framework is one of the most convenient ways to start a new Java- based application. • Spring Boot allows configuring subsystems just by adding dependencies. • Spring Cloud focuses on providing good out-of-the-box experience for typical use cases and extensibility mechanism to cover others. • Spring Cloud takes a very declarative approach, and often you get a lot of features with just a classpath change and/or an annotation.
  • 5. Main Subprojects • Spring Cloud Config • Spring Cloud Netflix • Spring Cloud Zookeeper • Spring Cloud Gateway • Spring Cloud OpenFeign • Spring Cloud Security • Spring Cloud Bus • Spring Cloud Cluster • Spring Cloud CLI • Spring Cloud Commons • Spring Cloud Connectors • Spring Cloud Contract • Spring Cloud Functions • Spring Cloud anything
  • 8. 8
  • 10. Reasoning • Centralized external configuration management. • Different configuration for different environment and profiles. • Server: • HTTP, resource-based API for external configuration. • Encryption and decryption of property values. • Embeddable using Boot Starter. • Client: • Binds to an external Config Server. • Encryption and decryption of property values.
  • 11. Spring Cloud Config Server • Configuration Storage: • Git Backend • SVN Backend • File System Backend • JDBC Backend • Composite Environment Repositories
  • 12. Spring Cloud Config 12 Cloud Config Server Spring Boot Application GIT repository SVN repository Configuration Database bootstrap.yml name: spring-boot-application profiles: default, db, local application. yml
  • 14. 14
  • 16. Reasoning • Client-side service discovery allows services to find and communicate with each other without hard coding hostname and port. The only “fixed point” in such an architecture consists of a service registry, with which each service has to register. • A drawback is that all clients must implement a certain logic to interact with this fixed point. This assumes an additional network round trip before the actual request. • To be informed about the presence of a client, they have to send a heartbeat signal to the registry.
  • 17. EUREKA • Open Source • The architecture is primarily client/server, with a set of Eureka servers per datacenter. • Provides a weakly consistent view of services, using best effort replication. • Service registrations have a short Time-To-Live (TTL), requiring clients to heartbeat with the servers. • Easy cluster administration and high scalability. • Can use additional tools like Ribbon (a client-side load balancer). • Eureka does not provide similar guarantees, and typically requires running ZooKeeper for services that need to perform coordination or have stronger consistency needs. 17 https://github.com/Netflix/eureka
  • 18. Spring Cloud Netflix Eureka 18 Eureka Server Some Business Service name:business-service host:host.server I’malive! Gateway Service Client like Web App I need a response from the business service! Do you know where is the business service? Do some job for me pls! This is the response you’ve asked!
  • 21. 21
  • 23. Feign Client • Feign client is a discovery-aware RestTemplate that uses interfaces to communication with endpoints. This interfaces will be automatically implemented at runtime, and instead of service-URLs it is using service- names. • We need to create an annotation with @EnableFeignClients to use it. • In order to create Feign Client, an interface need to be created and annotated with @FeignCleint(“service-name”) annotation. • Eureka Client needs to be enabled as well.
  • 27. Netflix Ribbon Netflix Ribbon is an Inter Process Communication (IPC) cloud library. Ribbon primarily provides client-side load balancing algorithms. Netflix Ribbon also provides the following features: • Service Discovery Integration – Ribbon load balancers provide service discovery in dynamic environments like a cloud. Integration with Eureka and Netflix service discovery component is included in the ribbon library. • Fault Tolerance – the Ribbon API can dynamically determine whether the servers are up and running in a live environment and can detect those servers that are down. • Configurable load-balancing rules – Ribbon supports RoundRobinRule, AvailabilityFilteringRule, WeightedResponseTimeRule out of the box and supports defining custom rules.
  • 28. Netflix Ribbon Ribbon API enables us to configure the following components of the load balancer: • Rule – logic component which specifies the load balancing rule we are using in our application. • Ping – a component which specifies the mechanism we use to determine the server’s availability in real-time. • ServerList – can be dynamic or static. In our case, we are using a static list of servers; hence we are defining them in the application configuration file directly.
  • 32. HYSTRIX https://github.com/Netflix/Hystrix • Provides fault tolerance and latency tolerance. • Defensive Programming with Timeout. • Defensive Programming with Limited Thread Pool. • Defensive Programming with Short Circuit Breaker Pattern. • Real time monitoring and alerting of command center on failures.
  • 35. 35
  • 36. Server side load balancing and routing
  • 37. ZUUL • Open Source • Full support HTTP/2 • Mutual TLS • Adaptive Retries • Configurable concurrency limits • Useful tools for debugging async requests, retries and routing https://github.com/Netflix/zuul/wiki
  • 38. Reasoning Zuul could be used for solving the following tasks: • Authentication • Insights • Stress Testing • Canary Testing • Dynamic Routing • Service Migration • Load Shedding • Security • Static Response handling • Active/Active traffic management
  • 39. Server side load balancing and routing demo
  • 41. Conclusion • https://github.com/aabarmin/epam-dsc-2019 • “Cloud Native Java” by Josh Long • https://spring.io/projects/spring-cloud aabarmin AlexBarmin ABarmin