“나의 과감한 수정은 전사 장애다 !”
“어떻게 서버 분리를 진행할 것인가 ?”
WAR
Front/Mobile
WAS
Legacy
WAR
Front/Mobile
WAS
Hybrid MSA
REST

API
MSA Platform
API Server API Server API Server
API Server API Server API Server
API Server API Server API Server
API Server API Server API Server
Spring
Cloud
public String anyMethodWithExternalDependency() {
// REST API
}
@HystrixCommand
public class SampleCommand extends HystrixCommand<String> {
@Override
protected String run() {
// REST API
}
}
hystrix.command.<commandKey>.
(1)metrics.rollingStats.timeInMilliseconds - Default 10
(2)circuitBreaker.requestVolumeThreshold - Default 20
(3)circuitBreaker.errorThresholdPercentage - Default 50%
(4)circuitBreaker.sleepWindowInMilliseconds - Default 5
“
”
@HystrixCommand(commandKey = “ExtDep1”)
public String anyMethodWithExternalDependency1() {
// - #1
}
@HystrixCommand(commandKey = “ExtDep1”)
public String anyMethodWithExternalDependency2() {
// - #2
}
“
”
@HystrixCommand(commandKey = “ExtDep1”,
fallbackMethod=“recommendFallback”)
public String anyMethodWithExternalDependency1() {
//
}
public String recommendFallback() {
return “< ”;
}
“
”
hystrix.command.<commandKey>.
execution.isolation.thread.timeoutInMilliseconds
- Default 1
“
”
“이 세가지를 작 적용하면 MSA 환경에서
Server 들간의 통신을 큰 문제없이 잘 될 것
같다는 생각...”
“100% 자체 개발한 API Gateway를 두고
Zuul을 도입해야 할까 ?”
WAR
Front/Mobile
WAS
REST

API
MSA Platform
API Server API Server API Server
API Server API Server API Server
API Server API Server API Server
API Server API Server API Server
Spring Cloud Zuul
API Server API Server API Server
API Server API Server API Server
Spring Cloud Zuul
API Server API Server API Server
Product API Server
Display API Server
Member API Server
Hystrix Command
Ribbon Client
Eureka Client Http Client
“
”
hystrix.command.[product|display|member].
(1)metrics.rollingStats.timeInMilliseconds - Default 10
(2)circuitBreaker.requestVolumeThreshold - Default 20
(3)circuitBreaker.errorThresholdPercentage - Default 50%
(4)circuitBreaker.sleepWindowInMilliseconds - Default 5
API Server API Server API Server
API Server API Server API Server
Spring Cloud Zuul
API Server API Server API Server
Product API Server
Display API Server
Member API Server
zuul:
ribbon-isolation-strategy: thread
API Server API Server API Server
API Server API Server API Server
Spring Cloud Zuul
API Server API Server API Server
Product API Server
Display API Server
Member API Server
“이건 우리가 원하던 모습이 아니다 !“
API Server API Server API Server
API Server API Server API Server
Spring Cloud Zuul
API Server API Server API Server
Product API Server
Display API Server
Member API Server
zuul:
threadPool:
useSeparateThreadPools: true
threadPoolKeyPrefix: zuulgw
“MSA 플랫폼 내부의 API Server 간의 호출은
어떻게 할것인가 ?”
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI Server
API GW
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI Server
API GW
“ ”
Hystrix Command
Ribbon Client
Eureka Client Http Client
“Hystrix, Eureka, Ribbon을 사용한 우리
System은 어느정도 Resilient 한거야 ? ”
API Server
API Server
API Server
Spring
Cloud Zuul
Product API Server
Display
API Server
Hystrix
Eureka
Ribbon
Hystrix
Eureka
Ribbon
<product>:
ribbon:
MaxAutoRetries: 0
MaxAutoRetriesNextServer: 2
retryableStatusCodes: 503
“
”
“
”
“Hystrix는 뭐하고 있니 ?”
API Server
API Server
API Server
Spring
Cloud Zuul
Product API Server
Display
API Server
Hystrix
Eureka
Ribbon
Hystrix
Eureka
Ribbon
Spring
Cloud Zuul
Product API Server
Display
API Server
Hystrix
Eureka
Ribbon
Hystrix
Eureka
Ribbon
API Server
API Server
API Server
API ServerAPI ServerAPI Server
WAR
Front/Mobile
WAS
REST

API
Spring Cloud Zuul
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI ServerAPI ServerAPI ServerAPI Server
Eureka Server
API ServerAPI ServerAPI Server
Hystrix + Ribbon + Eureka
Spring Cloud Feign
Hystrix + Eureka
+ Ribbon
API ServerAPI ServerAPI Server
WAR
Front/Mobile
WAS
REST

API
Spring Cloud Zuul
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI ServerAPI ServerAPI ServerAPI Server
Eureka Server
API ServerAPI ServerAPI Server
Hystrix + Ribbon + Eureka
Spring Cloud
Config Server


API ServerAPI ServerAPI Server
WAR
Front/Mobile
WAS
REST

API
Spring Cloud Zuul
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI Server
API ServerAPI ServerAPI ServerAPI ServerAPI ServerAPI Server
Eureka Server
API ServerAPI ServerAPI Server
Hystrix + Ribbon + Eureka
Spring Cloud
Config Server
Zipkin
Turbine
Spring Boot Admin
RabbitMQ InfluxDB
“기존 모니터링 시스템으로는 5%가 부족해 !”
Spring
Cloud Zuul
API Server
API Server
API Server
API Server
“ ”
Spring
Cloud Zuul
API Server
API Server
API Server
API Server
TraceID
1234
TraceID
1234
TraceID
1234
TraceID
1234
API ServerTraceID
1234
TraceID
1234
TraceID
1234
Thread Local
API ServerTraceID
1234
TraceID
XXXX
“
”
“다사다난 했던 1년 4개월”
“감사합니다.”
Spring Cloud
Zuul
http://<zuul>/product/v1/products/34343534
API Server API Server API Server API Server API Server API Server
API Server API Server API Server
http://<product>/v1/products/34343534
Product API Servers Member API Servers
Display API Servers
Eureka
Server
Spring
Cloud Zuul
Product API Server
Display
API Server
Hystrix
Eureka
Ribbon
Hystrix
Eureka
Ribbon
API Server
API Server
API Server
Spring
Cloud Zuul
Product API Server
Display
API Server
Hystrix
Eureka
Ribbon
Hystrix
Eureka
Ribbon
API Server
API Server
API Server
Spring
Cloud Zuul
Product API Server
Display
API Server
Hystrix
Eureka
Ribbon
Hystrix
Eureka
Ribbon
API Server
API Server
API Server
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기
[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기

[Spring Camp 2018] 11번가 Spring Cloud 기반 MSA로의 전환 : 지난 1년간의 이야기