For just over a year, Swift has been available as a formal release on Linux and frameworks like Kitura and Vapor have made it possible to build mobile backends and web applications on the server. Running Server Swift is however not your own option for becoming a fullstack engineer and building backends in Swift. Amazon, Microsoft, Google, IBM and others are all also providing the ability to run Serverless (aka Lambdas or Functions), with some of those supporting the use of Swift.
This session will introduce you to Serverless Swift, highlight how it compares to Server Swift and show you some applications that have been built with Server(less) Swift.
55. 55
T A
Triggers
• Database update
• IoT sensor activation
• GitHub hook
• Slack notification
• REST request
Actions
• Your code
• Single task
• Any language
• Docker binary
• Returns JSON
AT
56. 56
T A R
Triggers
• Database update
• IoT sensor activation
• GitHub hook
• Slack notification
• REST request
Actions
• Your code
• Single task
• Any language
• Docker binary
• Returns JSON
Rules
• Link Triggers to
Actions
• Create sequences
• Many to many maps
become possible
ATR :=
57. 57
T A R
Triggers
• Database update
• IoT sensor activation
• GitHub hook
• Slack notification
• REST request
Actions
• Your code
• Single task
• Any language
• Docker binary
• Returns JSON
Rules
• Link Triggers to
Actions
• Create sequences
• Many to many maps
become possible
ATR A
A1
A2
A3
:= + +:=
58. 58
T A R P
Triggers
• Database update
• IoT sensor activation
• GitHub hook
• Slack notification
• REST request
Actions
• Your code
• Single task
• Any language
• Docker binary
• Returns JSON
Rules
• Link Triggers to
Actions
• Create sequences
• Many to many maps
become possible
Packages
• Collection of triggers
and actions
ATR A
A1
A2
A3
AB
A2
A1
A4TR
:=
:=
+
+
+
+
:=
:=
59. $ wsk api create /hello get hello —response-type json
59
60. $ wsk api create /hello get hello —response-type json
60
Create
API
61. $ wsk api create /hello get hello —response-type json
61
Create
API
REST
Route Method
62. $ wsk api create /hello get hello —response-type json
62
Create
API
REST
Route Method
From
Action
63. $ wsk api create /hello get hello —response-type json
ok: created API /hello GET for action /_/hello
https://${APIHOST}:9001/api/21ef035/hello
63
Create
API
REST
Route Method
From
Action
64. $ wsk api create /hello get hello —response-type json
ok: created API /hello GET for action /_/hello
https://${APIHOST}:9001/api/21ef035/hello
$ curl https://${APIHOST}:9001/api/21ef035/hello?
name=World
64
Create
API
REST
Route Method
From
Action
66. 66
• Mobile client SDK for iOS and watchOS.
• Fire remote triggers and invoke remote
actions.
• Swift 3, iOS9+ and watchOS 3.
• Install by using CocoaPods, Carthage,
Swift Package Manager, or from the
source directory.
https://github.com/apache/incubator-openwhisk-client-swift
67. var params = [String: String]()
params["payload"] = "Hello"
67
71. Weather Gods
• Premium app from Meyume Ltd.
• Offers a rich interactive experience
unlike other weather apps.
• Sources high quality weather data from
multiple providers including The
Weather Company.
• Provides weather notifications:
• type (rain, snow etc.)
• schedule (evening, morning, or live)
• options (e.g. only notify about heavy
rain).
71
74. 74
BluePic
• Sample app from IBM
• iOS and Web front ends
• Provides photo sharing
• Adds image recognition and weather
data to the photo
• Provides notifications to users
• Social sharing
• Updates to data
https://github.com/IBM/BluePic