Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Real-Life Experience
Building a chatbot
on Azure Functions
Matti Petrelius @mattipet
I Thought Chatbots
were so 2016 or something...
hi!
Bot Backend API
Scale like crazy! Low Latency!
...you can make us an MVP, right?
Mr. Customer
serverless
Azure
Functions
CosmosdB
Blob+Queue
Storage
3rd party
services
AI Logic
Long-Term
Chat Data (Analysis)
and Logs
Moving mes...
BOT Framework
Azure Functions
✔ Node.js 8 and 10
✔ Cross-platform
Cold start 5 – 10 secs
v1 v2
❌ Node.js 6
❌ Windows only
Cold start 2 –...
MULTIPLE Function apps
aka Microservices
2 sec 2 sec 2 sec
= 6 sec
SINGLE Function APP
aka The Monolith
No BIG SDKS
Node.js app size affects cold start
documentdb 2.04 MB
azure-storage 8.27 MB
unnamed bot sdk 81.89 MB
COSMOSDB MAnual Scaling
400
Throughput (400 – 10,000 RU/s)
Estimated spend (USD): $0.032 hourly / $0.77 daily.
Azure FUnctions cold vs warm start
cold start warm start
Timeout of 5 secs!!!
by the way, our web client requests have a
Number of requests exceeded capacity
400
Throughput (400 – 10,000 RU/s)
Estimated spend (USD): $0.032 hourly / $0.77 daily.
800
Throughput (400 – 10,000 RU/s)
Estimated spend (USD): $0.064 hourly / $1.54 daily.
2000
Throughput (400 – 10,000 RU/s)
Estimated spend (USD): $0.16 hourly / $3.84 daily.
4000
Throughput (400 – 10,000 RU/s)
Estimated spend (USD): $0.32 hourly / $7.68 daily.
= $230.40 monthly
Run- From- Package
Cold-start without:
10 – 20 sec
Cold-start with: 2 – 6 sec
WEBSITE_RUN_FROM_PACKAGE https://mystor.blob...
Disable App Insights ?
One second faster cold-start ... but is it worth more than monitoring?
Azure Functions Premium Plan
Pre-warmed instances for reduced cold start
Significantly more expensive than consumption pla...
CosmosDB Done Right
Automated scaling with SDK
Polling vs Event Based
Optimizing queries
Local development and Debugging
Local development and Debugging
Visual Studio Code
Running in Production
Thanks ya’ll !
Follow me on Twitter for more: @mattipet
Check out my blog: https://lesscodeismore.dev
pictures from freepi...
Real-life experience building a chatbot on Azure Functions
Upcoming SlideShare
Loading in …5
×
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

0

Share

Download to read offline

Real-life experience building a chatbot on Azure Functions

Download to read offline

This was a talk I gave at ServerlessDays Helsinki 2019.

We have been told that chatbots are the future. However it turns out building a chatbot is not as simple as it seems. Serverless is a perfect match for chatbots because it makes them easier to build and experiment with. In this talk I will go through my good and bad experiences in building a chatbot on Azure Functions in a client project.

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all
  • Be the first to like this

Real-life experience building a chatbot on Azure Functions

  1. 1. Real-Life Experience Building a chatbot on Azure Functions Matti Petrelius @mattipet
  2. 2. I Thought Chatbots were so 2016 or something...
  3. 3. hi! Bot Backend API Scale like crazy! Low Latency! ...you can make us an MVP, right? Mr. Customer
  4. 4. serverless
  5. 5. Azure Functions CosmosdB Blob+Queue Storage 3rd party services AI Logic Long-Term Chat Data (Analysis) and Logs Moving messages and integrating services Short-Term Chat State (Live)
  6. 6. BOT Framework
  7. 7. Azure Functions ✔ Node.js 8 and 10 ✔ Cross-platform Cold start 5 – 10 secs v1 v2 ❌ Node.js 6 ❌ Windows only Cold start 2 – 6 secs
  8. 8. MULTIPLE Function apps aka Microservices 2 sec 2 sec 2 sec = 6 sec
  9. 9. SINGLE Function APP aka The Monolith
  10. 10. No BIG SDKS Node.js app size affects cold start documentdb 2.04 MB azure-storage 8.27 MB unnamed bot sdk 81.89 MB
  11. 11. COSMOSDB MAnual Scaling 400 Throughput (400 – 10,000 RU/s) Estimated spend (USD): $0.032 hourly / $0.77 daily.
  12. 12. Azure FUnctions cold vs warm start cold start warm start
  13. 13. Timeout of 5 secs!!! by the way, our web client requests have a
  14. 14. Number of requests exceeded capacity
  15. 15. 400 Throughput (400 – 10,000 RU/s) Estimated spend (USD): $0.032 hourly / $0.77 daily.
  16. 16. 800 Throughput (400 – 10,000 RU/s) Estimated spend (USD): $0.064 hourly / $1.54 daily.
  17. 17. 2000 Throughput (400 – 10,000 RU/s) Estimated spend (USD): $0.16 hourly / $3.84 daily.
  18. 18. 4000 Throughput (400 – 10,000 RU/s) Estimated spend (USD): $0.32 hourly / $7.68 daily. = $230.40 monthly
  19. 19. Run- From- Package Cold-start without: 10 – 20 sec Cold-start with: 2 – 6 sec WEBSITE_RUN_FROM_PACKAGE https://mystor.blob.core.windows.net/deps/pack.zip WEBSITE_RUN_FROM_PACKAGE 1
  20. 20. Disable App Insights ? One second faster cold-start ... but is it worth more than monitoring?
  21. 21. Azure Functions Premium Plan Pre-warmed instances for reduced cold start Significantly more expensive than consumption plan Now in public preview!
  22. 22. CosmosDB Done Right Automated scaling with SDK Polling vs Event Based Optimizing queries
  23. 23. Local development and Debugging
  24. 24. Local development and Debugging Visual Studio Code
  25. 25. Running in Production
  26. 26. Thanks ya’ll ! Follow me on Twitter for more: @mattipet Check out my blog: https://lesscodeismore.dev pictures from freepik.com

This was a talk I gave at ServerlessDays Helsinki 2019. We have been told that chatbots are the future. However it turns out building a chatbot is not as simple as it seems. Serverless is a perfect match for chatbots because it makes them easier to build and experiment with. In this talk I will go through my good and bad experiences in building a chatbot on Azure Functions in a client project.

Views

Total views

225

On Slideshare

0

From embeds

0

Number of embeds

2

Actions

Downloads

2

Shares

0

Comments

0

Likes

0

×