いるけどないからつくってみたよ高速モバイルプッシュ配信くん #cmdevio

Click here to load reader

  • date post

    16-Apr-2017
  • Category

    Technology

  • view

    3.039
  • download

    0

Embed Size (px)

Transcript of いるけどないからつくってみたよ高速モバイルプッシュ配信くん #cmdevio

  • AWS/IoT

    Advanced Track #1

    1

    Daisuke Fujimura 2015/11/21

  • Daisuke Fujimura AWS

    Web (AWS / )

    Java 2

  • is ?

    3

  • 4

    is ?

  • 5

  • 6

  • 7

  • 8

    () !?

  • Amazon SNS

    9

  • Amazon SNS

    10

  • Amazon SNS http://docs.aws.amazon.com/ja_jp/sns/

    latest/dg/welcome.html

    11

    http://docs.aws.amazon.com/ja_jp/sns/latest/dg/welcome.html

  • Amazon SNS

    12

    http://docs.aws.amazon.com/ja_jp/sns/latest/dg/welcome.html

    http://docs.aws.amazon.com/ja_jp/sns/latest/dg/welcome.html

  • 13

  • API 1

    1000 1000000

    14

  • : (, , ,

    etc) (= ) : (, etc)

    15

  • 1 http://docs.aws.amazon.com/ja_jp/

    general/latest/gr/aws_service_limits.html#limits_sns

    16

    http://docs.aws.amazon.com/ja_jp/general/latest/gr/aws_service_limits.html#limits_sns

  • Amazon SNS http://docs.aws.amazon.com/ja_jp/sns/

    latest/dg/SNSMobilePush.html

    17

    http://docs.aws.amazon.com/ja_jp/sns/latest/dg/SNSMobilePush.html

  • 18

    http://docs.aws.amazon.com/ja_jp/sns/latest/dg/SNSMobilePush.html

    http://docs.aws.amazon.com/ja_jp/sns/latest/dg/SNSMobilePush.html

  • ()

    19

  • 20

  • Amazon S3

    21

  • Amazon S3 (= )

    http://docs.aws.amazon.com/ja_jp/AmazonS3/latest/dev/Welcome.html

    22

    http://docs.aws.amazon.com/ja_jp/AmazonS3/latest/dev/Welcome.html

  • 23

  • 24

    { "bucket" : ", "message" : { ... }}

  • 25

  • Amazon SQS

    26

  • Amazon SQS SNS

    http://docs.aws.amazon.com/ja_jp/AWSSimpleQueueService/latest/SQSDeveloperGuide/Welcome.html

    27

    http://docs.aws.amazon.com/ja_jp/AWSSimpleQueueService/latest/SQSDeveloperGuide/Welcome.html

  • 28

  • 29

    arn:aws:sns:ap-northeast-1:XXXXXXXXXXXX:endpoint/GCM/xxx-sns/aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeeearn:aws:sns:ap-northeast-1:XXXXXXXXXXXX:endpoint/APNS/xxx-sns/aaaaaaaa-bbbb-cccc-dddd-ffffffffffff

    ARN (Amazon Resouce Name)

  • 30

  • 31

  • 32

  • 33

  • 34

  • 35

  • 36

  • EC2 EC2 bucket

    37

  • #1

    38

    bucket

  • EC2 EC2 bucket

    39

  • #2

    40

    offset

    Request header Range http://

    docs.aws.amazon.com/ja_jp/AmazonS3/latest/API/RESTObjectGET.html

    ARN

    http://docs.aws.amazon.com/ja_jp/AmazonS3/latest/API/RESTObjectGET.html

  • EC2 EC2 bucket

    41

  • #3

    42

    SQS

  • EC2 EC2 bucket

    43

  • 2500 push / min t2.micro x 1

    44

  • () AWS

    AWS

    45

  • is ?

    46

  • Single Command Deploy Spring Boot (Java) Docker Gradle AWS Elastic Beanstalk CloudFormation

    47

  • Single Command Deploy

    48

  • Single Command Deploy Spring Boot

    Docker

    Gradle

    CloudFormation

    Elastic Beanstalk

    49

  • Single Command Deploy slideshare http://www.slideshare.net/daisuke_m/

    single-command-deploy-gradleawsplugin

    50

    http://www.slideshare.net/daisuke_m/single-command-deploy-gradleawsplugin

  • Spring Boot

    51

    http://projects.spring.io/spring-boot/

    http://projects.spring.io/spring-boot/

  • Java Play Framework Dropwizard Ninja Framework Spring Boot etc Java http

    52

  • Spring Boot $ java -jar your-app.jar

    classpath

    Spring Boot

    http://dev.classmethod.jp/server-side/spring-boot/

    53

    http://dev.classmethod.jp/server-side/spring-boot/

  • Docker

    54

    https://www.docker.com/

    https://www.docker.com/

  • Docker Go Infrastructure as Code (Dockerfile) VCS

    55

  • Docker (for Spring Boot) Java your-app.jar

    java

    56

  • Dockerfile # Java

    FROM java:openjdk-8-jdk#

    EXPOSE 8080WORKDIR /opt/haishinkunADD your-appx.y.z.jar /opt/haishinkunCMD /usr/bin/java -jar your-appx.y.z.jar

    57

  • Elastic Beanstalk

    58

    http://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/Welcome.html

    http://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/Welcome.html

  • Elastic Beanstalk AWS ELB () EC2 () Auto Scaling ()

    Application Bundle

    59

  • Application Bundle Elastic Beanstalk zip your-app.jar Dockerfile etc

    60

  • CloudFormation

    61

    http://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/Welcome.html

    http://docs.aws.amazon.com/ja_jp/AWSCloudFormation/latest/UserGuide/Welcome.html

  • CloudFormation AWS

    Elastic Beanstalk ()

    VPC ()

    S3 () RDS () etc

    Infrastructure as Code () VCS

    62

  • { "AWSTemplateFormatVersion": "2010-09-09", "Description": Your App environment template", "Parameters": { // // , , SSH IP, etc }, "Resources": { // // EC2, ELB, S3, RDS, etc }}

    63

  • CloudFormation

    64

    Parameter =

    Resource Stack

  • Gradle

    65

    http://gradle.org/

    http://gradle.org/

  • Gradle Java etc

    Spring Boot spring-boot-gradle-plugin

    66

  • Gradle

    67

    apply plugin: "java" // apply plugin: "spring-boot"

    task helloWorld

  • gradle-aws-plugin Gradle AWS

    github

    https://github.com/classmethod-aws/gradle-aws-plugin

    68

    https://github.com/classmethod-aws/gradle-aws-plugin

  • buildscript { repositories { mavenCentral() maven { url "https://plugins.gradle.org/m2/" } } dependencies { classpath "jp.classmethod.aws:gradle-aws-plugin:0.22.2" }}

    apply plugin: "jp.classmethod.aws.s3"apply plugin: "jp.classmethod.aws.cloudformation"apply plugin: "jp.classmethod.aws.beanstalk"

    69

  • () AWS

    70

  • 71