Slide 1

Slide 1 text

Serverless Server Side Swift Yuki Takei(@noppoMan722) Builderscon Tokyo 2017

Slide 2

Slide 2 text

Who am I? Yuki Takei Freelance Software Engineer • Job: Backend, Infrastructure, Data mining/analysis, iOS • Organizer of Tokyo Server Side Swift Meetup noppoMan noppoman722

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

What is Swift? • Released from Apple on 2014 • For making app on Apple Platforms such as iOS • (Strong)static typing programming language • Swift4 will be released soon.

Slide 6

Slide 6 text

Language Features • No Virtual Machine and Interpreter • Adopting Reference counting to manage memory • Safe • Faster • Expressive

Slide 7

Slide 7 text

“Go vs Node vs Rust vs Swift” sited from https://grigio.org/go-vs-node-vs-rust-vs-swift/

Slide 8

Slide 8 text

1. Web Development with Swift 2. Serverless × Swift 3. Introduction of Hexaville 4. Create Practical Web App with Hexaville 5. Conclusion Objectives

Slide 9

Slide 9 text

1. Web Development with Swift

Slide 10

Slide 10 text

In December 2015 1. Web Development with Swift

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

1. Web Development with Swift

Slide 13

Slide 13 text

1. Web Development with Swift Swift works on Linux

Slide 14

Slide 14 text

That’s mean, We can create web apps with Swift It’s no longer only for the Apple Platforms 1. Web Development with Swift

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Why do we web development with Swift? • Isomorphic development (iOS and Backend) • Faster/Easy to deploy (No VM and Interpreter) • Can reduce run-time errors with Strong Static Typing and Null Safety • Easy to handle parallelism and asynchronously (GCD) 1. Web Development with Swift

Slide 17

Slide 17 text

Swift has been used in iOS Production for 3 years 1. Web Development with Swift

Slide 18

Slide 18 text

1. Development Environment 2. Hello World on Linux 3. Web Servers/Frameworks 4. About Deployment How do we web development with Swift? 1. Web Development with Swift

Slide 19

Slide 19 text

1. Development Environment Swift Package Manager Xcode Mac 1. Web Development with Swift

Slide 20

Slide 20 text

The Key is Swift Package Manager > 1. Development Environment 1. Web Development with Swift

Slide 21

Slide 21 text

Swift Package Manager (SPM) • SPM is a official package management system for Swift. • Post Carthage and CocoaPods • Use to configure application settings and manage dependencies (It’s like npm, sbt) • Also includes cross platform build system (llbuild) > 1. Development Environment 1. Web Development with Swift

Slide 22

Slide 22 text

HexavilleBench$ swift package OVERVIEW: Perform operations on Swift packages USAGE: swift package [options] subcommand SUBCOMMANDS: clean Delete build artifacts describe Describe the current package dump-package Print parsed Package.swift as JSON edit Put a package in editable mode generate-xcodeproj Generates an Xcode project init Initialize a new package reset Reset the complete cache/build directory resolve Resolve package dependencies show-dependencies Print the resolved dependency graph tools-version Manipulate tools version of the current package unedit Remove a package from editable mode update Update package dependencies swift package command > 1. Development Environment 1. Web Development with Swift

Slide 23

Slide 23 text

HexavilleBench$ swift build -h OVERVIEW: Build sources into binary products USAGE: swift build [options] OPTIONS: --build-path Specify build/cache directory [default: ./.build] --build-tests Build the both source and test targets --configuration, -c Build with configuration (debug|release) [default: debug] --disable-prefetching --disable-sandbox Disable using the sandbox when executing subprocesses --enable-prefetching --package-path Change working directory before any other operation --show-bin-path Print the binary output path --verbose, -v Increase verbosity of informational output -Xcc Pass flag through to all C compiler invocations -Xcxx Pass flag through to all C++ compiler invocations -Xlinker Pass flag through to all linker invocations -Xswiftc Pass flag through to all Swift compiler invocations --help Display available options > 1. Development Environment 1. Web Development with Swift swift build command

Slide 24

Slide 24 text

Generate Initial CLI(Server) Project with SPM /Users/yuki/Desktop % mkdir HelloSPM && cd HelloSPM /Users/yuki/Desktop % swift package init —type executable Creating executable package: HelloSPM Creating Package.swift Creating .gitignore Creating Sources/ Creating Sources/main.swift Creating Tests/ /Users/yuki/Desktop/HelloSPM % tree . ├── Package.swift ├── Sources │ └── main.swift └── Tests 2 directories, 2 files > 1. Development Environment 1. Web Development with Swift

Slide 25

Slide 25 text

swift build and execute yuki$ cd HelloSPM HelloSPM$ swift build HelloSPM$ ./.build/debug/HelloSPM Hello, world! > 1. Development Environment 1. Web Development with Swift

Slide 26

Slide 26 text

2. Hello World on Linux 1. Web Development with Swift

Slide 27

Slide 27 text

2. Hello World on Linux 1. Web Development with Swift

Slide 28

Slide 28 text

Linux version of Swift can download from swift.org > 2. Hello World on Linux 1. Web Development with Swift

Slide 29

Slide 29 text

Dockerfile > 2. Hello World on Linux 1. Web Development with Swift

Slide 30

Slide 30 text

Build and Run /Users/yuki/Desktop/HelloSPM % docker build -t hello-spm . ……… Removing intermediate container 2a1e07e3bb29 Successfully built 2b7cd7f22a1b Successfully tagged hello-spm: Build > 2. Hello World on Linux 1. Web Development with Swift

Slide 31

Slide 31 text

Build and Run /Users/yuki/Desktop/HelloSPM % docker build -t hello-spm . ……… Removing intermediate container 2a1e07e3bb29 Successfully built 2b7cd7f22a1b Successfully tagged hello-spm: Build Run /Users/yuki/Desktop/HelloSPM % docker run -it -t hello-spm Hello, world! > 2. Hello World on Linux 1. Web Development with Swift

Slide 32

Slide 32 text

3. Web Frameworks > 2. Hello World on Linux 1. Web Development with Swift

Slide 33

Slide 33 text

• There are several Frameworks (Fullstack - Minimal) • HTTP Server is not provided in Swift Standard Lib • So almost WebFrameworks has Web Server • Covering ORM / Database Driver, JWT and Template engines etc… 3. Web Frameworks > 3. Web Frameworks 1. Web Development with Swift

Slide 34

Slide 34 text

Major Frameworks In Swift > 3. Web Frameworks 1. Web Development with Swift

Slide 35

Slide 35 text

- Vapor - > 3. Web Frameworks 1. Web Development with Swift • Developer: Vapor • Type: HTTPServer and FullStack MVC Framework • GitHub Star: 10K • Documentation: Very GOOD > 3. Vapor

Slide 36

Slide 36 text

Controller > 3. Web Frameworks 1. Web Development with Swift > 3. Vapor

Slide 37

Slide 37 text

Models > 3. Web Frameworks 1. Web Development with Swift > 3. Vapor

Slide 38

Slide 38 text

> 3. Web Frameworks 1. Web Development with Swift > 3. Vapor Learning

Slide 39

Slide 39 text

- Kitura - 1. Web Development with Swift • Developer: IBM • Type: HTTPServer and Lightweight Web Framework • GitHub Star: 6K • Documentation: GOOD? > 3. Kitura

Slide 40

Slide 40 text

Example Code of Kitura HTTP Server > 3. Web Frameworks 1. Web Development with Swift

Slide 41

Slide 41 text

> 3. Web Frameworks 1. Web Development with Swift Actually… I tried to create WAF for Swift a year ago…

Slide 42

Slide 42 text

> 3. Web Frameworks 1. Web Development with Swift Stop developing due to unpopular

Slide 43

Slide 43 text

4. About Deployment 1. Web Development with Swift

Slide 44

Slide 44 text

• Swift doesn’t require VM and Interpreter • Just uploading ELF (required runtime libraries or static link) • Working well with Ubuntu and RedHat Distributions • Working well with ECS, Kubernetes and other Container Services 4. About Deployment 1. Web Development with Swift

Slide 45

Slide 45 text

Works on well known Cloud Platforms > 4. About Deployment 1. Web Development with Swift

Slide 46

Slide 46 text

Swift web development is getting Real! Web Development with Swift

Slide 47

Slide 47 text

But, bit early…. right? Web Development with Swift

Slide 48

Slide 48 text

I have good news! Web Development with Swift

Slide 49

Slide 49 text

You can small start Swift Web Development with Serverless Computing Web Development with Swift

Slide 50

Slide 50 text

2. Serverless × Swift

Slide 51

Slide 51 text

”Serverless computing is a cloud computing execution model in which the cloud provider dynamically manages the allocation of machine resources, and bills based on the actual amount of resources consumed by an application, rather than billing based on pre- purchased units of capacity.” Serverless computing from wikipedia ~Serverless computing~ 2. Serverless × Swift

Slide 52

Slide 52 text

Advantages of Serverless Computing • Lower cost • Free from Server Management / Scaling • Mobile engineers can easily develop server side • Faster innovation 2. Serverless × Swift

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

2. Serverless × Swift This time I’ll focus on AWS's Lambda and API Gateway to tell you about Serverless and compatibility of Swift

Slide 55

Slide 55 text

Lambda 2. Serverless × Swift • AWS’s Serverless Service • Triggered by Internal Events • Doesn’t have HTTP Endpoint

Slide 56

Slide 56 text

2. Serverless × Swift APIGateway • Gateway and Frontend for the AWS Services • Provides HTTPS Endpoint • Can choose lambda as backend service • Client -> API Gateway -> Lambda

Slide 57

Slide 57 text

Anyways, Can we use Swift on AWS Lambda? 2. Serverless × Swift

Slide 58

Slide 58 text

2. Serverless × Swift Environment of AWS Lambda • Amazon Linux • Only supports 64Bit Binary • Supporting Languages: Node.js, Python, Java and .NET Core

Slide 59

Slide 59 text

2. Serverless × Swift Environment of AWS Lambda • Amazon Linux • Only supports 64Bit Binary • Supporting Languages: Node.js, Python, Java and .NET Core

Slide 60

Slide 60 text

W h a t t h e f ̋ c k !?

Slide 61

Slide 61 text

Calm down!

Slide 62

Slide 62 text

Swift become ELF(64bit) after building

Slide 63

Slide 63 text

Swift code ELF Lambda Upload Build Swift works on Lambda with following flow 2. Serverless × Swift

Slide 64

Slide 64 text

• Need Linux to build swift • Different development and work flow from conventional web development • Must execute Swift from supported languages • Anyways, It’s bother to deploy APIGateway + Lambda But… 2. Serverless × Swift

Slide 65

Slide 65 text

Deployment Flow of Lambda + ApiGateway Code Zip S3 Lambda APIGateway ᶄ Upload ᶃ Archive ᶅ Create Function with S3 URL ᶆ Resource(Path) and Function Mapping ᶇ Deploy 2. Serverless × Swift ᶆ’ mapping

Slide 66

Slide 66 text

Deployment Flow of Lambda + ApiGateway Code Zip S3 Lambda APIGateway ᶄ Upload ᶃ Archive ᶅ Create Function with Uploaded Zip URL ᶆ Resource and Function Mapping Request ᶇ Deploy Request Mapping Function and Resource Serverless × Swift It’s hard….

Slide 67

Slide 67 text

I thought we can automate such bother things and focus to develop web apps with Swift 2. Serverless × Swift

Slide 68

Slide 68 text

Then I tried to develop ….. 2. Serverless × Swift

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

3. Introduction of Hexaville

Slide 71

Slide 71 text

• 1. What is Hexaville? • 2. Installation • 3. Deploy to AWS • 4. How is Swift executed on Lambda? • 5. How to Debug? 3. Introduction of Hexaville Objectives

Slide 72

Slide 72 text

• Framework and libraries for building serverless applications that is written in Swift • Currently only supports AWS APIGateway+Lambda • Don’t need to deep knowledge for AWS • Cloud Native 1. What is Hexaville? 3. Introduction of Hexaville

Slide 73

Slide 73 text

What Hexaville solved / will solve • Fully automate deployment of Swift program to serverless environment (Routing, code deploy etc..) • Automatically create Swift execution environment on Lambda • Normal Development/Deployment work flow • iOS Developer can write backend and client with single language. can share code. > 1. What is Hexaville? 3. Introduction of Hexaville

Slide 74

Slide 74 text

Hexaville has Two layers > 1. What is Hexaville? 3. Introduction of Hexaville Hexaville Framework (Web Application Framework) Hexaville (Command Line Interface) Your Application Code Deploy

Slide 75

Slide 75 text

HexavilleFramework • Web Application Framework layer for Hexaville • Executed on Lambda • Provides Middleware and Router features • Extendable with Middlewares and plugins > 1. What is Hexaville? 3. Introduction of Hexaville

Slide 76

Slide 76 text

Basic Usage and Routing > 1. What is Hexaville? 3. Introduction of Hexaville

Slide 77

Slide 77 text

Your Own Middleware > 1. What is Hexaville? 3. Introduction of Hexaville

Slide 78

Slide 78 text

2. Installation 3. Introduction of Hexaville

Slide 79

Slide 79 text

> 2. Installation 3. Introduction of Hexaville

Slide 80

Slide 80 text

/Users/yuki/WorkingsPlace/program/polyrhythm/FlieriOS % hexaville Available commands: - generate Generate initial project - deploy Deploy your application to the specified cloud provider - routes Show routes and endpoint for the API - help Prints this help information - version Prints the current version of this app hexaville command > 2. Installation 3. Introduction of Hexaville

Slide 81

Slide 81 text

/Users/yuki/WorkingsPlace/program/polyrhythm/FlieriOS % hexaville Available commands: - generate Generate initial project - deploy Deploy your application to the specified cloud provider - routes Show routes and endpoint for the API - help Prints this help information - version Prints the current version of this app hexaville command > 2. Installation 3. Introduction of Hexaville

Slide 82

Slide 82 text

/Users/yuki/Desktop % hexaville generate Hello /Users/yuki/Desktop % tree Hello Hello ├── Hexavillefile.yml ├── Package.swift └── Sources ├── RandomNumberGenerateMiddleware.swift └── main.swift 1 directory, 4 files The initial directory structure > 2. Installation 3. Introduction of Hexaville

Slide 83

Slide 83 text

Hexavillefile.yml - Configuration file for the Hexaville Package.swift - SPM manifest file that have dependencies, app settings Sources/main.swift - entrypoint Sources/RandomNumberGenerateMiddleware.swift - An example code of Middleware > 2. Installation 3. Introduction of Hexaville

Slide 84

Slide 84 text

A Project created with hexaville generate is ready to be deployed to lambda immediately. > 2. Installation 3. Introduction of Hexaville

Slide 85

Slide 85 text

2. Deploy to AWS 3. Introduction of Hexaville

Slide 86

Slide 86 text

Configure Your Hexavillefile.yml > 3. Deploy to AWS 3. Introduction of Hexaville

Slide 87

Slide 87 text

/Users/yuki/Desktop/Hello % hexaville deploy Hello Hexavillefile: /Users/yuki/Desktop/Hello/Hexavillefile.yml Start to build swift... Building application.... Generating Routing Manifest file.... Generated Routing Manifest file Sending build context to Docker daemon 351.2kB Step 1/11 : FROM ubuntu:14.04 ---> 4a2820e686c4 Step 2/11 : RUN apt-get update -y ---> Using cache ---> 00c2bd676a0a 3. Introduction of Hexaville > 3. Deploy to AWS ‘hexaville deploy’ command

Slide 88

Slide 88 text

Deployment Flow of Lambda + ApiGateway Code Zip S3 Lambda APIGateway ᶄ Upload ᶃ Archive ᶅ Create Function with S3 URL ᶆ Resource(Path) and Function Mapping ᶇ Deploy ᶆ’ mapping > 4. How is Swift executed on lambda? 3. Introduction of Hexaville

Slide 89

Slide 89 text

Deployment Flow of Lambda + ApiGateway Code Zip S3 Lambda APIGateway ᶄ Upload ᶃ Archive ᶅ Create Function with S3 URL ᶆ Resource(Path) and Function Mapping ᶇ Deploy ᶆ’ mapping > 4. How is Swift executed on lambda? 3. Introduction of Hexaville Totally Automated!!

Slide 90

Slide 90 text

###################################################### Information ApplicationName: Hello Endpoint: https://xxx.execute-api.ap-northeast-1.amazonaws.com/staging Stage: staging ###################################################### All Done. Deployment done 3. Introduction of Hexaville > 3. Deploy to AWS

Slide 91

Slide 91 text

Access / from Browser 3. Introduction of Hexaville > 3. Deploy to AWS

Slide 92

Slide 92 text

it could deploy swift web application in only 5 minutes without Signing in AWS 3. Introduction of Hexaville > 3. Deploy to AWS

Slide 93

Slide 93 text

4. How is Swift executed on lambda? 3. Introduction of Hexaville

Slide 94

Slide 94 text

Hexaville ᶃ Build (call hexaville deploy) Hexaville Framework Web App Code Your Web App Ubuntu Deployment Flow of Hexaville > 4. How is Swift executed on lambda? 3. Introduction of Hexaville

Slide 95

Slide 95 text

Hexaville ELF Hexaville Framework Web App Code Your Web App Ubuntu ᶄ Put the ELF into the Host Machine Deployment Flow of Hexaville > 4. How is Swift executed on lambda? 3. Introduction of Hexaville ᶃ Build (call hexaville deploy)

Slide 96

Slide 96 text

Hexaville ELF - index.js - *.so ᶅArchive Hexaville Framework Web App Code Your Web App Ubuntu ᶄ Put the ELF into the Host Machine Deployment Flow of Hexaville Zip file > 4. How is Swift executed on lambda? 3. Introduction of Hexaville ᶃ Build (call hexaville deploy)

Slide 97

Slide 97 text

Hexaville ELF AWS - index.js - *.so ᶅArchive ᶆ Deploy Hexaville Framework Web App Code Your Web App Ubuntu ᶄ Put the ELF into the Host Machine Deployment Flow of Hexaville Zip file > 4. How is Swift executed on lambda? 3. Introduction of Hexaville ᶃ Build (call hexaville deploy)

Slide 98

Slide 98 text

Hexaville ELF ᶃ Build AWS - index.js - *.so ᶅArchive ᶆ Deploy Hexaville Framework Web App Code Your Web App Ubuntu ᶄ Put the ELF into the Host Machine Deployment Flow of Hexaville Zip file Introduction of Hexaville > 2. How is Swift executed on lambda?

Slide 99

Slide 99 text

The Exposure of a trick > 4. How is Swift executed on lambda? 3. Introduction of Hexaville

Slide 100

Slide 100 text

5. How to Debug? 3. Introduction of Hexaville

Slide 101

Slide 101 text

5. How to Debug? 3. Introduction of Hexaville • Local Debug • Remote Debug There are two types of debugging

Slide 102

Slide 102 text

HexavilleFramework is also executable > 5. How to Debug? 3. Introduction of Hexaville

Slide 103

Slide 103 text

Local Debug > 5. How to Debug? /Users/yuki/Desktop/ % cd Hello /Users/yuki/Desktop/Hello % swift build /Users/yuki/Desktop/Hello % ./.build/debug/Hello Available commands: - gen-routing-manif Generate routing manifest file - execute Execute the specified resource. ex. execute GET / - serve Start Hexaville Builtin Server - help Prints this help information - version Prints the current version of this app 3. Introduction of Hexaville

Slide 104

Slide 104 text

Local Debug /Users/yuki/Desktop/ % cd Hello /Users/yuki/Desktop/Hello % swift build /Users/yuki/Desktop/Hello % ./.build/debug/Hello Available commands: - gen-routing-manif Generate routing manifest file - execute Execute the specified resource. ex. execute GET / - serve Start Hexaville Builtin Server - help Prints this help information - version Prints the current version of this app > 5. How to Debug? 3. Introduction of Hexaville

Slide 105

Slide 105 text

Local Debug /Users/yuki/Desktop/Hello % ./.build/debug/Hello serve Hexaville Builtin Server started at 0.0.0.0:3000 Serve builtin web server > 5. How to Debug? 3. Introduction of Hexaville

Slide 106

Slide 106 text

Local Debug Access the resource with curl /Users/yuki/Desktop/Hello % curl localhost:3000 HexavilleWelcome to Hexaville! > 5. How to Debug? 3. Introduction of Hexaville /Users/yuki/Desktop/Hello % ./.build/debug/Hello serve Hexaville Builtin Server started at 0.0.0.0:3000 Serve builtin web server

Slide 107

Slide 107 text

Debuggable with Xcode and LLDB > 5. How to Debug? 3. Introduction of Hexaville

Slide 108

Slide 108 text

Remote Debug > 5. How to Debug? 3. Introduction of Hexaville Cloud Watch logs

Slide 109

Slide 109 text

$ hexaville tail -f your-project-name Now I’m considering to implement… > 5. How to Debug? 3. Introduction of Hexaville

Slide 110

Slide 110 text

Customize Error handling and Logging let app = HexavilleFramework() app.catch { error in print(error) // stdout will be output to Cloud Watch Logs // or // SendLog to Fluentd or something switch error { case FooError.notFound: return Response(status: .notFound) case JWTAuthenticationMiddleware.authrozationHeaderIsMissing: return Response(status: .unauthorized) default: return Response(status: .internalServerError) } } try app.run() > 5. How to Debug? 3. Introduction of Hexaville

Slide 111

Slide 111 text

4. Create Practical Web App with Hexaville

Slide 112

Slide 112 text

https://github.com/noppoMan/HexavilleTODOExample 4. Create Practical Web App with Hexaville

Slide 113

Slide 113 text

OAuth2 Overview Callback 4. Create Practical Web App with Hexaville TODO Page(Hexaville) login page (Hexaville)

Slide 114

Slide 114 text

Stacks 4. Create Practical Web App with Hexaville • Hexaville: v0.2.0 • HexavilleFramework: v0.1.12 • Session Storage: DynamoDB • Main Data Base: DynamoDB

Slide 115

Slide 115 text

Demo (Movie) 4. Create Practical Web App with Hexaville

Slide 116

Slide 116 text

4. Create Practical Web App with Hexaville

Slide 117

Slide 117 text

Plugins that are used in this time 4. Create Practical Web App with Hexaville

Slide 118

Slide 118 text

HexavilleAuth 4. Create Practical Web App with Hexaville

Slide 119

Slide 119 text

HexavilleAuth • OAuth1 • OAuth2 Authorization Methods Authentication Methods • Email and Password (not implemented yet) 4. Create Practical Web App with Hexaville

Slide 120

Slide 120 text

Supported SNS Platforms • Facebook • Github • Google • Instagram OAuth1 OAuth2 • Twitter 4. Create Practical Web App with Hexaville

Slide 121

Slide 121 text

import HexavilleAuth let facebookProvider = FacebookAuthorizationProvider( path: "/auth/facebook", consumerKey: ProcessInfo.processInfo.environment[“FACEBOOK_APP_ID"]! ?? "", consumerSecret: ProcessInfo.processInfo.environment[“FACEBOOK_APP_SECRET"]!, callbackURL: CallbackURL(baseURL: “http://foo.bar”, path: "/auth/facebook/callback"), scope: "public_profile,email" ) { credentianl, user, req, ctx in return Response(body: "access token is: \(credentianl.accessToken)") } var auth = HexavilleAuth() auth.add(facebookProvider) app.use(session) app.use(HexavilleAuth.AuthenticationMiddleware()) app.use(auth) // Available /auth/facebook and /auth/facebook /callback app.use(auth) { request, context in print(context.isAuthenticated()) } Code Example 4. Create Practical Web App with Hexaville

Slide 122

Slide 122 text

Session 4. Create Practical Web App with Hexaville

Slide 123

Slide 123 text

• DynamoDB (noppoMan) DataBase Clients 4. Create Practical Web App with Hexaville Using in TODO Example • Redis (IBM-Swift, Vapor) • MySQL (noppoMan, IBM-Swift) • Postgres (IBM-Swift) • MongoDB (OpenKitten) Other Available DB Clients

Slide 124

Slide 124 text

One more thing

Slide 125

Slide 125 text

• RDBMS and Serverless • Continuous Integration 4. Create Practical Web App with Hexaville Hexaville on Production > Hexaville on production

Slide 126

Slide 126 text

• Almost developers loves RDBMS even now • Our program is not a daemon on Serverless • —> Can’t keep connection for RDBMS • 1 HTTP Request = 1 Connection of RDBMS • —> Your RDBMS will hang up RDBMS and Serverless 4. Create Practical Web App with Hexaville > Hexaville on production

Slide 127

Slide 127 text

No content

Slide 128

Slide 128 text

Hexaville provides following Pooling Connections Mechanism > Hexaville on production 4. Create Practical Web App with Hexaville

Slide 129

Slide 129 text

• Hexaville can easily do CI • Provides Prebuilt Binary and Installable just one line command • Doesn’t need to install Swift Language and Runtime • just 3 steps: git push -> test -> hexaville deploy Continuous Integration and Hexaville >Continuous Integration and Hexaville 4. Create Practical Web App with Hexaville

Slide 130

Slide 130 text

Hexaville is available on major CI Services 4. Create Practical Web App with Hexaville

Slide 131

Slide 131 text

5. Conclusion

Slide 132

Slide 132 text

Swift Server Performance 5. Conclusion Processed Num of Requests in 30s 0 17500 35000 52500 70000 Prorsum(Swift 3.1) Kitura(Swift 3.1) Go 1.7 HTTP Server Node.js4.3 http 14,769 64,768 17,144 29,436 ɾwrk -d 30s -t 4 -c 20 ɾResponded with the 10 length of random JSON array ɾMachine: MacOS Sierra, 8 logical cores, 8GB RAM

Slide 133

Slide 133 text

http://qiita.com/applideveloper/items/0ac1a38249cccdc3f2d1 Akka HTTP (Scala) Prorsum (Swift 3.1)

Slide 134

Slide 134 text

5. Conclusion wrk -d 30s -t 4 -c 20 Request/sec 0 25 50 75 100 Simple JSON Hexaville(Swift4 -O) Node.js 4.3 Node.js4.3 vs Hexaville on Lambda(512 RAM)

Slide 135

Slide 135 text

5. Conclusion wrk -d 30s -t 4 -c 20 Request/sec 0 25 50 75 100 Simple JSON SHA256(1720 length string) Hexaville(Swift4 -O) Node.js 4.3 Node.js4.3 vs Hexaville on Lambda(512 RAM)

Slide 136

Slide 136 text

Real Product that use Hexaville 5. Conclusion

Slide 137

Slide 137 text

No content

Slide 138

Slide 138 text

No content

Slide 139

Slide 139 text

Thanks!