go serverless with aws lambda and apex

14
GO SERVERLESS Edoardo Paolo Scalafiotti - Dev @ Sainsbury’s The GIG : Gathering of International Gophers - Paris 10/2016

Upload: edoardo-paolo-scalafiotti

Post on 18-Feb-2017

95 views

Category:

Internet


3 download

TRANSCRIPT

GO SERVERLESSEdoardo Paolo Scalafiotti - Dev @ Sainsbury’s

The GIG : Gathering of International Gophers - Paris 10/2016

About me

● Go, NodeJS● SPAs, WebComponents● Material Design● Serverless Architecture● Microservices● Machine Learning● IoT Prototyping

WHAT IS SERVERLESS?

TL;DRFaaS is about running back end code without

managing your own server systems or your own server applications on an ephemeral container

WHY SHOULD WE CARE?

● Reduced operational cost● Good for prototyping● Good with irregular, high spike traffic that

cannot be handled by auto-scaling● Promotes best coding practises

RUN GO ON LAMBDA: APEX

Apex lets you build, deploy, and manage AWS Lambda functions with ease. It has support for

GoLang and Terraform.

import (

"encoding/json"

"github.com/apex/go-apex"

)

type Message struct {

Hello string `json:"hello"`

}

// Example of a Lambda function handling arbitrary JSON input.

func main() {

apex.HandleFunc(func(event json.RawMessage, ctx *apex.Context) (interface{}, error) {

return &Message{"world"}, nil

})

}

ApiaiCloudformation

CloudwatchCognitoDynamoKinesis

LogsS3

SESSlackSNS

github.com/edoardo849goo.gl/P4nVgn