狠狠撸

狠狠撸Share a Scribd company logo
Case Study
(Feedback of SpringOnePlatform)
Takahiro Fujii
Takahiro Fujii(@taka_ft)
Assistant Manager
Hotel Booking Team
Front-End Development Group
Booking Platform Team
Travel Platform Group
Introduction
楽天トラベルで開発しています
前回はRESTDocの話をしました
≈
去年
https://2015.event.springone2gx.com/schedule/
今年
https://2016.event.springoneplatform.io/schedule/2016-08-02
すごく色々な話がありそう
Spring Cloud Foundry Cloud Native
CultureAgile CI/CDData Grid DevOps
Microservice
Case Study
何の為のCase Studyなのか。
Spring Cloud Foundry
Cloud NativeCulture Agile
CI/CDData Grid
DevOpsMicroservice
自分達の目標を実現する為に、
どのようにSpring周りの技術を利用していったのか
目的
手段
Agility Productivity Availability
今回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周りの技術を利用していったのか
GOAL
Make it easy to produce and consume microservices consistently.
(一貫性を持って、簡単にマイクロサービスの提供?利用ができること)
Easy Consumption of Microservices
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のカスタマイズについて(メイン)
Easy Consumption of Microservices
https://start.spring.io/
https://github.com/spring-io/initializr
Spring Initializrのカスタマイズとは
Spring Initializr
Forkして改造していますよという話
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のライブラリを追加できる(簡単に)
社内のプライベートなライブラリを足したりとかも
Easy Consumption of Microservices
https://start.spring.io/
https://github.com/spring-io/initializr
Spring Initializrのカスタマイズとは
Dependencyに追加できるようになる
Easy Consumption of Microservices
https://start.spring.io/
https://github.com/spring-io/initializr
Spring Initializrのカスタマイズとは
IDEからでも対応できるので安心(もちろんコンソールからでも)
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
詳細はこちら
?会社の環境にあったinitializrの作成が可能なので、
個人やOpenなプロジェクトに限った利用ではなく、
各社のSpringアプリケーションのinitializrとして利用することができる。
?Microserviceになってアプリの数が増える
→各Microserviceで最低限の統一をしたいとき(Springを使って作るが前提ですが)、
Spring Initializrを使って新規プロジェクトを使ってもらうようにすると便利
?このSessionはほぼカスタマイズの話
Easy Consumption of Microservices Spring Initializrのカスタマイズとは
GOAL
Monolithic(日本でありそうなLegacy architectureでした)
をMicroserviceへ移行すること
+ UI変更を柔軟に行えるようにしたい
Moving from Monolithic Architecture to Spring Cloud and Microservices
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を変更できるようにした
http://www.slideshare.net/SpringCentral/moving-from-monolithic-architecture-to-spring-cloud-and-microservices
2008 - 2009 2010 - 2014 2015 - now
何やったか ?Struts1 -> Struts2へのバージョン
アップ
?Dojo(UI tool kit/JS framework)使っ
た
?Hibernate(ORM framework)使った
?開発環境?サーバ作るの大変
?ゆるやかにMicroserviceへ(APIなどが出
来てきて
?StrutsからSpringへ移行していきました
?UIをREST APIから分離しました
?Hibernateのベストプラクティスの整理
?Jenkins使い始めた(JenkinsからDeployで
きるようにした)
?フロントエンドをSPAに移行しはじめた
(Dashboard的なアプリ)
?CodeBases(Git)
?Dependencies(Maven)
?Config(SpringCloudConfig)
?Build, Release(Blue/Green), Run(Bamboo)
?Improve Dev/Ops process
Metadata-driven UI framework
?Enterprise logging(ElasticSearch, KIBANA)
?Standardization of best practices across
teams(architecture/framework/versions,logging)
?Container-ready(Docker)
Externalized configuration with live updates
?Insanely fast UI development
課題 ?マニュアルのデプロイ作業
?サービスアウトしないでリリースしてたの
で、リリース時にサービスが瞬断する
?スケールアップが大変
?ORMのことよく分かってない人が沢山の深
刻なパフォーマンス問題を発生させた
?JSPの制限がUIの変更のサイクルを遅くして
いた
?ライブラリのdependencyの把握が全然でき
てない
?Dojoのドキュメントすくなくて辛い
?UIを一つ変更するにも、沢山のアプリやコ
ンポーネントのデプロイ?更新が必要となっ
ていた
なぜかここからUIの課題が中心
?SPAにすることで、最初の学習コ
ストが増えた
?レガシーなブラウザへの対応
?クロスドメイン問題
?それぞれの環境へのデプロイする
のに、設定の変更などが必要なケー
スがあった
次にやろうと思った
こと
?frameworkの数最小限にしたい
?UIの実装もっと簡単にできるようにし
たい
?API化していきましょう
?レスポンシブルなUIにしましょう
?Hibernateともっと真剣に向き合う
?CI/CD使いましょう?しましょう
?UIをMetadata Drivenなものにしていく
?環境に依存する値を切り離す(Cloud
Config)
?ロギングの改善(KIBANAとかElastic
Searchとか)
?コンテナ化可能なアプリにしていく
?残っているMonolithcなアプリを分割し
ていく
?12Factorに準拠したアプリに近づける
Moving from Monolithic Architecture to Spring Cloud and Microservices
Spring Cloud Config/ActuatorをSecureな状態で運用する
spring:
datasource:
username: dbuser
password: '{cipher}FKSAJDFGYOS8F7GLHAKERGFHLSAJ'
https://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_encryption_and_decryption
?Config Serverは大切な情報を渡すことが多いので、セキュアでなければならない。
->
?Spring securityを使う
?Sensitive valueはencriptionする(cipherを使って)
Moving from Monolithic Architecture to Spring Cloud and Microservices
Spring Cloud Config/ActuatorをSecureな状態で運用する
endpoints.enabled=false
endpoints.info.enabled=true
とか
management.context-path=/manage
とか
http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-
endpoints.html#production-ready-customizing-endpoints
?Actuatorのエンドポイントを制限する
->
?management.security.enabledを有効にする
?endpointを変更して(management.context-path)intenalでしかアクセス出来ないように
制限をかける
http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-
monitoring.html#production-ready-customizing-management-server-context-path
Moving from Monolithic Architecture to Spring Cloud and Microservices
Metadata Driven UI
"provTimeSeries" : {
"container" : "provReportContainer",
"index" : 4,
"widgetData" : {
"fixtureUrl" : "****",
"fixtures" : true
},
},
"widgetProperties" : {
"chartType" : "Line",
"title" : "Payer Type Trend”
}
Moving from Monolithic Architecture to Spring Cloud and Microservices
Metadata Driven UI
"provTimeSeries" : {
"container" : "provReportContainer",
"index" : 4,
"widgetData" : {
"fixtureUrl" : "****",
"fixtures" : true
},
},
"widgetProperties" : {
"chartType" : "Line",
"title" : "Payer Type Trend”
}
Metadata driven UI各コンテンツの
?タイトル、説明
?グラフの形
?ページのデザインなどを全てcloud configで持ち、
FrontEndはMetaDataの実装しかしない。
Thymeleafで置換する値をconfigからとってくるようなイメージが近いかも
(ここの会社のアプリは基本的にSPAみたいですが)
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などの課題と向き合う
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の話などもありました
Eurekaの話はせろさんのslideがおすすめ
http://www.slideshare.net/shintanimoto/spring-boot-netflix-eureka
http://www.oracle.co.jp/jdt2016/pdf/4-E.pdf
あと、guideも
https://spring.io/guides/gs/service-registration-and-discovery/
Operating a High Velocity Large Organization with Spring Cloud Microservices
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
+ SpringBootAdmin(3rd partyが作っているツール)
https://github.com/codecentric/spring-boot-admin
Operating a High Velocity Large Organization with Spring Cloud Microservices
https://github.com/codecentric/spring-boot-admin
+ SpringBootAdmin(3rd partyが作っているツール)
Operating a High Velocity Large Organization with Spring Cloud Microservices
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
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
今回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
※各セッション他の話題についても触れてはいます
?去年のSpringOneから1年経って、Spring Cloud 周りの知見が溜まってきていて、
このようなCaseStudyが増えたのではないかと思います。
?どの会社も全ての機能を入れている訳ではなく、課題の解決をする為に順々に導入していっている
(Case Study系のセッションでこの会社は完璧にやりきった状態だ…!!
って思うところは僕がみた中では無かったです。)
?それぞれのCase Studyで比較的使いこなしているツールに違いがあって面白かった
?気になっているツールや、似たような課題がある方がいましたら、
セッションのスライドを見てみるといいと思います。
まとめ
おまけ(気になったやつ(tool))
vizceralはexampleのgithub projectがあり、簡単に動かせます。
あのぬるぬるした動きをlocalで体感できます
http://techblog.netflix.com/2016/08/vizceral-open-source.html
https://github.com/Netflix/vizceral
https://github.com/Netflix/vizceral-example
Vizceral(Netflix)
Microservice Dashboard(Ordina)
IGNITE TALKSで紹介されてたツール
https://github.com/ordina-jworks/microservices-dashboard
https://github.com/ordina-jworks/microservices-dashboard-server/tree/master/samples
やっぱりこういうdependencyを把握できるツール流行ってるというかみんな欲しがってるんですね
End.

More Related Content

What's hot (18)

PDF
マイクロサービス化設計入門 - AWS Dev Day Tokyo 2017
Yusuke Suzuki
?
PDF
ここが良かった顿补迟补诲辞驳
tyamane
?
PPTX
办颈苍迟辞苍别の开発フ?ロセスとフ?ロシ?ェクト管理ツール
Yuki Okada
?
PPTX
Spring Fest 2017 「エンタープライズで利用するSpring Boot」#jsug #sf_h1
Takeshi Hirosue
?
PPTX
Visual Studio 2017 で Azure Functions の開発
Yasuaki Matsuda
?
PPTX
自社サービス办颈苍迟辞苍别をふんだんに活用したサイボウズの开発フロー
Yuki Okada
?
PDF
ソフトバンクにおける Java による クラウドネイティブの実現
Shigeru Tatsuta
?
PPTX
なるほどわかった!App Service on Linux
Yasuaki Matsuda
?
PPTX
JIRA / Confluence の 必須プラグインはこれだ
Narichika Kajihara
?
PDF
2021/02/19 Alterbooth 多忙なアーキテクトのためのクラウド導入フレームワーク (CAF) ダイジェスト
Issei Hiraoka
?
PDF
20190427 global azurebootcamp
Tomoyuki Obi
?
PDF
マイクロサービスアーキテクチャ とは何か
Yusuke Suzuki
?
PDF
Ignite 2021秋 recap - 開発者向け新機能紹介
Kazushi Kamegawa
?
PDF
6製品1サービスの開発にPortfolio for JIRAを使ってみた
Hiroshi Ohnuki
?
PDF
Five Steps to Culture Change を日本語で解説する 2020/11/06
Issei Hiraoka
?
PDF
Spring Security 5.0 解剖速報
Takuya Iwatsuka
?
PDF
Lagom て?学ふ? Reactive Microservices Architecture @ 第3回Reactive System Meetup i...
TIS Inc.
?
マイクロサービス化設計入門 - AWS Dev Day Tokyo 2017
Yusuke Suzuki
?
ここが良かった顿补迟补诲辞驳
tyamane
?
办颈苍迟辞苍别の开発フ?ロセスとフ?ロシ?ェクト管理ツール
Yuki Okada
?
Spring Fest 2017 「エンタープライズで利用するSpring Boot」#jsug #sf_h1
Takeshi Hirosue
?
Visual Studio 2017 で Azure Functions の開発
Yasuaki Matsuda
?
自社サービス办颈苍迟辞苍别をふんだんに活用したサイボウズの开発フロー
Yuki Okada
?
ソフトバンクにおける Java による クラウドネイティブの実現
Shigeru Tatsuta
?
なるほどわかった!App Service on Linux
Yasuaki Matsuda
?
JIRA / Confluence の 必須プラグインはこれだ
Narichika Kajihara
?
2021/02/19 Alterbooth 多忙なアーキテクトのためのクラウド導入フレームワーク (CAF) ダイジェスト
Issei Hiraoka
?
20190427 global azurebootcamp
Tomoyuki Obi
?
マイクロサービスアーキテクチャ とは何か
Yusuke Suzuki
?
Ignite 2021秋 recap - 開発者向け新機能紹介
Kazushi Kamegawa
?
6製品1サービスの開発にPortfolio for JIRAを使ってみた
Hiroshi Ohnuki
?
Five Steps to Culture Change を日本語で解説する 2020/11/06
Issei Hiraoka
?
Spring Security 5.0 解剖速報
Takuya Iwatsuka
?
Lagom て?学ふ? Reactive Microservices Architecture @ 第3回Reactive System Meetup i...
TIS Inc.
?

Viewers also liked (6)

PDF
#JJUG_CCC Fall 2014 #ccc_r53 Spring Bootハンズオン~Spring Bootで作るマイクロサービスアーキテクチャ!手順書
Toshiaki Maki
?
PDF
楽天トラベルとSpring(Spring Day 2016)
Rakuten Group, Inc.
?
PDF
Spring Day 2016 springの現在過去未来
Yuichi Hasegawa
?
PDF
贬罢罢笔/2の课题と将来
Kazuho Oku
?
PPTX
Spring 12年の歴史
movmov
?
PDF
Reorganizing Website Architecture for HTTP/2 and Beyond
Kazuho Oku
?
#JJUG_CCC Fall 2014 #ccc_r53 Spring Bootハンズオン~Spring Bootで作るマイクロサービスアーキテクチャ!手順書
Toshiaki Maki
?
楽天トラベルとSpring(Spring Day 2016)
Rakuten Group, Inc.
?
Spring Day 2016 springの現在過去未来
Yuichi Hasegawa
?
贬罢罢笔/2の课题と将来
Kazuho Oku
?
Spring 12年の歴史
movmov
?
Reorganizing Website Architecture for HTTP/2 and Beyond
Kazuho Oku
?
Ad

Similar to JSUG SpringOnePlatform 2016報告会 Case study2 - feed back - springoneplatform (20)

PPTX
Spring I/O 2015 報告
Takuya Iwatsuka
?
PDF
JavaOne2017参加報告 Microservices topic & approach #jjug
驰补丑辞辞!デベロッパーネットワーク
?
PPTX
API Academy:マイクロサービス化へのファーストステップ
CA Technologies
?
PDF
Spring Bootハンズオン ~Spring Bootで作る マイクロサービスアーキテクチャ! #jjug_ccc #ccc_r53
Toshiaki Maki
?
PDF
Design Pattern MicroServices Architecture in Japanese
Lei Xu
?
PPT
Microservicesのdesign patterns
Naohiko Uramoto
?
PDF
20200708サーバーレスでの础笔滨管理の考え方
Amazon Web Services Japan
?
PDF
30分でわかるマイクロサービスアーキテクチャ 第2版
Naoki (Neo) SATO
?
PDF
Spring I/O 2018 報告会 - Spring Cloud Gateway / Spring Cloud Pipelines
Junya Katada
?
PDF
マイクロサービス運用の所感 #m3dev
Kazuhiro Sera
?
PPTX
Spring data-rest-and-spring-cloud-contract
Takeshi Ogawa
?
PDF
骋颁笔本格採用で遭遇した课题とマイクロサービス的解决
Google Cloud Platform - Japan
?
PDF
Google cloudinside3
Masaki Toyoshima
?
PDF
SpringベースのCloud Native Application
土岐 孝平
?
PDF
Spring I/O 2018 報告 RESTDocs RAML, Cloud Contract
Takuya Iwatsuka
?
PDF
BPStudy20121221
Shinichiro Takezaki
?
PDF
ochacafe#6 人にもマシンにもやさしいAPIのエコシステム
オラクルエンジニア通信
?
PDF
Quarkus による超音速な Spring アプリケーション開発
Chihiro Ito
?
PPTX
JJUG CCC 2017 Spring Seasar2からSpringへ移行した俺たちのアプリケーションがマイクロサービスアーキテクチャへ歩み始めた
Koichi Sakata
?
PPTX
JavaOne 2016 Report for Java EE
Yoshio Terada
?
Spring I/O 2015 報告
Takuya Iwatsuka
?
JavaOne2017参加報告 Microservices topic & approach #jjug
驰补丑辞辞!デベロッパーネットワーク
?
API Academy:マイクロサービス化へのファーストステップ
CA Technologies
?
Spring Bootハンズオン ~Spring Bootで作る マイクロサービスアーキテクチャ! #jjug_ccc #ccc_r53
Toshiaki Maki
?
Design Pattern MicroServices Architecture in Japanese
Lei Xu
?
Microservicesのdesign patterns
Naohiko Uramoto
?
20200708サーバーレスでの础笔滨管理の考え方
Amazon Web Services Japan
?
30分でわかるマイクロサービスアーキテクチャ 第2版
Naoki (Neo) SATO
?
Spring I/O 2018 報告会 - Spring Cloud Gateway / Spring Cloud Pipelines
Junya Katada
?
マイクロサービス運用の所感 #m3dev
Kazuhiro Sera
?
Spring data-rest-and-spring-cloud-contract
Takeshi Ogawa
?
骋颁笔本格採用で遭遇した课题とマイクロサービス的解决
Google Cloud Platform - Japan
?
Google cloudinside3
Masaki Toyoshima
?
SpringベースのCloud Native Application
土岐 孝平
?
Spring I/O 2018 報告 RESTDocs RAML, Cloud Contract
Takuya Iwatsuka
?
BPStudy20121221
Shinichiro Takezaki
?
ochacafe#6 人にもマシンにもやさしいAPIのエコシステム
オラクルエンジニア通信
?
Quarkus による超音速な Spring アプリケーション開発
Chihiro Ito
?
JJUG CCC 2017 Spring Seasar2からSpringへ移行した俺たちのアプリケーションがマイクロサービスアーキテクチャへ歩み始めた
Koichi Sakata
?
JavaOne 2016 Report for Java EE
Yoshio Terada
?
Ad

JSUG SpringOnePlatform 2016報告会 Case study2 - feed back - springoneplatform

  • 1. Case Study (Feedback of SpringOnePlatform) Takahiro Fujii
  • 2. Takahiro Fujii(@taka_ft) Assistant Manager Hotel Booking Team Front-End Development Group Booking Platform Team Travel Platform Group Introduction 楽天トラベルで開発しています 前回はRESTDocの話をしました
  • 5. すごく色々な話がありそう Spring Cloud Foundry Cloud Native CultureAgile CI/CDData Grid DevOps Microservice
  • 7. Spring Cloud Foundry Cloud NativeCulture Agile CI/CDData Grid DevOpsMicroservice 自分達の目標を実現する為に、 どのようにSpring周りの技術を利用していったのか 目的 手段 Agility Productivity Availability
  • 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を変更できるようにした
  • 20. 2008 - 2009 2010 - 2014 2015 - now 何やったか ?Struts1 -> Struts2へのバージョン アップ ?Dojo(UI tool kit/JS framework)使っ た ?Hibernate(ORM framework)使った ?開発環境?サーバ作るの大変 ?ゆるやかにMicroserviceへ(APIなどが出 来てきて ?StrutsからSpringへ移行していきました ?UIをREST APIから分離しました ?Hibernateのベストプラクティスの整理 ?Jenkins使い始めた(JenkinsからDeployで きるようにした) ?フロントエンドをSPAに移行しはじめた (Dashboard的なアプリ) ?CodeBases(Git) ?Dependencies(Maven) ?Config(SpringCloudConfig) ?Build, Release(Blue/Green), Run(Bamboo) ?Improve Dev/Ops process Metadata-driven UI framework ?Enterprise logging(ElasticSearch, KIBANA) ?Standardization of best practices across teams(architecture/framework/versions,logging) ?Container-ready(Docker) Externalized configuration with live updates ?Insanely fast UI development 課題 ?マニュアルのデプロイ作業 ?サービスアウトしないでリリースしてたの で、リリース時にサービスが瞬断する ?スケールアップが大変 ?ORMのことよく分かってない人が沢山の深 刻なパフォーマンス問題を発生させた ?JSPの制限がUIの変更のサイクルを遅くして いた ?ライブラリのdependencyの把握が全然でき てない ?Dojoのドキュメントすくなくて辛い ?UIを一つ変更するにも、沢山のアプリやコ ンポーネントのデプロイ?更新が必要となっ ていた なぜかここからUIの課題が中心 ?SPAにすることで、最初の学習コ ストが増えた ?レガシーなブラウザへの対応 ?クロスドメイン問題 ?それぞれの環境へのデプロイする のに、設定の変更などが必要なケー スがあった 次にやろうと思った こと ?frameworkの数最小限にしたい ?UIの実装もっと簡単にできるようにし たい ?API化していきましょう ?レスポンシブルなUIにしましょう ?Hibernateともっと真剣に向き合う ?CI/CD使いましょう?しましょう ?UIをMetadata Drivenなものにしていく ?環境に依存する値を切り離す(Cloud Config) ?ロギングの改善(KIBANAとかElastic Searchとか) ?コンテナ化可能なアプリにしていく ?残っているMonolithcなアプリを分割し ていく ?12Factorに準拠したアプリに近づける
  • 21. Moving from Monolithic Architecture to Spring Cloud and Microservices Spring Cloud Config/ActuatorをSecureな状態で運用する spring: datasource: username: dbuser password: '{cipher}FKSAJDFGYOS8F7GLHAKERGFHLSAJ' https://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_encryption_and_decryption ?Config Serverは大切な情報を渡すことが多いので、セキュアでなければならない。 -> ?Spring securityを使う ?Sensitive valueはencriptionする(cipherを使って)
  • 22. Moving from Monolithic Architecture to Spring Cloud and Microservices Spring Cloud Config/ActuatorをSecureな状態で運用する endpoints.enabled=false endpoints.info.enabled=true とか management.context-path=/manage とか http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready- endpoints.html#production-ready-customizing-endpoints ?Actuatorのエンドポイントを制限する -> ?management.security.enabledを有効にする ?endpointを変更して(management.context-path)intenalでしかアクセス出来ないように 制限をかける http://docs.spring.io/spring-boot/docs/current/reference/html/production-ready- monitoring.html#production-ready-customizing-management-server-context-path
  • 23. Moving from Monolithic Architecture to Spring Cloud and Microservices Metadata Driven UI "provTimeSeries" : { "container" : "provReportContainer", "index" : 4, "widgetData" : { "fixtureUrl" : "****", "fixtures" : true }, }, "widgetProperties" : { "chartType" : "Line", "title" : "Payer Type Trend” }
  • 24. Moving from Monolithic Architecture to Spring Cloud and Microservices Metadata Driven UI "provTimeSeries" : { "container" : "provReportContainer", "index" : 4, "widgetData" : { "fixtureUrl" : "****", "fixtures" : true }, }, "widgetProperties" : { "chartType" : "Line", "title" : "Payer Type Trend” } Metadata driven UI各コンテンツの ?タイトル、説明 ?グラフの形 ?ページのデザインなどを全てcloud configで持ち、 FrontEndはMetaDataの実装しかしない。 Thymeleafで置換する値をconfigからとってくるようなイメージが近いかも (ここの会社のアプリは基本的にSPAみたいですが)
  • 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 ※各セッション他の話題についても触れてはいます
  • 34. ?去年のSpringOneから1年経って、Spring Cloud 周りの知見が溜まってきていて、 このようなCaseStudyが増えたのではないかと思います。 ?どの会社も全ての機能を入れている訳ではなく、課題の解決をする為に順々に導入していっている (Case Study系のセッションでこの会社は完璧にやりきった状態だ…!! って思うところは僕がみた中では無かったです。) ?それぞれのCase Studyで比較的使いこなしているツールに違いがあって面白かった ?気になっているツールや、似たような課題がある方がいましたら、 セッションのスライドを見てみるといいと思います。 まとめ
  • 35. おまけ(気になったやつ(tool)) vizceralはexampleのgithub projectがあり、簡単に動かせます。 あのぬるぬるした動きをlocalで体感できます http://techblog.netflix.com/2016/08/vizceral-open-source.html https://github.com/Netflix/vizceral https://github.com/Netflix/vizceral-example Vizceral(Netflix) Microservice Dashboard(Ordina) IGNITE TALKSで紹介されてたツール https://github.com/ordina-jworks/microservices-dashboard https://github.com/ordina-jworks/microservices-dashboard-server/tree/master/samples やっぱりこういうdependencyを把握できるツール流行ってるというかみんな欲しがってるんですね
  • 36. End.