SlideShare a Scribd company logo
1 of 66
Download to read offline
Let's Build a
Serverless Architecture
in Scala!
Yoshitaka Fujii (@yoshiyoshifujii)

2017 ScalaMatsuri

Saturday, February 25th

16:30 - 17:10 Conference Room 1
Who am I ?
• Yoshitaka Fujii (@yoshiyoshifujii)
• Joined MOTEX in April, 2014
• Software Engineer
• Scala(19 months)
• Scala Kansai summit 2016 staff.
自己紹介。エムオーテックス株式会社。Scala歴19ヶ月。Scala関西サミット2016でスタッフさせていただきました。
Agenda
• Serverless Architecture
• Development & Deployment
• DDD
Serverless Architecture
• using FaaS
• a significant reduction in costs
• scalability
• the lack of operating and maintaining infrastructure
サーバレスアーキテクチャとは、FaaSを活用したシステム。コストの大幅な削減。スケーラビリティ。 インフラの運用管理が不要。
Function as a Service
• AWS Lambda
• Google Cloud Function
• Microsoft Azure Functions
AWS Lambda
• AWS Lambda is a compute service that lets you run code without
provisioning or managing servers.
• executes your code only when needed.
• scales automatically, a few requests per day to thousands per second.
• Node.js, Java, C# and Python
AWS Lambda はサーバーをプロビジョニングしたり管理しなくてもコードを実行できるコンピューティングサービスです。必要な
ときにコードを実行し、自動的にスケールします。
AWS Lambda Events
• API Gateway (HTTP Requests)
• Kinesis Streams
• DynamoDB
• S3
• Schedule (CloudWatch)
• SNS
• IoT
これらのAWSサービスのイベントに応じてAWS Lambdaを実行できます。今回は、主にAPI GatewayとKinesis Streamsについて
取り上げます。
Amazon API Gateway
• Amazon API Gateway is a fully managed service that makes it easy for
developers to create, publish, maintain, monitor, and secure APIs at any scale.
• Low-Cost and Efficient.

(only for calls made to your APIs and data transfer out)
• Performance at Any Scale
• Run Your APIs Without Servers
フルマネージドサービスで、開発者はどのようなスケールであっても、簡単に API の作成、配布、保守、監視、保護が行えます。
https://aws.amazon.com/jp/api-gateway/details/
Amazon Kinesis Streams
• Use Amazon Kinesis Streams to collect and process large streams of data records in real
time.
• rapid and continuous data intake and aggregation.
• Accelerated log and data feed intake and processing.
• Real-time metrics and reporting.
• Real-time data analytics.
• Complex stream processing.
Amazon Kinesis Streams を使用して、データレコードの大量のストリームをリアルタイムで収集し、処理します。 高速かつ継続的
にデータの取り込みと集約を行うことができます。
https://docs.aws.amazon.com/ja_jp/streams/latest/dev/key-concepts.html
Amazon API
Gatewayclient
AWS
Lambda
Amazon
S3
Amazon
DynamoDB
Amazon
Kinesis
AWS
Lambda
AWS
Lambda
Amazon
Elasticsearch Service
Context + Token
Principal + Policy
Policy is
cached
Denied
403
Allowed
Auth function
Consumers function
System diagrams
Amazon API
Gateway
client
AWS
Lambda
Amazon
S3
Amazon
DynamoDB
Amazon
Kinesis
AWS
Lambda
Amazon
Elasticsearch Service
Policy is
cached
Large scale system
client
client
client
client
client
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
AWS
Lambda
大規模なシステムを想定しています。
Large scale system
• More functional requirements.
• AWS Lambda wants to be a simple function.
• 1 Lambda per method request.

GET:/hello => getHello

POST:/hello => postHello
• develop and deploy efficiently
大規模なシステムは、機能要件が多い。AWS LambdaはシンプルなFunctionを保ちたい。1メソッドリクエストにつきLambdaを1
つ。また効率良く開発とデプロイをしたい。
Development & Deployment
実際に開発してデプロイするあたりを紹介します。
How to make simple AWS Lambda.
単純なAWS Lambdaの作り方を紹介します。
RequestStreamHandler.java
public interface RequestStreamHandler {
/**
* Handles a Lambda Function request
* @param input The Lambda Function input stream
* @param output The Lambda function output stream
* @param context The Lambda execution environment context object.
* @throws IOException
*/
public void handleRequest(InputStream input, OutputStream output, Context context)
throws IOException;
}
AWS Lambdaの公開インタフェースです。この中身を実装すると任意の処理が実行できます。
RequestHandler.java
public interface RequestHandler<I, O> {
/**
* Handles a Lambda Function request
* @param input The Lambda Function input
* @param context The Lambda execution environment context object.
* @return The Lambda Function output
*/
public O handleRequest(I input, Context context);
}
I/Oを任意の型で実装できますが、Java Beanなクラスもしくは、プリミティブな型のみになっており、Javaの制約を受けたりするの
で、あまりオススメしません。
build.sbt
lazy val root = (project in file(".")).
settings(
name := "aws-lambda-scala",
organization := "com.example",
scalaVersion := "2.12.1",
libraryDependencies ++= Seq(
"com.amazonaws" % "aws-lambda-java-core" % "1.1.0"
)
)
project/plugins.sbt
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.3")
src/main/scala/com/example/Hello.scala
class HelloHandler extends RequestStreamHandler {
@throws(classOf[java.io.IOException])
override
def handleRequest(input: InputStream, output: OutputStream, context: Context): Unit = {
val bytes = toByteArray(input)
output.write(bytes)
}
def toByteArray(input: InputStream) =
Stream.continually(input.read).takeWhile(_ != -1).map(_.toByte).toArray
}
assembly
$ sbt
> assembly
[info] Packaging .../target/scala-2.12/aws-lambda-scala-assembly-0.1.0-SNAPSHOT.jar
AWS CLI - lambda create function
$ aws lambda create-function 
--region us-east-1 
--function-name aws-lambda-scala 
--zip-file fileb://aws-lambda-scala-assembly-0.1.0-SNAPSHOT.jar 
--role arn:aws:iam::${AWS Account ID}:role/lambda_basic_execution 
--handler com.example.HelloHandler::handleRequest 
--runtime java8 
--timeout 15 
--memory-size 512
AWS CLI - lambda create function
{
"LastModified": "2017-01-02T12:34:56.789+0000",
"FunctionName": "aws-lambda-scala",
"Runtime": "java8",
"Version": "$LATEST",
"Role": "arn:aws:iam::${AWS Account ID}:role/lambda_basic_execution",
"CodeSha256": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"Handler": "com.example.HelloHandler::handleRequest",
"Timeout": 15,
"Description": "",
"MemorySize": 512,
"FunctionArn": "arn:aws:lambda:us-east-1:${AWS Account ID}:function:aws-lambda-scala",
"CodeSize": 5264477
}
AWS CLI - lambda invoke
$ aws lambda invoke 
--region us-east-1 
--function-name aws-lambda-scala 
--payload 123 
--invocation-type RequestResponse /tmp/response
{
"StatusCode": 200
}
123
Amazon API
Gatewayclient
AWS
Lambda
Amazon
S3
Amazon
DynamoDB
Amazon
Kinesis
AWS
Lambda
AWS
Lambda
Amazon
Elasticsearch Service
Context + Token
Principal + Policy
Policy is
cached
Denied
403
Allowed
Auth function
Consumers function
System diagrams
Labor …
• It is hard to run Lambda.
• I will `assembly` one by one and upload it.
• It is troublesome to configure the API Gateway on the console.
Lambdaで実行するまでが大変。assemblyしてアップロードしてを繰り返さないとうまく動くか分からない。コンソール上でAPI
Gatewayの設定を行うのは面倒。
sbt-aws-serverless plugin
• sbt plugin to deploy code to Amazon API Gateway and AWS
Lambda.
• https://github.com/yoshiyoshifujii/sbt-aws-serverless
自前で開発したsbt-pluginを使います。API GatewayやLambdaにデプロイするpluginです。
serverless framework
• To be honest this way is better.
• However, blue green deployment is difficult.
正直、serverless frameworkを使うのが良いと思います。ただ、ブルーグリーンデプロイができない印象です。
https://martinfowler.com/bliki/BlueGreenDeployment.html
Amazon API
Gateway
Stage Stage Variables
test env : test
prod env : prod
Deployment Resources Lambda ARN
1 /hello hello:${stageVariables.env}_1
AWS
Lambda
Alias Publish Versions
dev $LATEST
test_1 1
prod_1 1
Blue-Green deployment - 1st release
Amazon
DynamoDB
Table
account-test
account-prod
Amazon API
Gateway
Stage Stage Variables
test env : test
prod env : prod
Deployment Resources Lambda ARN
1 /hello hello:${stageVariables.env}_1
2 /hello hello:${stageVariables.env}_2
AWS
Lambda
Alias Publish Versions
dev $LATEST
test_1 1
prod_1 1
test_2 2
Blue-Green deployment - 2nd release test
Amazon
DynamoDB
Table
account-test
account-prod
Amazon API
Gateway
Stage Stage Variables
test env : test
prod env : prod
Deployment Resources Lambda ARN
1 /hello hello:${stageVariables.env}_1
2 /hello hello:${stageVariables.env}_2
AWS
Lambda
Alias Publish Versions
dev $LATEST
test_1 1
prod_1 1
test_2 2
prod_2 2
Amazon
DynamoDB
Table
account-test
account-production
Blue-Green deployment - 2nd release
in this case
• Release the test environment as it is.
• Quickly return to the previous version.
• A/B Testing.
• Canary Release.

https://martinfowler.com/bliki/CanaryRelease.html
この方式なら、テストした環境をそのままリリースできる。すぐに前のバージョンに戻すことができる。A/Bテストや、カナリア・リ
リースに使える。
Giter8
• https://github.com/yoshiyoshifujii/sbt-aws-serverless-ddd.g8
$ sbt new yoshiyoshifujii/sbt-aws-serverless-ddd.g8
name [My Something Project]:
version [0.1.0-SNAPSHOT]:
organization [com.example]:
package [com.example]:
Giter8でサンプルプロジェクトを公開しました。
Domain Driven Design
DDD - Hexagonal architecture
• Implementing Domain-Driven Design - 2013/2/16
• Vaughn Vernon
• Mitigate vendor lock-in.
DDDのヘキサゴナルアーキテクチャを採用する。ベンダーロックインを緩和できる。
Dependency model
Application
Infrastructure
Domain
API
依存モデル。
Dependency model
Application
Infrastructure
Domain
API
APIとApplication層は、ベンダーロックイン。ドメインは、再利用可能。インフラは一部再利用可能。
vendor lock-in
Amazon API
Gatewayclient
AWS
Lambda
Amazon
S3
Amazon
DynamoDB
Amazon
Kinesis
AWS
Lambda
AWS
Lambda
Amazon
Elasticsearch Service
Context + Token
Principal + Policy
Policy is
cached
Denied
403
Allowed
Auth function
Consumers function
System diagrams
Make this part
build.sbt - dependsOn
lazy val domain = (project in file("./modules/domain")).
lazy val infraDynamo = (project in file("./modules/infrastructure/dynamodb")).
dependsOn(domain).
lazy val infraKinesis = (project in file("./modules/infrastructure/kinesis")).
dependsOn(domain).
lazy val appHello = (project in file("./modules/application/hello")).
dependsOn(infraLambda, infraDynamo, infraKinesis).
マルチプロジェクトの依存関係を依存モデルの通りに設定。
Project tree
• Sources under modules.
• application is a module of Lambda.
• Make the Infrastructure as finely as
possible.
• Reduce module size.
プロジェクト構成。ソースはmodulesディレクトリの配下に置く。applicationがLambdaのモジュールになる。Infrastructureは限
りなく小さく作る。Lambdaのモジュールサイズを小さくするため。
domain
• POSO (Plain old Scala object)
• Do not specify anything for
libraryDependencies.
domain層。POSOで作る。libraryDependenciesに何も指定しない。
Account
case class AccountId(value: String) extends ValueObject[String]
case class Account(
id: AccountId,
version: Option[Version],
email: String,
password: String,
name: String) extends Entity[AccountId]
AccountRepository
trait AccountRepository {
def save(account: Account): Either[DomainError, Account]
def get(id: AccountId): Either[DomainError, Option[Account]]
def findBy(email: String): Either[DomainError, Option[Account]]
def findAll: Either[DomainError, Seq[Account]]
}
AccountEventPublisher
case class AccountModified(
accountId: AccountId,
email: String,
password: String,
name: String)
trait AccountEventPublisher {
def publish(modified: AccountModified): Either[DomainError, AccountModified]
}
infrastructure
• implementation of Repository
or Domain Event.
• DI with Cake pattern.
• It has no direct inheritance
relation.
infrastructure層。RepositoryやDomainEventの実装を持つ。Cake patternでDIされる。直接の継承関係を持たない。
AccountRepositoryOnDynamoDB
trait AccountRepositoryOnDynamoDB {
def save(account: Account): Either[DomainError, Account] = ???
def get(id: AccountId): Either[DomainError, Option[Account]] = ???
def findBy(email: String): Either[DomainError, Option[Account]] = ???
def findAll: Either[DomainError, Seq[Account]] = ???
}
AccountEventPublisherOnKinesis
trait AccountEventPublisherOnKinesis {
def publish(modified: AccountModified): Either[DomainError, AccountModified] = ???
}
application
• Generate Lambda's module.
• Dependency injection.
application層。Lambdaのモジュールを生成する。依存性が注入する。
Base
trait Base extends BaseStreamHandler {
val accountRepository: AccountRepository
val accountEventPublisher: AccountEventPublisher
override def handle(input: Input): Try[String] = Try {
JsObject(
"message" -> JsString("hello world!!")
).compactPrint
}
}
App
class App extends Base {
override val accountRepository =
new AccountRepository with AccountRepositoryOnDynamoDB
override val accountEventPublisher =
new AccountEventPublisher with AccountEventPublisherOnKinesis
}
Amazon API
Gatewayclient
AWS
Lambda
Amazon
S3
Amazon
DynamoDB
Amazon
Kinesis
AWS
Lambda
AWS
Lambda
Amazon
Elasticsearch Service
Context + Token
Principal + Policy
Policy is
cached
Denied
403
Allowed
Auth function
Consumers function
System diagrams
Make this part
build.sbt - dependsOn
lazy val domain = (project in file("./modules/domain")).
lazy val infraDomain = (project in file("./modules/infrastructure/domain")).
dependsOn(domain).
lazy val appAccountModified = (project in file(“./modules/application/accountmodified”)).
dependsOn(infraLambdaConsumer, infraDomain).
依存関係は、API Gatewayとほぼ同じ。
Demo
sbt deploy prod
$ sbt 
-DAWS_ACCOUNT_ID=<AWS Account ID> 
-DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> 
-DAWS_BUCKET_NAME=<BUCKET NAME>
> deploy v1
API Gateway created: xxxxxxxxxx
API Gateway put: xxxxxxxxxx
Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth
Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:1
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:prod
Authorizer: auauau
Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello
Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:1
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:prod_1
Create Deployment: {Id: dddddd,Description: 0.1.0-SNAPSHOT,CreatedDate: Sat Feb 25 12:34:56 JST 2017,}
Amazon API
Gateway
Stage Stage Variables
test env : test
prod env : prod
Deployment Resources Lambda ARN
1 /hello hello:${stageVariables.env}_1
AWS
Lambda
Alias Publish Versions
dev $LATEST
test_1 1
prod_1 1
Blue-Green deployment - 1st release
Amazon
DynamoDB
Table
account-test
account-prod
sbt deploy test
$ sbt 
-DAWS_ACCOUNT_ID=<AWS Account ID> 
-DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> 
-DAWS_BUCKET_NAME=<BUCKET NAME>
> deploy test
API Gateway created: xxxxxxxxxx
API Gateway put: xxxxxxxxxx
Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth
Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:2
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:test
Authorizer: auauau
Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello
Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:2
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:test_2
Create Deployment: {Id: dddddd,Description: 0.1.0-SNAPSHOT,CreatedDate: Sat Feb 25 12:34:56 JST 2017,}
Amazon API
Gateway
Stage Stage Variables
test env : test
prod env : prod
Deployment Resources Lambda ARN
1 /hello hello:${stageVariables.env}_1
2 /hello hello:${stageVariables.env}_2
AWS
Lambda
Alias Publish Versions
dev $LATEST
test_1 1
prod_1 1
test_2 2
Blue-Green deployment - 2nd release test
Amazon
DynamoDB
Table
account-test
account-prod
sbt deployCopy test to prod
$ sbt 
-DAWS_ACCOUNT_ID=<AWS Account ID> 
-DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> 
-DAWS_BUCKET_NAME=<BUCKET NAME>
> deployCopy test prod
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:prod
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:prod_2
Stage: prod
Amazon API
Gateway
Stage Stage Variables
test env : test
prod env : prod
Deployment Resources Lambda ARN
1 /hello hello:${stageVariables.env}_1
2 /hello hello:${stageVariables.env}_2
AWS
Lambda
Alias Publish Versions
dev $LATEST
test_1 1
prod_1 1
test_2 2
prod_2 2
Amazon
DynamoDB
Table
account-test
account-production
Blue-Green deployment - 2nd release
sbt deployDev
$ sbt 
-DAWS_ACCOUNT_ID=<AWS Account ID> 
-DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> 
-DAWS_BUCKET_NAME=<BUCKET NAME>
> deployDev dev
API Gateway created: xxxxxxxxxx
API Gateway put: xxxxxxxxxx
Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:dev
Authorizer: auauau
Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello
Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:dev
Create Deployment: {Id: ddddd,Description: 0.1.0-SNAPSHOT,CreatedDate: Sat Feb 25 12:34:56 JST 2017,}
sbt deployList
$ sbt 
-DAWS_ACCOUNT_ID=<AWS Account ID> 
-DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> 
-DAWS_BUCKET_NAME=<BUCKET NAME>
> deployList dev
============================================================================================================
xxxxxxxxxx
============================================================================================================
| Stage Name | Last Updated Date | Deployment Id | Description |
|----------------------|--------------------------------|-----------------|--------------------------------|
| dev | Mon Feb 20 21:30:07 JST 2017 | qirn6v | null |
| v1 | Mon Feb 20 21:23:41 JST 2017 | 8tb1zr | null |
=====================================================================================
xxxxxxxxxx
=====================================================================================
| Created Date | Deployment Id | Description |
|--------------------------------|-----------------|--------------------------------|
| Mon Feb 20 21:30:07 JST 2017 | ddddd2 | 0.1.0-SNAPSHOT |
| Mon Feb 20 21:23:41 JST 2017 | ddddd1 | 0.1.0-SNAPSHOT |
sbt invoke
$ sbt 
-DAWS_ACCOUNT_ID=<AWS Account ID> 
-DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> 
-DAWS_BUCKET_NAME=<BUCKET NAME>
> invoke prod
============================================================
GET:https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/prod/hellos
============================================================
200
{"message":"hello world!!"}
Summary
• Scala is easy to combine DDD and Serverless.
• Easy to share processing with multiple projects.
• Cheap, scalable and easy to operate.
ScalaはDDDとServerlessを組み合わせるとやりやすい。マルチプロジェクトで処理を共通化しやすい。安くてスケーラブルで運用
が楽。

More Related Content

What's hot

Microservices with Apache Camel
Microservices with Apache CamelMicroservices with Apache Camel
Microservices with Apache CamelClaus Ibsen
 
Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Claus Ibsen
 
Integration made easy with Apache Camel
Integration made easy with Apache CamelIntegration made easy with Apache Camel
Integration made easy with Apache CamelRosen Spasov
 
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Claus Ibsen
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelIoan Eugen Stan
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration libraryClaus Ibsen
 
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelClaus Ibsen
 
Apache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxApache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxClaus Ibsen
 
Event Driven Architecture with Apache Camel
Event Driven Architecture with Apache CamelEvent Driven Architecture with Apache Camel
Event Driven Architecture with Apache Camelprajods
 
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
JEEConf 2018 - Camel microservices with Spring Boot and KubernetesJEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
JEEConf 2018 - Camel microservices with Spring Boot and KubernetesClaus Ibsen
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...All Things Open
 
State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)Claus Ibsen
 
Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Claus Ibsen
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and GroovyClaus Ibsen
 
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Claus Ibsen
 
Real World Java 9
Real World Java 9Real World Java 9
Real World Java 9Trisha Gee
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersClaus Ibsen
 
ApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryClaus Ibsen
 

What's hot (20)

Microservices with Apache Camel
Microservices with Apache CamelMicroservices with Apache Camel
Microservices with Apache Camel
 
Sun Web Server Brief
Sun Web Server BriefSun Web Server Brief
Sun Web Server Brief
 
Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013Getting Started with Apache Camel - Devconf Conference - February 2013
Getting Started with Apache Camel - Devconf Conference - February 2013
 
Integration made easy with Apache Camel
Integration made easy with Apache CamelIntegration made easy with Apache Camel
Integration made easy with Apache Camel
 
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
Getting started with Apache Camel - Javagruppen Copenhagen - April 2014
 
Enterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache CamelEnterprise Integration Patterns with Apache Camel
Enterprise Integration Patterns with Apache Camel
 
Full Stack Scala
Full Stack ScalaFull Stack Scala
Full Stack Scala
 
Apache Camel - The integration library
Apache Camel - The integration libraryApache Camel - The integration library
Apache Camel - The integration library
 
Integrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and CamelIntegrating systems in the age of Quarkus and Camel
Integrating systems in the age of Quarkus and Camel
 
Apache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the boxApache Camel Introduction & What's in the box
Apache Camel Introduction & What's in the box
 
Event Driven Architecture with Apache Camel
Event Driven Architecture with Apache CamelEvent Driven Architecture with Apache Camel
Event Driven Architecture with Apache Camel
 
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
JEEConf 2018 - Camel microservices with Spring Boot and KubernetesJEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
JEEConf 2018 - Camel microservices with Spring Boot and Kubernetes
 
Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...Leveraging Open Source for Database Development: Database Version Control wit...
Leveraging Open Source for Database Development: Database Version Control wit...
 
State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)State of integration with Apache Camel (ApacheCon 2019)
State of integration with Apache Camel (ApacheCon 2019)
 
Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014Getting Started with Apache Camel at DevNation 2014
Getting Started with Apache Camel at DevNation 2014
 
Integration using Apache Camel and Groovy
Integration using Apache Camel and GroovyIntegration using Apache Camel and Groovy
Integration using Apache Camel and Groovy
 
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
Cloud-Native Integration with Apache Camel on Kubernetes (Copenhagen October ...
 
Real World Java 9
Real World Java 9Real World Java 9
Real World Java 9
 
Developing Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containersDeveloping Java based microservices ready for the world of containers
Developing Java based microservices ready for the world of containers
 
ApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration libraryApacheCon EU 2016 - Apache Camel the integration library
ApacheCon EU 2016 - Apache Camel the integration library
 

Viewers also liked

Scala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.jsScala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.jstakezoe
 
Preparing for distributed system failures using akka #ScalaMatsuri
Preparing for distributed system failures using akka #ScalaMatsuriPreparing for distributed system failures using akka #ScalaMatsuri
Preparing for distributed system failures using akka #ScalaMatsuriTIS Inc.
 
Deadly Code! (seriously) Blocking &amp; Hyper Context Switching Pattern
Deadly Code! (seriously) Blocking &amp; Hyper Context Switching PatternDeadly Code! (seriously) Blocking &amp; Hyper Context Switching Pattern
Deadly Code! (seriously) Blocking &amp; Hyper Context Switching Patternchibochibo
 
Make your programs Free
Make your programs FreeMake your programs Free
Make your programs FreePawel Szulc
 
Akka Cluster and Auto-scaling
Akka Cluster and Auto-scalingAkka Cluster and Auto-scaling
Akka Cluster and Auto-scalingIkuo Matsumura
 
Sbtのマルチプロジェクトはいいぞ
SbtのマルチプロジェクトはいいぞSbtのマルチプロジェクトはいいぞ
SbtのマルチプロジェクトはいいぞYoshitaka Fujii
 
Van laarhoven lens
Van laarhoven lensVan laarhoven lens
Van laarhoven lensNaoki Aoyama
 
Going bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesGoing bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesPawel Szulc
 
Reducing Boilerplate and Combining Effects: A Monad Transformer Example
Reducing Boilerplate and Combining Effects: A Monad Transformer ExampleReducing Boilerplate and Combining Effects: A Monad Transformer Example
Reducing Boilerplate and Combining Effects: A Monad Transformer ExampleConnie Chen
 
7 key recipes for data engineering
7 key recipes for data engineering7 key recipes for data engineering
7 key recipes for data engineeringunivalence
 
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)Eugene Yokota
 
20160902 scalaの魅力を話してみる
20160902 scalaの魅力を話してみる20160902 scalaの魅力を話してみる
20160902 scalaの魅力を話してみるYoshitaka Fujii
 
Serverless apps on aws using scala
Serverless apps on aws using scalaServerless apps on aws using scala
Serverless apps on aws using scalaYoshitaka Fujii
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka StreamsKonrad Malawski
 
Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~
Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~
Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~Masahito Zembutsu
 
Big Data Analytics Tokyo
Big Data Analytics TokyoBig Data Analytics Tokyo
Big Data Analytics TokyoAdam Gibson
 
sbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころsbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころKazuhiro Hara
 
Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Tomer Gabel
 

Viewers also liked (20)

Scala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.jsScala Warrior and type-safe front-end development with Scala.js
Scala Warrior and type-safe front-end development with Scala.js
 
Preparing for distributed system failures using akka #ScalaMatsuri
Preparing for distributed system failures using akka #ScalaMatsuriPreparing for distributed system failures using akka #ScalaMatsuri
Preparing for distributed system failures using akka #ScalaMatsuri
 
Deadly Code! (seriously) Blocking &amp; Hyper Context Switching Pattern
Deadly Code! (seriously) Blocking &amp; Hyper Context Switching PatternDeadly Code! (seriously) Blocking &amp; Hyper Context Switching Pattern
Deadly Code! (seriously) Blocking &amp; Hyper Context Switching Pattern
 
Make your programs Free
Make your programs FreeMake your programs Free
Make your programs Free
 
Akka Cluster and Auto-scaling
Akka Cluster and Auto-scalingAkka Cluster and Auto-scaling
Akka Cluster and Auto-scaling
 
Sbtのマルチプロジェクトはいいぞ
SbtのマルチプロジェクトはいいぞSbtのマルチプロジェクトはいいぞ
Sbtのマルチプロジェクトはいいぞ
 
Van laarhoven lens
Van laarhoven lensVan laarhoven lens
Van laarhoven lens
 
Pratical eff
Pratical effPratical eff
Pratical eff
 
Going bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data typesGoing bananas with recursion schemes for fixed point data types
Going bananas with recursion schemes for fixed point data types
 
Reducing Boilerplate and Combining Effects: A Monad Transformer Example
Reducing Boilerplate and Combining Effects: A Monad Transformer ExampleReducing Boilerplate and Combining Effects: A Monad Transformer Example
Reducing Boilerplate and Combining Effects: A Monad Transformer Example
 
7 key recipes for data engineering
7 key recipes for data engineering7 key recipes for data engineering
7 key recipes for data engineering
 
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
The state of sbt 0.13, sbt server, and sbt 1.0 (ScalaMatsuri ver)
 
ScalaMatsuri 2016
ScalaMatsuri 2016ScalaMatsuri 2016
ScalaMatsuri 2016
 
20160902 scalaの魅力を話してみる
20160902 scalaの魅力を話してみる20160902 scalaの魅力を話してみる
20160902 scalaの魅力を話してみる
 
Serverless apps on aws using scala
Serverless apps on aws using scalaServerless apps on aws using scala
Serverless apps on aws using scala
 
Reactive integrations with Akka Streams
Reactive integrations with Akka StreamsReactive integrations with Akka Streams
Reactive integrations with Akka Streams
 
Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~
Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~
Dockerの期待と現実~Docker都市伝説はなぜ生まれるのか~
 
Big Data Analytics Tokyo
Big Data Analytics TokyoBig Data Analytics Tokyo
Big Data Analytics Tokyo
 
sbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころsbtマルチプロジェクトビルドの使いどころ
sbtマルチプロジェクトビルドの使いどころ
 
Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)Scala Refactoring for Fun and Profit (Japanese subtitles)
Scala Refactoring for Fun and Profit (Japanese subtitles)
 

Similar to Scala Matsuri 2017

서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)AWSKRUG - AWS한국사용자모임
 
Serverless Pune Meetup 1
Serverless Pune Meetup 1Serverless Pune Meetup 1
Serverless Pune Meetup 1Vishal Biyani
 
Serverless - Increasing software delivery
Serverless -  Increasing software deliveryServerless -  Increasing software delivery
Serverless - Increasing software deliveryEwere Diagboya
 
Serverless Frameworks on AWS
Serverless Frameworks on AWSServerless Frameworks on AWS
Serverless Frameworks on AWSJulien SIMON
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Julien SIMON
 
Let's set the record straight on the term serverless and what it’s not
Let's set the record straight on the term serverless and what it’s notLet's set the record straight on the term serverless and what it’s not
Let's set the record straight on the term serverless and what it’s notJeshan Babooa
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless ArchitectureElana Krasner
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?The Software House
 
Whizlabs webinar - Deploying Portfolio Site with AWS Serverless
Whizlabs webinar - Deploying Portfolio Site with AWS ServerlessWhizlabs webinar - Deploying Portfolio Site with AWS Serverless
Whizlabs webinar - Deploying Portfolio Site with AWS ServerlessDhaval Nagar
 
Is Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User GroupIs Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User GroupChase Douglas
 
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐Pahud Hsieh
 
What's New in AWS Serverless and Containers
What's New in AWS Serverless and ContainersWhat's New in AWS Serverless and Containers
What's New in AWS Serverless and ContainersAmazon Web Services
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Amazon Web Services
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Emerson Eduardo Rodrigues Von Staffen
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...Amazon Web Services
 
Building Serverless APIs on AWS
Building Serverless APIs on AWSBuilding Serverless APIs on AWS
Building Serverless APIs on AWSJulien SIMON
 
Serverless architectures-with-aws-lambda
Serverless architectures-with-aws-lambdaServerless architectures-with-aws-lambda
Serverless architectures-with-aws-lambdasaifam
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaAmazon Web Services
 
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...Amazon Web Services
 

Similar to Scala Matsuri 2017 (20)

서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
서버리스(Serverless) 프레임웍 비교 - ClaudiaJS와 Chalice를 중심으로 (윤석찬)
 
Serverless Pune Meetup 1
Serverless Pune Meetup 1Serverless Pune Meetup 1
Serverless Pune Meetup 1
 
Function as a Service
Function as a ServiceFunction as a Service
Function as a Service
 
Serverless - Increasing software delivery
Serverless -  Increasing software deliveryServerless -  Increasing software delivery
Serverless - Increasing software delivery
 
Serverless Frameworks on AWS
Serverless Frameworks on AWSServerless Frameworks on AWS
Serverless Frameworks on AWS
 
Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)Developing and deploying serverless applications (February 2017)
Developing and deploying serverless applications (February 2017)
 
Let's set the record straight on the term serverless and what it’s not
Let's set the record straight on the term serverless and what it’s notLet's set the record straight on the term serverless and what it’s not
Let's set the record straight on the term serverless and what it’s not
 
Serverless Architecture
Serverless ArchitectureServerless Architecture
Serverless Architecture
 
Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?Jak nie zwariować z architekturą Serverless?
Jak nie zwariować z architekturą Serverless?
 
Whizlabs webinar - Deploying Portfolio Site with AWS Serverless
Whizlabs webinar - Deploying Portfolio Site with AWS ServerlessWhizlabs webinar - Deploying Portfolio Site with AWS Serverless
Whizlabs webinar - Deploying Portfolio Site with AWS Serverless
 
Is Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User GroupIs Serverless The New Swiss Cheese? - AWS Seattle User Group
Is Serverless The New Swiss Cheese? - AWS Seattle User Group
 
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐從劍宗到氣宗  - 談AWS ECS與Serverless最佳實踐
從劍宗到氣宗 - 談AWS ECS與Serverless最佳實踐
 
What's New in AWS Serverless and Containers
What's New in AWS Serverless and ContainersWhat's New in AWS Serverless and Containers
What's New in AWS Serverless and Containers
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
 
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
Devops continuousintegration and deployment onaws puttingmoneybackintoyourmis...
 
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
DevOps, Continuous Integration and Deployment on AWS: Putting Money Back into...
 
Building Serverless APIs on AWS
Building Serverless APIs on AWSBuilding Serverless APIs on AWS
Building Serverless APIs on AWS
 
Serverless architectures-with-aws-lambda
Serverless architectures-with-aws-lambdaServerless architectures-with-aws-lambda
Serverless architectures-with-aws-lambda
 
Managing the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS LambdaManaging the Continuous Delivery of Code to AWS Lambda
Managing the Continuous Delivery of Code to AWS Lambda
 
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
 

Recently uploaded

tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdfchess188chess188
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSneha Padhiar
 
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Amil baba
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxRomil Mishra
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Sumanth A
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackinghadarpinhas1
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfShreyas Pandit
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.elesangwon
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunicationnovrain7111
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSsandhya757531
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewsandhya757531
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labsamber724300
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...IJAEMSJORNAL
 
Javier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier Fernández Muñoz
 

Recently uploaded (20)

tourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdftourism-management-srs_compress-software-engineering.pdf
tourism-management-srs_compress-software-engineering.pdf
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATIONSOFTWARE ESTIMATION COCOMO AND FP CALCULATION
SOFTWARE ESTIMATION COCOMO AND FP CALCULATION
 
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
Uk-NO1 kala jadu karne wale ka contact number kala jadu karne wale baba kala ...
 
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptxTriangulation survey (Basic Mine Surveying)_MI10412MI.pptx
Triangulation survey (Basic Mine Surveying)_MI10412MI.pptx
 
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptxCurve setting (Basic Mine Surveying)_MI10412MI.pptx
Curve setting (Basic Mine Surveying)_MI10412MI.pptx
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
Robotics-Asimov's Laws, Mechanical Subsystems, Robot Kinematics, Robot Dynami...
 
Detection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and trackingDetection&Tracking - Thermal imaging object detection and tracking
Detection&Tracking - Thermal imaging object detection and tracking
 
Theory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdfTheory of Machine Notes / Lecture Material .pdf
Theory of Machine Notes / Lecture Material .pdf
 
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
2022 AWS DNA Hackathon 장애 대응 솔루션 jarvis.
 
Versatile Engineering Construction Firms
Versatile Engineering Construction FirmsVersatile Engineering Construction Firms
Versatile Engineering Construction Firms
 
The Satellite applications in telecommunication
The Satellite applications in telecommunicationThe Satellite applications in telecommunication
The Satellite applications in telecommunication
 
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMSHigh Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
High Voltage Engineering- OVER VOLTAGES IN ELECTRICAL POWER SYSTEMS
 
Artificial Intelligence in Power System overview
Artificial Intelligence in Power System overviewArtificial Intelligence in Power System overview
Artificial Intelligence in Power System overview
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
Designing pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptxDesigning pile caps according to ACI 318-19.pptx
Designing pile caps according to ACI 318-19.pptx
 
Secure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech LabsSecure Key Crypto - Tech Paper JET Tech Labs
Secure Key Crypto - Tech Paper JET Tech Labs
 
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
Guardians of E-Commerce: Harnessing NLP and Machine Learning Approaches for A...
 
Javier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptxJavier_Fernandez_CARS_workshop_presentation.pptx
Javier_Fernandez_CARS_workshop_presentation.pptx
 

Scala Matsuri 2017

  • 1. Let's Build a Serverless Architecture in Scala! Yoshitaka Fujii (@yoshiyoshifujii)
 2017 ScalaMatsuri
 Saturday, February 25th
 16:30 - 17:10 Conference Room 1
  • 2. Who am I ? • Yoshitaka Fujii (@yoshiyoshifujii) • Joined MOTEX in April, 2014 • Software Engineer • Scala(19 months) • Scala Kansai summit 2016 staff. 自己紹介。エムオーテックス株式会社。Scala歴19ヶ月。Scala関西サミット2016でスタッフさせていただきました。
  • 3.
  • 4. Agenda • Serverless Architecture • Development & Deployment • DDD
  • 5. Serverless Architecture • using FaaS • a significant reduction in costs • scalability • the lack of operating and maintaining infrastructure サーバレスアーキテクチャとは、FaaSを活用したシステム。コストの大幅な削減。スケーラビリティ。 インフラの運用管理が不要。
  • 6. Function as a Service • AWS Lambda • Google Cloud Function • Microsoft Azure Functions
  • 7. AWS Lambda • AWS Lambda is a compute service that lets you run code without provisioning or managing servers. • executes your code only when needed. • scales automatically, a few requests per day to thousands per second. • Node.js, Java, C# and Python AWS Lambda はサーバーをプロビジョニングしたり管理しなくてもコードを実行できるコンピューティングサービスです。必要な ときにコードを実行し、自動的にスケールします。
  • 8. AWS Lambda Events • API Gateway (HTTP Requests) • Kinesis Streams • DynamoDB • S3 • Schedule (CloudWatch) • SNS • IoT これらのAWSサービスのイベントに応じてAWS Lambdaを実行できます。今回は、主にAPI GatewayとKinesis Streamsについて 取り上げます。
  • 9. Amazon API Gateway • Amazon API Gateway is a fully managed service that makes it easy for developers to create, publish, maintain, monitor, and secure APIs at any scale. • Low-Cost and Efficient.
 (only for calls made to your APIs and data transfer out) • Performance at Any Scale • Run Your APIs Without Servers フルマネージドサービスで、開発者はどのようなスケールであっても、簡単に API の作成、配布、保守、監視、保護が行えます。
  • 11. Amazon Kinesis Streams • Use Amazon Kinesis Streams to collect and process large streams of data records in real time. • rapid and continuous data intake and aggregation. • Accelerated log and data feed intake and processing. • Real-time metrics and reporting. • Real-time data analytics. • Complex stream processing. Amazon Kinesis Streams を使用して、データレコードの大量のストリームをリアルタイムで収集し、処理します。 高速かつ継続的 にデータの取り込みと集約を行うことができます。
  • 13. Amazon API Gatewayclient AWS Lambda Amazon S3 Amazon DynamoDB Amazon Kinesis AWS Lambda AWS Lambda Amazon Elasticsearch Service Context + Token Principal + Policy Policy is cached Denied 403 Allowed Auth function Consumers function System diagrams
  • 14. Amazon API Gateway client AWS Lambda Amazon S3 Amazon DynamoDB Amazon Kinesis AWS Lambda Amazon Elasticsearch Service Policy is cached Large scale system client client client client client AWS Lambda AWS Lambda AWS Lambda AWS Lambda AWS Lambda AWS Lambda AWS Lambda AWS Lambda AWS Lambda AWS Lambda AWS Lambda 大規模なシステムを想定しています。
  • 15. Large scale system • More functional requirements. • AWS Lambda wants to be a simple function. • 1 Lambda per method request.
 GET:/hello => getHello
 POST:/hello => postHello • develop and deploy efficiently 大規模なシステムは、機能要件が多い。AWS LambdaはシンプルなFunctionを保ちたい。1メソッドリクエストにつきLambdaを1 つ。また効率良く開発とデプロイをしたい。
  • 17. How to make simple AWS Lambda. 単純なAWS Lambdaの作り方を紹介します。
  • 18. RequestStreamHandler.java public interface RequestStreamHandler { /** * Handles a Lambda Function request * @param input The Lambda Function input stream * @param output The Lambda function output stream * @param context The Lambda execution environment context object. * @throws IOException */ public void handleRequest(InputStream input, OutputStream output, Context context) throws IOException; } AWS Lambdaの公開インタフェースです。この中身を実装すると任意の処理が実行できます。
  • 19. RequestHandler.java public interface RequestHandler<I, O> { /** * Handles a Lambda Function request * @param input The Lambda Function input * @param context The Lambda execution environment context object. * @return The Lambda Function output */ public O handleRequest(I input, Context context); } I/Oを任意の型で実装できますが、Java Beanなクラスもしくは、プリミティブな型のみになっており、Javaの制約を受けたりするの で、あまりオススメしません。
  • 20. build.sbt lazy val root = (project in file(".")). settings( name := "aws-lambda-scala", organization := "com.example", scalaVersion := "2.12.1", libraryDependencies ++= Seq( "com.amazonaws" % "aws-lambda-java-core" % "1.1.0" ) )
  • 22. src/main/scala/com/example/Hello.scala class HelloHandler extends RequestStreamHandler { @throws(classOf[java.io.IOException]) override def handleRequest(input: InputStream, output: OutputStream, context: Context): Unit = { val bytes = toByteArray(input) output.write(bytes) } def toByteArray(input: InputStream) = Stream.continually(input.read).takeWhile(_ != -1).map(_.toByte).toArray }
  • 23. assembly $ sbt > assembly [info] Packaging .../target/scala-2.12/aws-lambda-scala-assembly-0.1.0-SNAPSHOT.jar
  • 24. AWS CLI - lambda create function $ aws lambda create-function --region us-east-1 --function-name aws-lambda-scala --zip-file fileb://aws-lambda-scala-assembly-0.1.0-SNAPSHOT.jar --role arn:aws:iam::${AWS Account ID}:role/lambda_basic_execution --handler com.example.HelloHandler::handleRequest --runtime java8 --timeout 15 --memory-size 512
  • 25. AWS CLI - lambda create function { "LastModified": "2017-01-02T12:34:56.789+0000", "FunctionName": "aws-lambda-scala", "Runtime": "java8", "Version": "$LATEST", "Role": "arn:aws:iam::${AWS Account ID}:role/lambda_basic_execution", "CodeSha256": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Handler": "com.example.HelloHandler::handleRequest", "Timeout": 15, "Description": "", "MemorySize": 512, "FunctionArn": "arn:aws:lambda:us-east-1:${AWS Account ID}:function:aws-lambda-scala", "CodeSize": 5264477 }
  • 26. AWS CLI - lambda invoke $ aws lambda invoke --region us-east-1 --function-name aws-lambda-scala --payload 123 --invocation-type RequestResponse /tmp/response { "StatusCode": 200 } 123
  • 27. Amazon API Gatewayclient AWS Lambda Amazon S3 Amazon DynamoDB Amazon Kinesis AWS Lambda AWS Lambda Amazon Elasticsearch Service Context + Token Principal + Policy Policy is cached Denied 403 Allowed Auth function Consumers function System diagrams
  • 28. Labor … • It is hard to run Lambda. • I will `assembly` one by one and upload it. • It is troublesome to configure the API Gateway on the console. Lambdaで実行するまでが大変。assemblyしてアップロードしてを繰り返さないとうまく動くか分からない。コンソール上でAPI Gatewayの設定を行うのは面倒。
  • 29. sbt-aws-serverless plugin • sbt plugin to deploy code to Amazon API Gateway and AWS Lambda. • https://github.com/yoshiyoshifujii/sbt-aws-serverless 自前で開発したsbt-pluginを使います。API GatewayやLambdaにデプロイするpluginです。
  • 30. serverless framework • To be honest this way is better. • However, blue green deployment is difficult. 正直、serverless frameworkを使うのが良いと思います。ただ、ブルーグリーンデプロイができない印象です。
  • 32. Amazon API Gateway Stage Stage Variables test env : test prod env : prod Deployment Resources Lambda ARN 1 /hello hello:${stageVariables.env}_1 AWS Lambda Alias Publish Versions dev $LATEST test_1 1 prod_1 1 Blue-Green deployment - 1st release Amazon DynamoDB Table account-test account-prod
  • 33. Amazon API Gateway Stage Stage Variables test env : test prod env : prod Deployment Resources Lambda ARN 1 /hello hello:${stageVariables.env}_1 2 /hello hello:${stageVariables.env}_2 AWS Lambda Alias Publish Versions dev $LATEST test_1 1 prod_1 1 test_2 2 Blue-Green deployment - 2nd release test Amazon DynamoDB Table account-test account-prod
  • 34. Amazon API Gateway Stage Stage Variables test env : test prod env : prod Deployment Resources Lambda ARN 1 /hello hello:${stageVariables.env}_1 2 /hello hello:${stageVariables.env}_2 AWS Lambda Alias Publish Versions dev $LATEST test_1 1 prod_1 1 test_2 2 prod_2 2 Amazon DynamoDB Table account-test account-production Blue-Green deployment - 2nd release
  • 35. in this case • Release the test environment as it is. • Quickly return to the previous version. • A/B Testing. • Canary Release.
 https://martinfowler.com/bliki/CanaryRelease.html この方式なら、テストした環境をそのままリリースできる。すぐに前のバージョンに戻すことができる。A/Bテストや、カナリア・リ リースに使える。
  • 36. Giter8 • https://github.com/yoshiyoshifujii/sbt-aws-serverless-ddd.g8 $ sbt new yoshiyoshifujii/sbt-aws-serverless-ddd.g8 name [My Something Project]: version [0.1.0-SNAPSHOT]: organization [com.example]: package [com.example]: Giter8でサンプルプロジェクトを公開しました。
  • 38. DDD - Hexagonal architecture • Implementing Domain-Driven Design - 2013/2/16 • Vaughn Vernon • Mitigate vendor lock-in. DDDのヘキサゴナルアーキテクチャを採用する。ベンダーロックインを緩和できる。
  • 41. Amazon API Gatewayclient AWS Lambda Amazon S3 Amazon DynamoDB Amazon Kinesis AWS Lambda AWS Lambda Amazon Elasticsearch Service Context + Token Principal + Policy Policy is cached Denied 403 Allowed Auth function Consumers function System diagrams Make this part
  • 42. build.sbt - dependsOn lazy val domain = (project in file("./modules/domain")). lazy val infraDynamo = (project in file("./modules/infrastructure/dynamodb")). dependsOn(domain). lazy val infraKinesis = (project in file("./modules/infrastructure/kinesis")). dependsOn(domain). lazy val appHello = (project in file("./modules/application/hello")). dependsOn(infraLambda, infraDynamo, infraKinesis). マルチプロジェクトの依存関係を依存モデルの通りに設定。
  • 43. Project tree • Sources under modules. • application is a module of Lambda. • Make the Infrastructure as finely as possible. • Reduce module size. プロジェクト構成。ソースはmodulesディレクトリの配下に置く。applicationがLambdaのモジュールになる。Infrastructureは限 りなく小さく作る。Lambdaのモジュールサイズを小さくするため。
  • 44. domain • POSO (Plain old Scala object) • Do not specify anything for libraryDependencies. domain層。POSOで作る。libraryDependenciesに何も指定しない。
  • 45. Account case class AccountId(value: String) extends ValueObject[String] case class Account( id: AccountId, version: Option[Version], email: String, password: String, name: String) extends Entity[AccountId]
  • 46. AccountRepository trait AccountRepository { def save(account: Account): Either[DomainError, Account] def get(id: AccountId): Either[DomainError, Option[Account]] def findBy(email: String): Either[DomainError, Option[Account]] def findAll: Either[DomainError, Seq[Account]] }
  • 47. AccountEventPublisher case class AccountModified( accountId: AccountId, email: String, password: String, name: String) trait AccountEventPublisher { def publish(modified: AccountModified): Either[DomainError, AccountModified] }
  • 48. infrastructure • implementation of Repository or Domain Event. • DI with Cake pattern. • It has no direct inheritance relation. infrastructure層。RepositoryやDomainEventの実装を持つ。Cake patternでDIされる。直接の継承関係を持たない。
  • 49. AccountRepositoryOnDynamoDB trait AccountRepositoryOnDynamoDB { def save(account: Account): Either[DomainError, Account] = ??? def get(id: AccountId): Either[DomainError, Option[Account]] = ??? def findBy(email: String): Either[DomainError, Option[Account]] = ??? def findAll: Either[DomainError, Seq[Account]] = ??? }
  • 50. AccountEventPublisherOnKinesis trait AccountEventPublisherOnKinesis { def publish(modified: AccountModified): Either[DomainError, AccountModified] = ??? }
  • 51. application • Generate Lambda's module. • Dependency injection. application層。Lambdaのモジュールを生成する。依存性が注入する。
  • 52. Base trait Base extends BaseStreamHandler { val accountRepository: AccountRepository val accountEventPublisher: AccountEventPublisher override def handle(input: Input): Try[String] = Try { JsObject( "message" -> JsString("hello world!!") ).compactPrint } }
  • 53. App class App extends Base { override val accountRepository = new AccountRepository with AccountRepositoryOnDynamoDB override val accountEventPublisher = new AccountEventPublisher with AccountEventPublisherOnKinesis }
  • 54. Amazon API Gatewayclient AWS Lambda Amazon S3 Amazon DynamoDB Amazon Kinesis AWS Lambda AWS Lambda Amazon Elasticsearch Service Context + Token Principal + Policy Policy is cached Denied 403 Allowed Auth function Consumers function System diagrams Make this part
  • 55. build.sbt - dependsOn lazy val domain = (project in file("./modules/domain")). lazy val infraDomain = (project in file("./modules/infrastructure/domain")). dependsOn(domain). lazy val appAccountModified = (project in file(“./modules/application/accountmodified”)). dependsOn(infraLambdaConsumer, infraDomain). 依存関係は、API Gatewayとほぼ同じ。
  • 56. Demo
  • 57. sbt deploy prod $ sbt -DAWS_ACCOUNT_ID=<AWS Account ID> -DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> -DAWS_BUCKET_NAME=<BUCKET NAME> > deploy v1 API Gateway created: xxxxxxxxxx API Gateway put: xxxxxxxxxx Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:1 Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:prod Authorizer: auauau Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:1 Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:prod_1 Create Deployment: {Id: dddddd,Description: 0.1.0-SNAPSHOT,CreatedDate: Sat Feb 25 12:34:56 JST 2017,}
  • 58. Amazon API Gateway Stage Stage Variables test env : test prod env : prod Deployment Resources Lambda ARN 1 /hello hello:${stageVariables.env}_1 AWS Lambda Alias Publish Versions dev $LATEST test_1 1 prod_1 1 Blue-Green deployment - 1st release Amazon DynamoDB Table account-test account-prod
  • 59. sbt deploy test $ sbt -DAWS_ACCOUNT_ID=<AWS Account ID> -DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> -DAWS_BUCKET_NAME=<BUCKET NAME> > deploy test API Gateway created: xxxxxxxxxx API Gateway put: xxxxxxxxxx Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:2 Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:test Authorizer: auauau Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello Lambda published: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:2 Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:test_2 Create Deployment: {Id: dddddd,Description: 0.1.0-SNAPSHOT,CreatedDate: Sat Feb 25 12:34:56 JST 2017,}
  • 60. Amazon API Gateway Stage Stage Variables test env : test prod env : prod Deployment Resources Lambda ARN 1 /hello hello:${stageVariables.env}_1 2 /hello hello:${stageVariables.env}_2 AWS Lambda Alias Publish Versions dev $LATEST test_1 1 prod_1 1 test_2 2 Blue-Green deployment - 2nd release test Amazon DynamoDB Table account-test account-prod
  • 61. sbt deployCopy test to prod $ sbt -DAWS_ACCOUNT_ID=<AWS Account ID> -DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> -DAWS_BUCKET_NAME=<BUCKET NAME> > deployCopy test prod Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:prod Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:prod_2 Stage: prod
  • 62. Amazon API Gateway Stage Stage Variables test env : test prod env : prod Deployment Resources Lambda ARN 1 /hello hello:${stageVariables.env}_1 2 /hello hello:${stageVariables.env}_2 AWS Lambda Alias Publish Versions dev $LATEST test_1 1 prod_1 1 test_2 2 prod_2 2 Amazon DynamoDB Table account-test account-production Blue-Green deployment - 2nd release
  • 63. sbt deployDev $ sbt -DAWS_ACCOUNT_ID=<AWS Account ID> -DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> -DAWS_BUCKET_NAME=<BUCKET NAME> > deployDev dev API Gateway created: xxxxxxxxxx API Gateway put: xxxxxxxxxx Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-auth:dev Authorizer: auauau Lambda deployed: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello Lambda Alias: arn:aws:lambda:us-east-1:aaaaaaaaaaaa:function:$name-app-hello:dev Create Deployment: {Id: ddddd,Description: 0.1.0-SNAPSHOT,CreatedDate: Sat Feb 25 12:34:56 JST 2017,}
  • 64. sbt deployList $ sbt -DAWS_ACCOUNT_ID=<AWS Account ID> -DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> -DAWS_BUCKET_NAME=<BUCKET NAME> > deployList dev ============================================================================================================ xxxxxxxxxx ============================================================================================================ | Stage Name | Last Updated Date | Deployment Id | Description | |----------------------|--------------------------------|-----------------|--------------------------------| | dev | Mon Feb 20 21:30:07 JST 2017 | qirn6v | null | | v1 | Mon Feb 20 21:23:41 JST 2017 | 8tb1zr | null | ===================================================================================== xxxxxxxxxx ===================================================================================== | Created Date | Deployment Id | Description | |--------------------------------|-----------------|--------------------------------| | Mon Feb 20 21:30:07 JST 2017 | ddddd2 | 0.1.0-SNAPSHOT | | Mon Feb 20 21:23:41 JST 2017 | ddddd1 | 0.1.0-SNAPSHOT |
  • 65. sbt invoke $ sbt -DAWS_ACCOUNT_ID=<AWS Account ID> -DAWS_ROLE_ARN=arn:aws:iam::<AWS Account ID>:role/<Role NAME> -DAWS_BUCKET_NAME=<BUCKET NAME> > invoke prod ============================================================ GET:https://xxxxxxxxxx.execute-api.us-east-1.amazonaws.com/prod/hellos ============================================================ 200 {"message":"hello world!!"}
  • 66. Summary • Scala is easy to combine DDD and Serverless. • Easy to share processing with multiple projects. • Cheap, scalable and easy to operate. ScalaはDDDとServerlessを組み合わせるとやりやすい。マルチプロジェクトで処理を共通化しやすい。安くてスケーラブルで運用 が楽。