JSUG勉強会〜SpringOne Platform 2016 報告会!
https://jsug.doorkeeper.jp/events/50931
で発表させて頂いた、case studyのfeedbackになります。
This is the Japanese Feedback document of SpringOnepPlatform 2016 conference.
8. 今回FeedBackするセッション
Easy Consumption of Microservices
一貫性を持って、簡単にマイクロサービスの提供・利用ができること
Moving from Monolithic Architecture to Spring Cloud and Microservices
MonoliticからMicroserviceへ移行すること
+ UI変更を柔軟に行えるようにしたい
Operating a High Velocity Large Organization with Spring Cloud Microservices
大規模なサービス・開発で高いQuality / Availability / Velocityを実現す
る
↑目標を実現する為に、
どのようにSpring周りの技術を利用していったのか
9. GOAL
Make it easy to produce and consume microservices consistently.
(一貫性を持って、簡単にマイクロサービスの提供・利用ができること)
Easy Consumption of Microservices
10. Krogerというアメリカのスーパーマーケットの会社の方々のCase Study
GOAL
Make it easy to produce and consume microservices consistently.
(一貫性を持って、簡単にマイクロサービスの提供・利用ができること)
ですので、このセッションはAPIを利用する側の話だけではなく、API(主にMicroservice)を提供する側の話でもあります
Easy Consumption of Microservices
大まかな流れ
・クライアントアプリが簡単に沢山のmicroservicesに利用(consume)できるようにしたい
・各チームが簡単にmicroservicesを提供(produce)できるようにしたい
→
・Spring Cloud(Cloud Config/Actuator/Eurekaなど)/Cloud Foundry/Spring Bootを使いたい
→
・Spring Initializerを使って簡単に配布できるようにする
・社内のプロジェクトに適応させつつGoalを満たす為のSpring Initializrのカスタマイズについて(メイン)
11. Easy Consumption of Microservices
https://start.spring.io/
https://github.com/spring-io/initializr
Spring Initializrのカスタマイズとは
Spring Initializr
Forkして改造していますよという話
12. Easy Consumption of Microservices
https://start.spring.io/
https://github.com/spring-io/initializr
Spring Initializrのカスタマイズとは
- name: Custom
content:
- name: Jasypt
id: jasypt
description: Provides Jasypt encryption support for property
sources
version: 1.6
groupId: com.github.ulisesbocchio
artifactId: jasypt-spring-boot-starter
Add a custom section(application.yml)
https://github.com/spring-io/initializr/blob/master/initializr-service/src/main/resources/application.yml
下記のファイル一度ご参照ください
自分で3rd partyのライブラリを追加できる(簡単に)
社内のプライベートなライブラリを足したりとかも
13. Easy Consumption of Microservices
https://start.spring.io/
https://github.com/spring-io/initializr
Spring Initializrのカスタマイズとは
Dependencyに追加できるようになる
14. Easy Consumption of Microservices
https://start.spring.io/
https://github.com/spring-io/initializr
Spring Initializrのカスタマイズとは
IDEからでも対応できるので安心(もちろんコンソールからでも)
15. Easy Consumption of Microservices Spring Initializrのカスタマイズとは
Step 1: Let’s add a 3rd party dependency
Step 2: Lets add a VCS .ignore file
Step 3: Lets add a customizable README
Step 4: Wait a minute! You’ve not been writing any unit tests! (Lets write some tests)
Step 5: Let’s make it easier to generate a "standard" Microservice
Step 6: Let’s enhance our Git support
Step 7: Use the GitHub API to finalize automation
その他にも様々な細かいカスタマイズの方法について触れています。
https://github.com/ssherwood/presentations/blob/master/springone-2016/easy-microservices/initializr-guide.adoc
詳細はこちら
18. Premier Inc. (NASDAQ: PINC) is a healthcare improvement company uniting
an alliance of approximately 3,600 U.S. hospitals and 120,000 other providers.
GOAL
Legacy(Monolithic/日本でありそうなLegacyでした)
をMicroserviceへ移行すること
+
UI変更を柔軟に行えるようにしたい(この会社はDashboardみたいなUIを多く提供しているようです)
Moving from Monolithic Architecture to Spring Cloud and Microservices
大まかな流れ
Microservice Architectureへ移行していった流れとその時とったアクション・課題について
→ Spring Cloud(Cloud Config/Actuator/Eurekaなど)/Spring Bootをどのように活用していったか
→ 主にCloud Configの知見
UI変更を柔軟に行いたい
→Metadata drivenなUIの構築 / Spring Cloud Configを利用してMetadataの中身を変えることで、
再起動なしで(refreshすることで)、素早く、柔軟にUIを変更できるようにした
25. Challenges
Operating a High Velocity Large Organization with Spring Cloud Microservices
大規模なサービス・開発で高いQuality / Availability / Velocityを実現する
Complex systems / Many teams / non functional qualities / Compliance / Legacy 3rd party applications / Processesなどの課題と向き合う
26. Operating a High Velocity Large Organization with Spring Cloud Microservices
Capital OneのCase Study
Challenges
大規模なサービス・開発で高いQuality / Availability / Velocityを実現する
Complex systems / Many teams / non functional qualities / Compliance / Legacy 3rd party applications / Processesなどの課題と向き合う
大まかな流れ
Microservies / 12 Factors
・一個一個のサービスは上手に作れるようになってきたけど、、
->
・Orchestrationが大変
・Service discovery(Eureka)使おう + Spring Boot Admin
+ Distributed tracingの話
・Securityの管理をそれぞれやるのも大変
->・Zuul(API gateway)使おう
Hystrixの話などもありました
28. EurekaはREST API提供しているので、
これを利用してJava以外のアプリ/ SpringBoot以外のJavaでもEureka使える
Eureka Client
https://github.com/Netflix/eureka/wiki/Understanding-eureka-client-server-communication
Eureka REST Operations
https://github.com/Netflix/eureka/wiki/Eureka-REST-operations
Operating a High Velocity Large Organization with Spring Cloud Microservices
31. If you already using Spring Cloud Discovery for your applications
you don’t have to add the Spring Boot Admin Client to your applications.
Just make the Spring Boot Admin Server a DiscoveryClient, the rest is done by our AutoConfiguration.
http://codecentric.github.io/spring-boot-admin/1.4.1/
Eureka使ってればすぐ全てのSpring Boot Applicationの情報集められます :)
Operating a High Velocity Large Organization with Spring Cloud Microservices
32. Operating a High Velocity Large Organization with Spring Cloud Microservices
API Gatewayはnetflixのzuulを利用して、authentication等を行っている
https://spring.io/guides/gs/routing-and-filtering/
Zuulのguideはこれ
ちなみに、springOnePlatformではzuulのセッションもありまして
Zuul2.0もうすぐ出るみたいです
(あくまで"もうすぐ"としか言ってなかったですが)
- Netty(non-blocking,async)
- RxJava chained filters
と、Reactiveを意識したGatewayとしての機能も盛り込まれている
http://www.slideshare.net/SpringCentral/netflixs-edge-gateway-using-zuul
33. 今回FeedBackしたセッション
Easy Consumption of Microservices
一貫性を持って、簡単にマイクロサービスの提供・利用ができること
Moving from Monolithic Architecture to Spring Cloud and Microservices
MonoliticからMicroserviceへ移行すること
+ UI変更を柔軟に行えるようにしたい
Operating a High Velocity Large Organization with Spring Cloud Microservices
大規模なサービス・開発で高いQuality / Availability / Velocityを実現す
る
Eureka Zuul Hystrix
Config
Initializr
※各セッション他の話題についても触れてはいます