SlideShare a Scribd company logo
Building a
serverless event
driven Slack Bot
Jimmy Dahlqvist
Øredev - 2022-11-09
@jimmydahlqvist
Agenda
Background
Event-driven architecture
Pizza Bot (Demo)
Summary and conclusion
@jimmydahlqvist
Hello, I'm
JIMMY DAHLQVIST
Father of two girls
Serverless enthusiast
AWS Ambassador
AWS Community Builder
Head of AWS Technologies at Sigma Technology Cloud
Background
Use Case - Pizzeria
@jimmydahlqvist
Online Pizza order
Order service Bake service
@jimmydahlqvist
Online order
Order Service
Payment Service
Delivery Service
Bake service
@jimmydahlqvist
Downstream error
Order Service
Payment Service
Delivery Service
Bake service
@jimmydahlqvist
Order canceled
Order Service
Payment Service
Delivery Service
Bake service
@jimmydahlqvist
Order canceled
Order Service
Payment Service
Delivery Service
Bake service
Loyalty Service
Event-driven architecture with
Amazon EventBridge
@jimmydahlqvist
Event
A signal to indicate that
something has
changed or happened.
• Immutable
• Observable
• Facts
• JSON
@jimmydahlqvist
Observable
Data changed
OK
OK Gothca
OK
@jimmydahlqvist
Online order
Order service
Payment service
Delivery service
Bake service
Loyalty service
@jimmydahlqvist
No pineapple
Order service
Payment service
Delivery service
Bake service
Loyalty service
@jimmydahlqvist
Luigi has a great idea!
Order service
Payment service
Delivery service
Bake service
Loyalty service
Tracking service
@jimmydahlqvist
No pineapple
Order service
Payment service
Delivery service
Bake service
Loyalty service
Tracking service
@jimmydahlqvist
Summary event-driven architecture
• Actions are being observed
• Services are loosely coupled
• Easy to extend
Services deep dive
@jimmydahlqvist
Amazon EventBridge
• Fully managed and serverless
• 15+ AWS services as target
• API destinations
• EventBridge to EventBridge
• Easy to build event-driven architecture
• Low price
@jimmydahlqvist
Event bus patterns
Single Bus (Centralized)
Multi Bus (Decentralized)
@jimmydahlqvist
Centralized
Advantages
• Centralized routing and resource management
• Easy to integrate new application
Disadvantages
• Single point of failure
• Leaking business logic
@jimmydahlqvist
Single bus pattern
• Good place to start
AWS account
Order Service
Delivery Service
Bake Service
@jimmydahlqvist
Decentralized (Distributed)
Advantages
• No single point of failure
• Enables autonomy
Disadvantages
• Challenge to design
• More resources to manage
@jimmydahlqvist
Multi bus pattern
• Each service owns its bus
• No centrally managed routing
AWS account
Order Service
Delivery Service
Bake Service
@jimmydahlqvist
Default event bus
• One per region and AWS account
• Leave it alone!
• Create your own custom buses
@jimmydahlqvist
Create subscriptions
Creates coupling on the filter
Complex to add more targets
Changing the filter affect all
Coupling is on the event
Easy to add more targets
Filters can change independently
@jimmydahlqvist
AWS StepFunctions
• Resilient workflow automation
• Built-in error handling
• Cost effective
• Powerful service integrations
@jimmydahlqvist
Service integrations
Optimized integrations
• 15+ service integrations
• Customized to optimize and simplify
usage of supported AWS services
AWS SDK integrations
• 200+ SDK integrations
• Call a wide range of services using
9000+ API actions.
@jimmydahlqvist
Workflow types
Express workflow
• Short running – 5 minutes
• 100K starts per second
• Pay for duration
Standard workflow
• Long running - 1 year
• 2000 starts per second
• Pay per state transition
@jimmydahlqvist
Intrinsic functions
• Perform basic data manipulation
• 15+ functions
@jimmydahlqvist
Task
• Single Unit of work
• All work is done by tasks
@jimmydahlqvist
Choice
• Controls the flow in the state machine
• Powerful comparison operations
• Support catch all else (Default) path
@jimmydahlqvist
Pass
• State that will just be passed through
• Use when END is not directly supported
@jimmydahlqvist
Wait
• Specified number of seconds
• Timestamp has passed
• Can be a variable in the event
Demo – Online Pizzeria
What are we building
@jimmydahlqvist
Slack webhook – In place
@jimmydahlqvist
Notification Service – In Place
@jimmydahlqvist
Order Service
@jimmydahlqvist
Bake Service
Demo – Online Pizzeria
@jimmydahlqvist
Summary
• Serverless and event-driven architecture
• Event-driven Slack bot
@jimmydahlqvist
@jimmydahlqvist
https://www.linkedin.com/in/dahlqvistjimmy/
https://jimmydqv.com | https://dev.to/jimmydqv
THANK YOU

More Related Content

PPTX
Serverless and event-driven in a world of IoT
PDF
How LEGO.com Accelerates With Serverless
PDF
Building a serverless company on AWS lambda and Serverless framework
PDF
Building Event-driven Architectures with Amazon EventBridge
PDF
Building event driven serverless apps by Danilo Poccia at Codemotion Dubai
PDF
Experiences in Architecting & Implementing Platforms using Serverless.pdf
PDF
The Truth Behind Serverless
PPTX
Event-driven and serverless in the world of IoT
Serverless and event-driven in a world of IoT
How LEGO.com Accelerates With Serverless
Building a serverless company on AWS lambda and Serverless framework
Building Event-driven Architectures with Amazon EventBridge
Building event driven serverless apps by Danilo Poccia at Codemotion Dubai
Experiences in Architecting & Implementing Platforms using Serverless.pdf
The Truth Behind Serverless
Event-driven and serverless in the world of IoT

Similar to Building a serverless event driven Slack Bot (20)

PPTX
The Future of API Management Is Serverless
PPTX
IoT Enabled smoker for Great BBQ
PPTX
aws_com_day_2022_Geethika_v1.0.pptx
PDF
Adding serverless to legacy applications
PPTX
Cloud-grilled delights a high-tech approach to perfect BBQ
PPTX
20 ways event-driven architectures can improve your development - Copy.pptx
PPTX
Why serverless will revolutionize your software process.
PDF
Serverless Meetup - Event Sourcing
PDF
Serverless Design Patterns
PDF
Serverless — it all started in Vegas
PDF
Serverless use cases with AWS Lambda
PDF
Event-driven (serverless) Applications
PDF
Building Event-driven Serverless Apps
POTX
Serverless: State of The Union I AWS Dev Day 2018
PDF
Serverless Architectural Patterns & Best Practices
PDF
Serveless design patterns (VoxxedDays Luxembourg)
PPTX
EventBridge Patterns and real world use case
PDF
Serverless use cases with AWS Lambda - More Serverless Event
PDF
Learning Serverless Design Develop and Deploy with Confidence 1st Edition Jas...
PPTX
Serverlessusecase workshop feb3_v2
The Future of API Management Is Serverless
IoT Enabled smoker for Great BBQ
aws_com_day_2022_Geethika_v1.0.pptx
Adding serverless to legacy applications
Cloud-grilled delights a high-tech approach to perfect BBQ
20 ways event-driven architectures can improve your development - Copy.pptx
Why serverless will revolutionize your software process.
Serverless Meetup - Event Sourcing
Serverless Design Patterns
Serverless — it all started in Vegas
Serverless use cases with AWS Lambda
Event-driven (serverless) Applications
Building Event-driven Serverless Apps
Serverless: State of The Union I AWS Dev Day 2018
Serverless Architectural Patterns & Best Practices
Serveless design patterns (VoxxedDays Luxembourg)
EventBridge Patterns and real world use case
Serverless use cases with AWS Lambda - More Serverless Event
Learning Serverless Design Develop and Deploy with Confidence 1st Edition Jas...
Serverlessusecase workshop feb3_v2
Ad

More from Jimmy Dahlqvist (19)

PPTX
Event-driven and serverless in the world of IoT
PPTX
Building resilient serverless workloads: Navigating through failures
PPTX
Serverless website analytics with Lambda@Edge
PPTX
AWS ECS and AWS Fargate demystified: run serverless containers
PPTX
Building-resilient-serverless-workloads-Navigating-through-failure
PPTX
Serverless website analytics with Lambda@Edge
PPTX
Encrypting data in S3 with Stepfunctions
PPTX
Building a serverless AI powered translation service
PPTX
Serverless cloud architecture patterns
PPTX
AI Powered event-driven translation bot
PPTX
IoT Enabled Smoker for Great BBQ
PPTX
IoT enable smoker for great BBQ
PPTX
Autoscaled Github Runners using StepFunctions
PPTX
re:Invent Recap Breakfast
PPTX
CI/CD As first and last line of defence
PPTX
Introduction to testing in Cloud / AWS
PPTX
CHAOS ENGINEERING – OR LET'S SHAKE THE TREE
PPTX
Road to an asynchronous device registration API
PPTX
GitOps in action, powered by Alexa.
Event-driven and serverless in the world of IoT
Building resilient serverless workloads: Navigating through failures
Serverless website analytics with Lambda@Edge
AWS ECS and AWS Fargate demystified: run serverless containers
Building-resilient-serverless-workloads-Navigating-through-failure
Serverless website analytics with Lambda@Edge
Encrypting data in S3 with Stepfunctions
Building a serverless AI powered translation service
Serverless cloud architecture patterns
AI Powered event-driven translation bot
IoT Enabled Smoker for Great BBQ
IoT enable smoker for great BBQ
Autoscaled Github Runners using StepFunctions
re:Invent Recap Breakfast
CI/CD As first and last line of defence
Introduction to testing in Cloud / AWS
CHAOS ENGINEERING – OR LET'S SHAKE THE TREE
Road to an asynchronous device registration API
GitOps in action, powered by Alexa.
Ad

Recently uploaded (20)

PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Big Data Technologies - Introduction.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Encapsulation theory and applications.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)
sap open course for s4hana steps from ECC to s4
20250228 LYD VKU AI Blended-Learning.pptx
Encapsulation_ Review paper, used for researhc scholars
Big Data Technologies - Introduction.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
MIND Revenue Release Quarter 2 2025 Press Release
Encapsulation theory and applications.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Understanding_Digital_Forensics_Presentation.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Building a serverless event driven Slack Bot

Editor's Notes

  • #2: Welcome so great to see so many people in here today! During the next 40 minutes we are going dive deep into event-driven architecture in a microservice setup. We will look at some of the services that can be used in AWS to build out such a architecture. And we are going to dp a demo and build an event-driven slack bot. My name is Jimmy and this is Building a serverless event driven Slack Bot
  • #3: The agenda for today.
  • #4: As said My name is jimmy. I’m father two girls, not afraid of anything…. Serverless, Ambassador…
  • #5: More and more teams build distributed SW using Micro Services, I’m rather sure that many of you in here is doing that as well. In such a distributed system the services need a way to communicate with each other. Often we do that using synch API and rest calls. This can however post a challenge as the system grows and we have more and more communication paths added. Services start to being more and more couple and need to know about each other. Often we add a Orchestration service like AWS Stepfunctions CLICK
  • #6: Synchronous API integration, let me illustrate that with me telling my children to brush their teeth.
  • #7: Not that bad? But what if we have a downstream service? Asking youngest to also tell the oldest
  • #9: So now I need to find a way to solve this, normally including The Mom….. So using Orchestration, and a service like AWS Stepfunctions can help.
  • #10: In a MS world we often integrate services using synch API. Building loosly coupled services integrating with an well defined API. Start with one not that bad…. Then two….
  • #11: Almost looks like a classic monolith with very tight couplings. Gone is the loosly coupled services that we want.
  • #12: So let’s take a deeper look at this using a made up online Pizzeria. The pizzeria is run by two brothers, Mario and Luigi. Yes they left the plumbing industry and started a pizzeria!
  • #13: Order online
  • #14: Flow Customer Order –> Order Service call the other services! Adding orchestration
  • #15: Downstream error…..
  • #16: NO Pineapple error flow!
  • #17: Error flow! Luigi had introduce a Loyalty service!
  • #19: What is an event!!
  • #20: What do I mean with Observable?
  • #22: No Pinapple error flow! So easy!
  • #24: Extending is easy!
  • #26: Before we jump into our demo and build this pizzeria order flow as an event-driven slack bot, let’s look at the services we will use.
  • #28: Talk about 2 types of patterns, centralized and de-centralized (Single / Mulyi Bus) Single and Multi Account All the patterns allow us to decouple the publisher from the subscriber. The service that publish doesn’t really need to know who is listening in the other end.
  • #29: Look at centralized advantnages and disadvantages Advantages allow you to manage all routiing, security and polciies in one place, single deployment) All routing centralized, concentrating all communication to a single event bus ( Enables central management of resources Allows you to easy integrate applications with few changes. Disadvantages As number of intregrations grow so does the complexity and resource utlilization. Can become a Single point of failure. All routing is centralized…. Prevents autonomy Single point of failure
  • #30: Caresteristics……
  • #31: In all of our patterns we have three services……. Events flow though a central bus. Handle by an infrastructure team (or similar) Easy to manage, easy to get started and easy to integrate new services. But as said before, when ## of integrations grow so does the complexity. Can hinder autonomy since there is a central managed resource, probably managed by infra team.
  • #32: In a decentralized approach routing is spread across multiple event buses and the publisher often becomes the logical owner of that bus. The service owns the mechanism to distribute the events. Even if more buses are more work from a operational approach it enables autonomy and doesn’t become a single point of failure On the other hand, designing distributed systems, managing all resources, can become a huge challenge if not done properly from the start. Applying this as an afterthought is almost impossible. So the time to get started might be longer, integration of new services and applications require more change and take more time.
  • #33: Caresteristics……
  • #34: Now each service own its own bus and publishes to that. Interested services can now subscribe for events in each service that they are interested in. Since we are in single account we can target resources in each service, cross service boundries. No need for extra busses, One thing that can become a problem is thar since there is no central bus, each service need to know about other services buses. This can quickly become a complex integration and onboarding new services can take time. Imagine in a system with10, 20, 100 services that you are interested in events from
  • #36: I normally recommend that you create subscriptions, so each service that is interested in an event creates its own rule, One Rule One target. Yes there is support for 5 targets That would create coupling on filter and not event!
  • #37: When building on eventbridge I would recommend that you create subscriptions. With that I mean that you create one event rule for one target. Even if EB support up to 5 targets per rule I still say this should be a 1-2-1 mapping. Why? If you create one rule with multiple targets you will create a coupling on the event filter. And if you hit the 5 target limit what are you suppose to do then? Create a second rule with the same filter and start adding new targets? What if you need to update the filter? You will impact several targets that might not be what you wanted to do in the first place, leaving you to start breaking things apart again. So instead we create subscriptions where we create the coupling on the event it self, and we set one target for one rule. It’s easy to add more target, just create a second rule and add the target to it. And the filter in every rule can change without affecting any other target. However…. This of course can lead to several rules having the same filter and that could create problems on it’s own. But in my opinion it’s still better to create subscriptions and deal with a rule explosion.
  • #46: Before we jump into our demo and build this pizzeria order flow as an event-driven slack bot, let’s look at the services we will use.