SlideShare a Scribd company logo
1 of 28
1
Confidential
Cloud Native Applications
using Spring Cloud Netflix
Jacek Bukowski
Consultant Engineering
JUG Zielona Góra 30.11.2016
2
Confidential
Confidential
Spring was always about simplifying the complicated
aspects of your enterprise system. Netflix went to
microservice architecture long before this term even
was created. Both are very much contributed to open
source software. How can you benefit from joint
forces of the both?
Joint forces of Netflix and Spring
3
Confidential
Cloud and Cloud Native Application
4
Confidential
Confidential
any computing environment in which computing,
networking, and storage resources can be
provisioned and released elastically in an on-demand,
self-service manner
from „Migrating to Cloud Native Applications Architectures” by Matt Stine
Cloud
5
Confidential
Target cloud
Service model Cloud Provider
SaaS PaaS
IaaS MBaaS
EaaS
XaaS
*aaS
6
Confidential
Technology stack
Language Persistence
7
Confidential
• Style of application development
• Characteristics
- Twelve-Factor Applications – http://12factor.net
- Microservices
- Self-Service Agile Infrastructure
- API-Based Collaboration
- Antifragility
• Cultural & Organizational changes
Cloud Native
8
Confidential
• Codebase
- One codebase tracked in revision control,
many deploys
• Dependencies
- Explicitly declare and isolate dependencies
• Config
- Store config in the environment
• Backing services
- Treat backing services as attached resources
• Build, release, run
- Strictly separate build and run stages
• Processes
- Execute the app as one or more stateless
processes
The Twelve-Factor App (from 12factor.net)
• Port binding
- Export services via port binding
• Concurrency
- Scale out via the process model
• Disposability
- Maximize robustness with fast startup and
graceful shutdown
• Dev/prod parity
- Keep development, staging, and production as
similar as possible
• Logs
- Treat logs as event streams
• Admin processes
- Run admin/management tasks as one-off
processes
9
Confidential
• Style of application development
• Characteristics
- Twelve-Factor Applications – http://12factor.net
- Microservices
- Self-Service Agile Infrastructure
- API-Based Collaboration
- Antifragility
• Cultural & Organizational changes
Cloud Native
10
Confidential
Netflix
11
Confidential
• Moved away of monolithic architecture before
microservices where named (started in 2009,
ended early 2016)
• 30% of the Internet traffic
• 500+ microservices
• 2+ billion API gateway requests daily
• Each API call requires avarage six calls to
backend services
• Over 800 different client devices
• Open sourced much of their tools and
services
Netflix – some facts
12
Confidential
• Netflix provides the Open Source Software
Center: http://netflix.github.io/
- Big Data
- Build and Delivery Tools
- Common Runtime Services & Libraries
- Content Encoding
- Data Persistence
- Insight, Reliability and Performance
- Security
- User Interface
Netflix Open Source Software (OSS)
13
Confidential
• Eureka – registry/service discovery
• Archaius – distributed configuration
• Ribbon – inter process and service
communication
• Hystrix – reliability of calls and fault tolerance
• Karyon and Governator – containers
• Prana – support for non-JVM runtimes
• Zuul – dynamic routing, monitoring, resiliency
and security, used to handle front end
requests
• Fenzo – scheduler for Apache Mesos
Netflix Open Source Software (OSS)
Runtime and Libraries
14
Confidential
Spring Cloud
15
Confidential
• Facilitates the Cloud Native styles
• Common features required by all the components in a
distributed system
- Distributed/versioned configuration
- Service registration and discovery
- Routing
- Service-to-service calls
- Load balancing
- Circuit Breakers
- Global locks
- Leadership election and cluster state
- Distributed messaging
Spring Cloud
16
Confidential
Spring Cloud
Spring Boot
Spring
Spring Cloud Context Spring Cloud Commons
Spring Cloud Netfix Spring Cloud Consul
Spring Cloud Config
Spring Cloud for
Amazon Web Services
Spring Cloud Bus
Spring Cloud for
Cloud Foundry
Spring Cloud ...
17
Confidential
• Parent of Main Application Context
• Used to load properties from external sources
• Out of the box loads properties form Config
Server
• Can be configured to do anything you want
• Handling environment changes
- Re-bind @ConfigurationProperties
- Set log levels for logging.level.*
- @RefreshScope
Spring Boot Context
Bootstrap Context
Environment
Main Applicatin Context
Bootstrap
Context
application.yml
application-{profile}.yml
bootstrap.yml
bootstrap-{profile}.yml
External properties
(e.g. Config Server)
Higher
precedence
18
Confidential
• HTTP, resource-based API for external
configuration
• JSON/YML/properties resources
• Git backend (default)
• Integrates with Spring Security
Spring Cloud Config
• Config-first bootstrap
• Discovery-first bootstrap
• Fail-fast option
• Like reading local application*.yml
family with extra dimention „label”
Config Server Config Client
/{application}/{profile}/{label}
${spring.application.name}
${spring.profiles.active}
master
spring.cloud.config.[name|env|label]
/{application}/{profile}[/{label}]
/{application}-{profile}.yml
/{label}/{application}-{profile}.yml
/{application}-{profile}.properties
/{label}/{application}-{profile}.properties
19
Confidential
• Service Discovery
• Load Balancing
• Circuit Breakers
• Implementations:
- Spring Cloud Netflix
- Spring Cloud Consule
Spring Cloud Commons
Common Abstractions
20
Confidential
• Enable common patterns with just
annotations:
- Discovery: Eureka
- Circuit Breaker: Hystrix
- Client Side Load Balancer: Ribbon
- Declarative REST Client: Feign
- Router and Filter: Zuul
- External Configuration: Archaius
Spring Cloud Netflix
21
Confidential
• Run by @EnableEurekaServer
• By default is also a client, so needs a peer
• Optional standalone mode
• Keep registration in memory
Discovery: Eureka
• Enable by @EnableDiscoveryClient
or @EnableEurekaClient
• Sending heartbeats to Eureka server
• Optionally send full health check status
• Special virutal URL: http://users/...
• Discovery clients:
- Native EurekaClient
- Spring Cloud DiscoveryClient
- Feign client
- Spring RestTemplate
Eureka Server Eureka Client
22
Confidential
• Proxy the beans enabling circuit breaker
• Enabled by annotation on the method
@HystrixCommand(fallbackMethod=„”)
public Article getArticle(String id)
{
// call external system
}
• Fallback can be provided
• Hystrix metrics stream: /hystrix.stream
• Hystrix Dashboard
• Turbine combining hystrix streams
Circuit Breaker: Hystrix
23
Confidential
• Used by default in @FeignClient
• Ribbon API can be used directly
• Configuring by <client>.ribbon.listOfServers
• Can get „listOfServers” from Eureka, if available
Client side load balancer: Ribbon
24
Confidential
• Declarative Web Service Client
• Create interface and annotate it
- Feign annotations, JAX-RS annotations, Spring MVC (added by Spring
Cloud)
@FeignClient(name = "articles-service")
public interface ArticlesClient {
@RequestMapping(value = "/articles/{id}", method =
RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public Article getArticle(@PathVariable("id") String id);
}
• In Spring Cloud uses Eureka, Ribbon and Hystrix
Feign Client
25
Confidential
Demo
26
Confidential
Registry Server
(Eureka)
Config
Server
News Service
Articles Service
Client
Git
YAML files
get properties – default
number of articles
find Articles
Service
Get article
content
Give me news!
• Load balanced
• Protected with Circuit Breaker
1 class
1 class
5 classes
4 classes
Articles Service
27
Confidential
Questions
28
Confidential
Thank you
Jacek Bukowski
Consultant Engineering
jacek.bukowski@globallogic.com
+48 728 869 133
Github: https://github.com/buczyn/spring-cloud-netflix-demo

More Related Content

Similar to spring-cloud.pptx

Centralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container OperationsCentralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container OperationsKublr
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)Allan Naim
 
VTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud ComputingVTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud ComputingSachin Gowda
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes servicesRajesh Kolla
 
Hybridní cloud s F5 v prostředí kontejnerů
Hybridní cloud s F5 v prostředí kontejnerůHybridní cloud s F5 v prostředí kontejnerů
Hybridní cloud s F5 v prostředí kontejnerůMarketingArrowECS_CZ
 
What's New in IBM Streams V4.1
What's New in IBM Streams V4.1What's New in IBM Streams V4.1
What's New in IBM Streams V4.1lisanl
 
F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017Guy Brown
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Tony Erwin
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops OverviewJoel W. King
 
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 RibbonVMware Tanzu
 
Opal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsOpal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsSriram Krishnan
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Mandi Walls
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013aspyker
 
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...PROIDEA
 
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStack
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStackPLNOG 17 - Grzegorz Kornacki - F5 and OpenStack
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStackPROIDEA
 
BRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdf
BRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdfBRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdf
BRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdfssuserc6aaff
 
OpenStack Grizzly Release
OpenStack Grizzly ReleaseOpenStack Grizzly Release
OpenStack Grizzly ReleaseOpenStack
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudAndrew Coleman
 

Similar to spring-cloud.pptx (20)

Centralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container OperationsCentralizing Kubernetes and Container Operations
Centralizing Kubernetes and Container Operations
 
Openstack days sv building highly available services using kubernetes (preso)
Openstack days sv   building highly available services using kubernetes (preso)Openstack days sv   building highly available services using kubernetes (preso)
Openstack days sv building highly available services using kubernetes (preso)
 
VTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud ComputingVTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
VTU Open Elective 6th Sem CSE - Module 2 - Cloud Computing
 
Container orchestration k8s azure kubernetes services
Container orchestration  k8s azure kubernetes servicesContainer orchestration  k8s azure kubernetes services
Container orchestration k8s azure kubernetes services
 
Hybridní cloud s F5 v prostředí kontejnerů
Hybridní cloud s F5 v prostředí kontejnerůHybridní cloud s F5 v prostředí kontejnerů
Hybridní cloud s F5 v prostředí kontejnerů
 
F5 Cloud Story
F5 Cloud StoryF5 Cloud Story
F5 Cloud Story
 
What's New in IBM Streams V4.1
What's New in IBM Streams V4.1What's New in IBM Streams V4.1
What's New in IBM Streams V4.1
 
Sas 2015 event_driven
Sas 2015 event_drivenSas 2015 event_driven
Sas 2015 event_driven
 
F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017F5 Meetup presentation automation 2017
F5 Meetup presentation automation 2017
 
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
Migration of an Enterprise UI Microservice System from Cloud Foundry to Kuber...
 
Net Devops Overview
Net Devops OverviewNet Devops Overview
Net Devops Overview
 
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
 
Opal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsOpal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific Applications
 
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
Habitat talk at CodeMonsters Sofia, Bulgaria Nov 27 2018
 
NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013NetflixOSS for Triangle Devops Oct 2013
NetflixOSS for Triangle Devops Oct 2013
 
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
PLNOG16: Automatyzacja kreaowania usług operatorskich w separacji od rodzaju ...
 
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStack
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStackPLNOG 17 - Grzegorz Kornacki - F5 and OpenStack
PLNOG 17 - Grzegorz Kornacki - F5 and OpenStack
 
BRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdf
BRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdfBRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdf
BRKVIR-2601 Architecting an OpenStack Based Cloud with Cisco Infrastructure.pdf
 
OpenStack Grizzly Release
OpenStack Grizzly ReleaseOpenStack Grizzly Release
OpenStack Grizzly Release
 
IBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the CloudIBM InterConnect 2015 - IIB in the Cloud
IBM InterConnect 2015 - IIB in the Cloud
 

Recently uploaded

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 

Recently uploaded (20)

Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 

spring-cloud.pptx

  • 1. 1 Confidential Cloud Native Applications using Spring Cloud Netflix Jacek Bukowski Consultant Engineering JUG Zielona Góra 30.11.2016
  • 2. 2 Confidential Confidential Spring was always about simplifying the complicated aspects of your enterprise system. Netflix went to microservice architecture long before this term even was created. Both are very much contributed to open source software. How can you benefit from joint forces of the both? Joint forces of Netflix and Spring
  • 3. 3 Confidential Cloud and Cloud Native Application
  • 4. 4 Confidential Confidential any computing environment in which computing, networking, and storage resources can be provisioned and released elastically in an on-demand, self-service manner from „Migrating to Cloud Native Applications Architectures” by Matt Stine Cloud
  • 5. 5 Confidential Target cloud Service model Cloud Provider SaaS PaaS IaaS MBaaS EaaS XaaS *aaS
  • 7. 7 Confidential • Style of application development • Characteristics - Twelve-Factor Applications – http://12factor.net - Microservices - Self-Service Agile Infrastructure - API-Based Collaboration - Antifragility • Cultural & Organizational changes Cloud Native
  • 8. 8 Confidential • Codebase - One codebase tracked in revision control, many deploys • Dependencies - Explicitly declare and isolate dependencies • Config - Store config in the environment • Backing services - Treat backing services as attached resources • Build, release, run - Strictly separate build and run stages • Processes - Execute the app as one or more stateless processes The Twelve-Factor App (from 12factor.net) • Port binding - Export services via port binding • Concurrency - Scale out via the process model • Disposability - Maximize robustness with fast startup and graceful shutdown • Dev/prod parity - Keep development, staging, and production as similar as possible • Logs - Treat logs as event streams • Admin processes - Run admin/management tasks as one-off processes
  • 9. 9 Confidential • Style of application development • Characteristics - Twelve-Factor Applications – http://12factor.net - Microservices - Self-Service Agile Infrastructure - API-Based Collaboration - Antifragility • Cultural & Organizational changes Cloud Native
  • 11. 11 Confidential • Moved away of monolithic architecture before microservices where named (started in 2009, ended early 2016) • 30% of the Internet traffic • 500+ microservices • 2+ billion API gateway requests daily • Each API call requires avarage six calls to backend services • Over 800 different client devices • Open sourced much of their tools and services Netflix – some facts
  • 12. 12 Confidential • Netflix provides the Open Source Software Center: http://netflix.github.io/ - Big Data - Build and Delivery Tools - Common Runtime Services & Libraries - Content Encoding - Data Persistence - Insight, Reliability and Performance - Security - User Interface Netflix Open Source Software (OSS)
  • 13. 13 Confidential • Eureka – registry/service discovery • Archaius – distributed configuration • Ribbon – inter process and service communication • Hystrix – reliability of calls and fault tolerance • Karyon and Governator – containers • Prana – support for non-JVM runtimes • Zuul – dynamic routing, monitoring, resiliency and security, used to handle front end requests • Fenzo – scheduler for Apache Mesos Netflix Open Source Software (OSS) Runtime and Libraries
  • 15. 15 Confidential • Facilitates the Cloud Native styles • Common features required by all the components in a distributed system - Distributed/versioned configuration - Service registration and discovery - Routing - Service-to-service calls - Load balancing - Circuit Breakers - Global locks - Leadership election and cluster state - Distributed messaging Spring Cloud
  • 16. 16 Confidential Spring Cloud Spring Boot Spring Spring Cloud Context Spring Cloud Commons Spring Cloud Netfix Spring Cloud Consul Spring Cloud Config Spring Cloud for Amazon Web Services Spring Cloud Bus Spring Cloud for Cloud Foundry Spring Cloud ...
  • 17. 17 Confidential • Parent of Main Application Context • Used to load properties from external sources • Out of the box loads properties form Config Server • Can be configured to do anything you want • Handling environment changes - Re-bind @ConfigurationProperties - Set log levels for logging.level.* - @RefreshScope Spring Boot Context Bootstrap Context Environment Main Applicatin Context Bootstrap Context application.yml application-{profile}.yml bootstrap.yml bootstrap-{profile}.yml External properties (e.g. Config Server) Higher precedence
  • 18. 18 Confidential • HTTP, resource-based API for external configuration • JSON/YML/properties resources • Git backend (default) • Integrates with Spring Security Spring Cloud Config • Config-first bootstrap • Discovery-first bootstrap • Fail-fast option • Like reading local application*.yml family with extra dimention „label” Config Server Config Client /{application}/{profile}/{label} ${spring.application.name} ${spring.profiles.active} master spring.cloud.config.[name|env|label] /{application}/{profile}[/{label}] /{application}-{profile}.yml /{label}/{application}-{profile}.yml /{application}-{profile}.properties /{label}/{application}-{profile}.properties
  • 19. 19 Confidential • Service Discovery • Load Balancing • Circuit Breakers • Implementations: - Spring Cloud Netflix - Spring Cloud Consule Spring Cloud Commons Common Abstractions
  • 20. 20 Confidential • Enable common patterns with just annotations: - Discovery: Eureka - Circuit Breaker: Hystrix - Client Side Load Balancer: Ribbon - Declarative REST Client: Feign - Router and Filter: Zuul - External Configuration: Archaius Spring Cloud Netflix
  • 21. 21 Confidential • Run by @EnableEurekaServer • By default is also a client, so needs a peer • Optional standalone mode • Keep registration in memory Discovery: Eureka • Enable by @EnableDiscoveryClient or @EnableEurekaClient • Sending heartbeats to Eureka server • Optionally send full health check status • Special virutal URL: http://users/... • Discovery clients: - Native EurekaClient - Spring Cloud DiscoveryClient - Feign client - Spring RestTemplate Eureka Server Eureka Client
  • 22. 22 Confidential • Proxy the beans enabling circuit breaker • Enabled by annotation on the method @HystrixCommand(fallbackMethod=„”) public Article getArticle(String id) { // call external system } • Fallback can be provided • Hystrix metrics stream: /hystrix.stream • Hystrix Dashboard • Turbine combining hystrix streams Circuit Breaker: Hystrix
  • 23. 23 Confidential • Used by default in @FeignClient • Ribbon API can be used directly • Configuring by <client>.ribbon.listOfServers • Can get „listOfServers” from Eureka, if available Client side load balancer: Ribbon
  • 24. 24 Confidential • Declarative Web Service Client • Create interface and annotate it - Feign annotations, JAX-RS annotations, Spring MVC (added by Spring Cloud) @FeignClient(name = "articles-service") public interface ArticlesClient { @RequestMapping(value = "/articles/{id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) public Article getArticle(@PathVariable("id") String id); } • In Spring Cloud uses Eureka, Ribbon and Hystrix Feign Client
  • 26. 26 Confidential Registry Server (Eureka) Config Server News Service Articles Service Client Git YAML files get properties – default number of articles find Articles Service Get article content Give me news! • Load balanced • Protected with Circuit Breaker 1 class 1 class 5 classes 4 classes Articles Service
  • 28. 28 Confidential Thank you Jacek Bukowski Consultant Engineering jacek.bukowski@globallogic.com +48 728 869 133 Github: https://github.com/buczyn/spring-cloud-netflix-demo