Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Open Shift.Run2019 マイクロサービスの開発に疲れる前にdaprを使おう

Dapr <http://dapr.io> の紹介

  • Als Erste(r) kommentieren

Open Shift.Run2019 マイクロサービスの開発に疲れる前にdaprを使おう

  1. 1. http://akubicharm.hatenablog.com/ コンサルタント OpenShiftのSA OpenShiftや Red Hat クラウドソリューショアーキテクト UNIX Linux Cloud
  2. 2. エンタープライズ アプリケーションに 求められる要件
  3. 3. An event-driven, portable runtime for building microservices on cloud a d ap r
  4. 4. Any code or framework… Functions S er vices writ ten in .NET Core Microservice application Service-to-service invocation State management Publish and subscribe Resource bindings & triggers Actors Distributed tracing Extensible… HTTP/gRPC APIs Any cloud or edge infrastructure
  5. 5. http://localhost:3500/v1.0/invoke/myapp/method/neworder Application Code API Service-to- service invocation State management Pub/Sub Resources Bindings & triggers Actor runtime Distributed tracing Extensible… HTTP/gRP C
  6. 6. State stores Publish and subscribe Resource bindingsScanning for events Application Dapr APIDapr API Messaging Load and save state Service code B Service code A
  7. 7. Pod HTTP/gRP C ContainerContainer Application Code API Service-to- service invocation State management Pub/Sub Resources Bindings & triggers Actor runtime Distributed tracing Extensible…
  8. 8. Pod C O N T A I N E R Service code C O N T A I N E R Sidecar Publish and subscribe Components Component management State stores Input/output bindings Deploys and manages Dapr Any cloud or edge infrastructure Dapr API HTTPorgRPC Use components Update component changes to runtime Injects Dapr runtime Updates actor partition placement Pod C O N T A I N E R Sidecar Injector Pod C O N T A I N E R Operator Pod C O N T A I N E R Placement
  9. 9. Pod C O N T A I N E R Service code C O N T A I N E R Sidecar Publish and subscribe Components Component management State stores Input/output bindings Deploys and manages Dapr Any cloud or edge infrastructure Dapr API HTTPorgRPC Use components Update component changes to runtime Injects Dapr runtime Updates actor partition placement Pod C O N T A I N E R Sidecar Injector Pod C O N T A I N E R Operator Pod C O N T A I N E R Placement
  10. 10. Pod C O N T A I N E R Service code C O N T A I N E R Sidecar Publish and subscribe Components Component management State stores Input/output bindings Deploys and manages Dapr Any cloud or edge infrastructure Dapr API HTTPorgRPC Use components Update component changes to runtime Injects Dapr runtime Updates actor partition placement Pod C O N T A I N E R Sidecar Injector Pod C O N T A I N E R Operator Pod C O N T A I N E R Placement apiVersion: dapr.io/v1alpha1 kind: Component metadata: name: statestore spec: type: state.redis metadata: - name: redisHost value: redis-master:6379 - name: redisPassword value: 2wmOfki2hS
  11. 11. Pod C O N T A I N E R Service code C O N T A I N E R Sidecar Publish and subscribe Components Component management State stores Input/output bindings Deploys and manages Dapr Any cloud or edge infrastructure Dapr API HTTPorgRPC Use components Update component changes to runtime Injects Dapr runtime Updates actor partition placement Pod C O N T A I N E R Sidecar Injector Pod C O N T A I N E R Operator Pod C O N T A I N E R Placement apiVersion: apps/v1 kind: Deployment metadata: name: nodeapp labels: app: node spec: replicas: 1 selector: matchLabels: app: node template: metadata: labels: app: node annotations: dapr.io/enabled: "true" dapr.io/id: "nodeapp" dapr.io/port: "3000"
  12. 12. Any code or framework… Functions S er vices writ ten in .NET Core Microservice application Service-to-service invocation State management Publish and subscribe Resource bindings & triggers Actors Distributed tracing Extensible… HTTP/gRPC APIs Any cloud or edge infrastructure
  13. 13. ステート管理 長時間生存するステートレス なサービスやステートフルな サービスのステートを管理 リソースバインディング 大量の入力バインディングと 出力バインディングからデー タベースやキューを含む外部 リソースへのイベントを通じ てコードをトリガー Publish / Subscribe サービス間の安全でスケーラ ブルなメッセージング アクター マイクロサービスのデザイン パターんであるアクターパ ターンで、非同期にサービス を連携 分散トレーシングと 診断 コンポーネントやネットワー クをまたがるサービスの呼び 出しの観測と可視化 サービス呼び出しと 例外処理 安全で直接的なサービス間の メソッド呼び出し
  14. 14. State management State stores App “cart” POST GET Key Value cart-cust1 { “name”: ”coffee”, “quantity”: “1” } [appId]-[key]
  15. 15. App “front” App “cart” POST POST
  16. 16. App “cartapp” App “frontapp” POST POST AppID Port AppPor t cartapp 3500 3000 POST
  17. 17. 動画はこちら>https://youtu.be/RduoDzuVtDQ https://github.com/dapr/samples/tree/master/2.hello-kubernetes のデモ
  18. 18. Dapr API Input binding Python microservice Dapr API Node microservice Output binding
  19. 19. GET/POST http://localhost:8000/trigger { "user":"johndoe" } RedisSQSEvent HubsKafka Redis Kafka SQS Event Hubs App
  20. 20. { "data": { "sku":"v100", "quantity":"50" } } POST http://localhost:3500/v1.0/bindings/inventory DynamoDBRedisEvent HubsCosmosDBKafkaSQS Redis DynamoDB Kafka SQS Event Hubs CosmosDB App
  21. 21. App “email” App “shipping” App “cart” POST POST POST
  22. 22. Azure MonitorDatadogInstanaJaegerSignalFXPrometheus+ many more Azure Monitor + many more Datadog Instana Jaeger SignalFX Prometheus App “frontend” App “backend”
  23. 23. ステートを持つ、シグル スレッドで実行されるス トレージとコンピュー ティングのユニット Dapr Actor Features: • 分散とフェールオーバー • ターンに基づくアクセス • 状態管理 • タイマー • リマインダー Host/Pod Host/Pod Video Game Enemy
  24. 24. Pod X Actor A Actor B Pod Y Actor C Actor D App POST http://localhost:3500/v1.0/actors/MyActors/A/method/updateName Invoke Actor POST http://10.0.0.6:6004/update { "name":"A" } { "name":"A" } Placement Service Get Actor Location
  25. 25. Node X Actor A Actor B Node Y Actor C Actor D App POST http://localhost:3500/v1.0/actors/MyActors/A/method/updateName Invoke Actor { "name":"A" } Placement Service Get Actor Location POST http://10.0.0.7:6005/update { "name":"A" } Actor C Allocate
  26. 26. Component電卓アプリ Expoter Azure Monitor UI 足し算 引き算 掛け算 割り算 LocalForwader
  27. 27. Any code or framework… Functions S er vices writ ten in .NET Core Microservice application Service-to-service invocation State management Publish and subscribe Resource bindings & triggers Actors Distributed tracing Extensible… HTTP/gRPC APIs Any cloud or edge infrastructure
  28. 28. https://www.atmarkit.co.jp/ait/articles/1912/19/news035.html

×