Using the Event Gateway to build
serverless multi-cloud applications
philipp@serverless.com
@pmmuens
Philipp Müns
Software Engineer, Serverless Inc.
architectures
serverless
http://theburningmonk.com/2016/12/yubls-road-to-serverless-architecture-part-1/
# serverless.yml
service:
name: users
description: Users CRUD service
provider:
name: aws
runtime: nodejs6.10
stage: prod
region: us-east-1
functions:
register:
handler: users.register
events:
- http:
path: /users
method: POST
Use Cases
● Web, mobile, IoT backends
● Form processing
● Auth
● DevOps automation
● Stream processing
● Chatbots
● Voice apps
● GraphQL API
● ETL
● CRON jobs
● Webhooks
● Dynamic HTML
...
Server-Less == Service-Full
Going multi-cloud
AWS Azure Google IBM On-Prem
FaaS FaaS FaaS FaaS FaaS
Business Problem
at a large scale is still hard
serverless
The highly productive event router for FaaS
Event Gateway
● “Realtime data-flow engine” (L7 Proxy)
● Events (data) → Functions (serverless compute)
● API Gateway & Pub/Sub
● Run FaaS on any provider → Cross-cloud applications
● Extensible through middlewares and plugins
● Hosted version / On-Prem
What is the Event Gateway?
AWS
Lambda
Azure
Functions
Google Cloud
Functions
Event
Event Gateway
On-Prem FaaS...
Goals
● Express all data as events
● React to any event, with any FaaS, in any location
● Be flexible, develop fast
● Accommodate many use-cases
● Decouple logic
● Decouple teams
Express all data as events
● Receives data via HTTP and
interprets it as an event
● Ingests custom event schemas
● Ingests HTTP requests as events
● Emits logs, metrics & errors as events
Data
● Any event
● Supports major FaaS providers
● Discovery
● Composition
● Communication
React to any event, with any FaaS, in any location
AWS
Lambda
Azure
Functions
Google Cloud
Functions
Be flexible, accommodate many use-cases
Be flexible, accommodate many use-cases
Pub/Sub
HTTP
request with
special
headers
Request body
is converted to
an event
Be flexible, accommodate many use-cases
Pub/Sub
HTTP
request with
special
headers
Request body
is converted to
an event
API
Gateway
HTTP
request
Request is
converted to
an HTTP event
Be flexible, accommodate many use-cases
Pub/Sub
HTTP
request with
special
headers
Request body
is converted to
an event
API
Gateway
HTTP
request
Request is
converted to
an HTTP event
Webhooks
HTTP
request from
a supported
integration
Event
Gateway
knows what to
do
Decouple logic, decouple teams
App
Functions
Marketing
Functions
HR
Functions
Event
● FaaS decouples logic
● Event-driven design decouples teams
an example
event gateway
An example
google-hello
aws-hello
An example
curl --request POST 
--url http://localhost:4001/v1/functions 
--header 'content-type: application/json' 
--data '{
"functionId": "aws-hello",
"provider":{
"type": "awslambda",
"arn": "arn:aws:lambda:::function:aws-hello",
"region": "us-east-1"
}
}'
google-hello
aws-hello
An example
curl --request POST 
--url http://localhost:4001/v1/functions 
--header 'content-type: application/json' 
--data '{
"functionId": "google-hello",
"provider":{
"type": "http",
"url": "https://cloudfunctions.net/google-hello"
}
}'
google-hello
aws-hello
An example
curl --request POST 
--url http://localhost:4001/v1/subscriptions 
--header 'content-type: application/json' 
--data '{
"functionId": "aws-hello",
"event": "http",
"path": "/aws-hello",
"method": "GET"
}'
google-hello
aws-hello
An example
curl --request POST 
--url http://localhost:4001/v1/subscriptions 
--header 'content-type: application/json' 
--data '{
"functionId": "google-hello",
"event": "google.hello",
"path": "/google-hello"
}'
google-hello
aws-hello
An example
curl http://localhost:4000/aws-hello
google-hello
aws-hello
An example
curl --request POST 
--url http://localhost:4000 
--header 'content-type: application/json' 
--header 'event: google.hello' 
--data '{ "firstName": "John", "lastName": "Doe" }'
google-hello
aws-hello
old architecture
serverless
FaaS (single provider)
Workflows (e.g. AWS StepFunctions)
Streaming Data (e.g. AWS Kinesis)
Pub/Sub (e.g. AWS SNS)
API Gateway (e.g. AWS API Gateway)
new architecture
serverless
FaaS (multi cloud / on-prem)
Event Gateway
how do I get started?
Event Gateway
How do I get started?
● Product page → https://serverless.com/event-gateway
● GitHub repository → https://github.com/serverless/event-gateway
● Hosted version → https://serverless.com/event-gateway/enterprise
● Example application → https://github.com/serverless/event-gateway-example
● Workshop / Tutorial → https://github.com/serverless/event-gateway-workshop
AWS
Lambda
Azure
Functions
Google Cloud
Functions
Pub/SubAPI Endpoints Webhooks
Event Gateway
maciej@serverless.com
@mthenw
Maciej Winnicki
Event Gateway Architect
philipp@serverless.com
@pmmuens
Philipp Müns
Software Engineer, Serverless Inc.

Using the Event Gateway To Build Multi-Cloud Serverless Applications - JeffConf Hamburg 2018