SlideShare a Scribd company logo
Serverless Application
Using Event Streams
to orchestrate a
Jonathan Dee ( jon ) jd@tikisprings.com
November 20, 2018 Serverless Toronto Meetup Group
Where are we ??
Minecraft content and materials are trademarks and copyrights of Mojang and its licensors. All rights reserved.
Serverless means...
● No servers to provision or manage
● Scales with usage
● Never pay for idle
● Built-in high-availability and durability
Serverless means...
● No servers to provision or manage
● Scales with usage
● Never pay for idle
● Built-in high-availability and durability
But what does Serverless mean to
developers and architects ?
● Abstracts away the idea of a server node
Serverless means...
● No servers to provision or manage
● Scales with usage
● Never pay for idle
● Built-in high-availability and durability
But what does Serverless mean to
developers and architects ?
virtual machine, instance, container
● Presents compute resources as high-level, reliable APIs
Leverage what cloud providers and
serverless development kits give you
● compute
● storage, state
● streams
● queues
● network
● observability
● analytics
● build, deploy
● security
● backup, audit
● compute
● storage, state
● streams
● queues
● network
● observability
● analytics
● build, deploy
● security
● backup, audit
Leverage what cloud providers and
serverless development kits give you
● compute
● storage, state
● streams
● queues
● network
● observability
● analytics
● build, deploy
● security
● backup, audit
Leverage what cloud providers and
serverless development kits give you
● compute
● storage, state
● streams
● queues
● network
● observability
● analytics
● build, deploy
● security
● backup, audit
Leverage what cloud providers and
serverless development kits give you
©Copyright 2017, Hasbro.
All Rights Reserved. HASBRO and its logo, and TINKERTOY are trademarks of Hasbro
Powered By:
a big bag of TinkerToy...
Common use cases (faas)
● Endpoint
API-Gateway faas
● Trigger
Object Store faas
● Stream Processing
Event Source faas store
faas store
faas store
faas store
Common use cases (faas)
● Endpoint
API-Gateway faas
● Trigger
Object Store faas
● Stream Processing
Event Source faas store
faas store
faas store
faas store
all singleton faas implementations
What about a whole system?
Using Event Streams in Serverless Applications
Using Event Streams in Serverless Applications
Using Event Streams in Serverless Applications
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
❏Event Streams
❏Message Bus
● Simplify integration
● Create an Extensible architecture
● Promote Event Driven Design
Event Driven Design
Not so much about the Things
● Domain Objects
○ Customer
○ Order
● Entities
○ Customer
○ CustomerType
○ OrderHeader
○ OrderDetail
More about the Verbs
● What's Happened
○ new customer was created
○ order was updated
● The Events
○ customerAdded
○ orderUpdated
● A Notification
● State, or State Transfer
● Causality
● History
Event Driven Design
● Facts of Information
○ Immutable (can't change, or be retracted)
● Events might invalidate, or supercede past Facts
● Events can be ignored by certain observers
● Knowledge is the accumulation of Facts !
What is an Event ? What are its characteristics ?
Common use cases:
Event Driven Design
Commands Events
● METHOD / ACTION on a Object
● Imperative:
eg: CreateOrder, ShipProduct
● Represents something that HAS HAPPENED
● Past-Tense:
eg: OrderCreated, ProductShipped
1. About Intent
2. Directed
3. Targeted destination
4. Control Focused
1. Intentless
2. Anonymous
3. Others Observe, some Ignore
4. Autonomy
(compare / contrast)
Event Driven Design
Commands Events
● METHOD / ACTION on a Object
● Imperative:
eg: CreateOrder, ShipProduct
● Represents something that HAS HAPPENED
● Past-Tense:
eg: OrderCreated, ProductShipped
1. About Intent
2. Directed
3. Targeted destination
4. Control Focused
1. Intentless
2. Anonymous
3. Others Observe, some Ignore
4. Autonomy
(compare / contrast)
API Handler
Program Logic
Database Lookup
Processing
Database Write
↵ Processing
↵ Database Lookup
↵ Program Logic
Synchronous call stack
R
U
N
T
I
M
E
Asynchronous message bus
Request
gateway
updateRequested
Asynchronous message bus
Request
gateway
updateRequested
200 , OK
Asynchronous message bus
Request
gateway
Data
Decorator
updateRequested updateReqPrepared
Asynchronous message bus
Request
gateway
Data
Decorator
Update
Handler
updateRequested updateReqPrepared updateConfirmed
Asynchronous message bus
Request
gateway
Data
Decorator
Update
Handler
Confirmation
Broker
updateRequested updateReqPrepared updateConfirmed
Asynchronous message bus
Request
gateway
Data
Decorator
Update
Handler
Confirmation
Broker
updateRequested updateReqPrepared updateConfirmed confirmationDelivered
Response
gateway
Using Event Streams in Serverless Applications
Sink Drain
Why the Queues ?
Sink Drain
Why the Queues ?
control parallelism
concurrency knob
In a synchronous systems flow
What about doing it the other way ?
c.f. Little's Law
Can you provide a sustained Request Rate by adjusting concurrency ?
feedback loop
** Inspired by: "When Serverless Gets In the Way of Scalability" by Lily Li and Christian Zommerfelds, D2L, @ function18, Toronto, 2018
- Fixing one bottleneck, can result in just moving the bottleneck elsewhere
- Not always easy to apply back-pressure where needed
Asynchronous message bus
Request
gateway
Data
Decorator
Update
Handler
Confirmation
Broker
updateRequested updateReqPrepared updateConfirmed confirmationDelivered
Response
gateway
extensible
Multiple Queue design
You can add a "triage" worker upstream to prioritize different types of traffic into different queues
The mantra of a Queue Worker
● Listen for Events
● Publish Fact(s)
● Do one thing
really well
The mantra of a Queue Worker
● Listen for Events
● Publish Fact(s)
● Do one thing
really well
Something else ?
Not my problem!
Queue Workers
Data
Decorator
Update
Handler
Confirmation
Broker
● Independently :
○ scalable, deployable, versionable
● Ideally idempotent
● Avoid (synchronous) dependencies
Jonas Bonér , QConNewYork2018, DesigningEventsFirstMicroservices
Concept analogous to what we've seen in
Microservices Design (moving from monolith)
Jonas Bonér , QConNewYork2018, DesigningEventsFirstMicroservices
Queue Workers
Data
Decorator
Update
Handler
Confirmation
Broker
● Independently :
○ scalable, deployable, versionable
● Ideally idempotent
● Avoid (synchronous) dependencies
○ maybe "dependency" could be a separate worker ?
○ upstream ? downstream ?
Asynchronous message bus
Request
gateway
Data
Decorator
Update
Handler
Confirmation
Broker
updateRequested updateReqPrepared updateConfirmed confirmationDelivered
Response
gateway
Events
updateRequested updateReqPrepared updateConfirmed confirmationDelivered
● Can also be versioned
○ Upgrade/Downgrade xlat
○ maintain backward compatability
● Key to information flow
● Also key to Tracing, Debugging
Sample event-driven application
Request
gateway
Update
Handler
Confirmation
Broker
updateRequested updateConfirmed confirmationDelivered
Response
gateway
Update Handler
● Listen for updateRequested
● Publish Facts:
updateConfirmed, updateFailed
● Update dynamoDB
○ enforce data integrity
○ marshall request
○ receive reply
bundle extra/new data into event
Sample event-driven application
Request
gateway
Update
Handler
Confirmation
Broker
updateRequested updateConfirmed confirmationDelivered
Response
gateway
+code sample
Confirmation Broker
● Listen for updateConfirmed
● Publish Facts:
confirmationDelivered
● Send msg(s) over mqtt channels
2 channels (topics)
Demo Time !
and look at logs, tracing
Publish/Subscribe, Queues, Streams
Which ?
Serverless Streams, Topics, Queues, & APIs!
How to Pick the Right Serverless Application Pattern
From:
Chris Munns – Senior Developer Advocate – AWS Serverless, August 2018
CQRS
Command Query Responsibility Segregation
Jonas Bonér , QConNewYork2018, DesigningEventsFirstMicroservices
From:
Event Sourcing
● The Event Stream is the source of truth
● The database is just a snapshot of accumulated
events at a certain point in time
Event Sourcing
● The Event Stream is the source of truth
✓ RDBMS already works in a similar way internally
● The database is just a snapshot of accumulated
events at a certain point in time
Event Sourcing
● The Event Stream is the source of truth
✓ RDBMS already works in a similar way internally
✓ Microservices only keep subset snapshots of what they're interested in
● The database is just a snapshot of accumulated
events at a certain point in time
Event Sourcing
● The Event Stream is the source of truth
✓ RDBMS already works in a similar way internally
✓ Microservices only keep subset snapshots of what they're interested in
✓ Can replay the log whenever needed
○ For auditing, tracing, adding observability metrics
○ On Failure
○ For Replication
○ For historic debugging
● The database is just a snapshot of accumulated
events at a certain point in time
Event Sourcing
● The Event Stream is the source of truth
✓ RDBMS already works in a similar way internally
✓ Microservices only keep subset snapshots of what they're interested in
✓ Can replay the log whenever needed
○ For auditing, tracing, adding observability metrics
○ On Failure
○ For Replication
○ For historic debugging
● The database is just a snapshot of accumulated
events at a certain point in time
Time Travel !!
Go build something !
● Take advantage of Free Tiers
All major cloud providers offer some form of this
● Check out: AWS Appsync
Build data driven apps with real time and offline
● Check out: AWS Amplify
easily integrate cloud services into your front-end framework
● Check out: AWS Serverless Application Repo
Jonathan Dee
jd@tikisprings.com
● cloud architecture
● serverless computing
● microservices design
● decoupling monolithic systems
● legacy migration
● database evolution
Questions ?

More Related Content

What's hot (20)

PDF
Using FLiP with influxdb for EdgeAI IoT at Scale
Timothy Spann
 
PPTX
High cardinality time series search: A new level of scale - Data Day Texas 2016
Eric Sammer
 
PDF
"The Grail: React based Isomorph apps framework" Эльдар Джафаров
Fwdays
 
PDF
Advanced Caching Patterns used by 2000 microservices - Devoxx Ukraine
Natan Silnitsky
 
PDF
Cloud arch patterns
Corey Huinker
 
PPTX
Building an Event-oriented Data Platform with Kafka, Eric Sammer
confluent
 
PPTX
Streaming and Social Media
Joe Olson
 
PDF
Lambda Architectures in Practice
C4Media
 
PDF
Kafka Summit SF 2017 - Real-Time Document Rankings with Kafka Streams
confluent
 
PDF
A Tour of Apache Kafka
confluent
 
PDF
Eventing Things - A Netflix Original! (Nitin Sharma, Netflix) Kafka Summit SF...
confluent
 
PPTX
Андрей Шульга "Google apps script"
Fwdays
 
PPTX
Stream Processing Live Traffic Data with Kafka Streams
Tom Van den Bulck
 
PDF
Scylla Summit 2022: Overcoming the Performance Cost of Streaming Transactions
ScyllaDB
 
PDF
Building Microservices with Apache Kafka by Colin McCabe
Data Con LA
 
PDF
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
confluent
 
PDF
Building a distributed Key-Value store with Cassandra
aaronmorton
 
PPTX
Kafka Summit NYC 2017 - Data Processing at LinkedIn with Apache Kafka
confluent
 
PPTX
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
confluent
 
PDF
Axway amplify api management platform
SmartWave
 
Using FLiP with influxdb for EdgeAI IoT at Scale
Timothy Spann
 
High cardinality time series search: A new level of scale - Data Day Texas 2016
Eric Sammer
 
"The Grail: React based Isomorph apps framework" Эльдар Джафаров
Fwdays
 
Advanced Caching Patterns used by 2000 microservices - Devoxx Ukraine
Natan Silnitsky
 
Cloud arch patterns
Corey Huinker
 
Building an Event-oriented Data Platform with Kafka, Eric Sammer
confluent
 
Streaming and Social Media
Joe Olson
 
Lambda Architectures in Practice
C4Media
 
Kafka Summit SF 2017 - Real-Time Document Rankings with Kafka Streams
confluent
 
A Tour of Apache Kafka
confluent
 
Eventing Things - A Netflix Original! (Nitin Sharma, Netflix) Kafka Summit SF...
confluent
 
Андрей Шульга "Google apps script"
Fwdays
 
Stream Processing Live Traffic Data with Kafka Streams
Tom Van den Bulck
 
Scylla Summit 2022: Overcoming the Performance Cost of Streaming Transactions
ScyllaDB
 
Building Microservices with Apache Kafka by Colin McCabe
Data Con LA
 
Kafka Summit NYC 2017 - Every Message Counts: Kafka as a Foundation for Highl...
confluent
 
Building a distributed Key-Value store with Cassandra
aaronmorton
 
Kafka Summit NYC 2017 - Data Processing at LinkedIn with Apache Kafka
confluent
 
Kafka Summit NYC 2017 - Apache Kafka in the Enterprise: What if it Fails?
confluent
 
Axway amplify api management platform
SmartWave
 

Similar to Using Event Streams in Serverless Applications (20)

PPTX
Voxxed Athens 2018 - Eventing, Serverless, and the Extensible Enterprise
Voxxed Athens
 
PPTX
Event-Driven Serverless Architecture - the next big thing in the cloud (Cleme...
Codit
 
PPTX
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Lucas Jellema
 
PDF
Stateful on Stateless - The Future of Applications in the Cloud
Markus Eisele
 
PDF
An eventful tour from enterprise integration to serverless and functions
Christian Posta
 
PDF
2019 10-21 Java in the Age of Serverless
Matt Rutkowski
 
PDF
Event Sourcing, Stream Processing and Serverless (Ben Stopford, Confluent) K...
confluent
 
PDF
Modernising Change - Lime Point - Confluent - Kong
confluent
 
PPTX
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Lucas Jellema
 
PDF
Events and microservices
Saul Caganoff
 
PDF
Event Driven-Architecture from a Scalability perspective
Jonas Bonér
 
PPTX
Event Driven Microservices architecture
NikhilBarthwal4
 
PDF
20220311-EB-Designing_Event_Driven_Systems.pdf
peerbashap
 
PDF
Patterns of Distributed Application Design
GlobalLogic Ukraine
 
PDF
Data Microservices with Spring Cloud
Orkhan Gasimov
 
KEY
Event Driven Architecture
andreaskallberg
 
PPTX
Events & Microservices
Yamen Sader
 
PDF
Cloudstate—Towards Stateful Serverless
Jonas Bonér
 
PDF
Design Microservice Architectures the Right Way
C4Media
 
PPTX
Patterns and practices for an enterprise-scale adoption of serverless!
SheenBrisals
 
Voxxed Athens 2018 - Eventing, Serverless, and the Extensible Enterprise
Voxxed Athens
 
Event-Driven Serverless Architecture - the next big thing in the cloud (Cleme...
Codit
 
Event Bus as Backbone for Decoupled Microservice Choreography (Oracle Code, A...
Lucas Jellema
 
Stateful on Stateless - The Future of Applications in the Cloud
Markus Eisele
 
An eventful tour from enterprise integration to serverless and functions
Christian Posta
 
2019 10-21 Java in the Age of Serverless
Matt Rutkowski
 
Event Sourcing, Stream Processing and Serverless (Ben Stopford, Confluent) K...
confluent
 
Modernising Change - Lime Point - Confluent - Kong
confluent
 
Event Bus as Backbone for Decoupled Microservice Choreography (JFall 2017)
Lucas Jellema
 
Events and microservices
Saul Caganoff
 
Event Driven-Architecture from a Scalability perspective
Jonas Bonér
 
Event Driven Microservices architecture
NikhilBarthwal4
 
20220311-EB-Designing_Event_Driven_Systems.pdf
peerbashap
 
Patterns of Distributed Application Design
GlobalLogic Ukraine
 
Data Microservices with Spring Cloud
Orkhan Gasimov
 
Event Driven Architecture
andreaskallberg
 
Events & Microservices
Yamen Sader
 
Cloudstate—Towards Stateful Serverless
Jonas Bonér
 
Design Microservice Architectures the Right Way
C4Media
 
Patterns and practices for an enterprise-scale adoption of serverless!
SheenBrisals
 
Ad

Recently uploaded (20)

PPTX
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Milwaukee Marketo User Group - Summer Road Trip: Mapping and Personalizing Yo...
bbedford2
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Unlock Efficiency with Insurance Policy Administration Systems
Insurance Tech Services
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
Ortus Solutions, Corp
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Ad

Using Event Streams in Serverless Applications