public v1 real world example of azure functions serverless conf london 2016
TRANSCRIPT
![Page 1: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/1.jpg)
Azure Functions Real World Examples
Serverless Conf - London 2016Yochay Kiriaty
Serverless Patterns and Best Practices
![Page 2: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/2.jpg)
Yochay KiriatyPrincipal Program Manager @ MicrosoftAzure / App Service Tech Evangelist Various Start Ups
https://blogs.msdn.microsoft.com/appserviceteam@[email protected]
![Page 3: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/3.jpg)
Agenda• Why Serverless?• Serverless patterns / Real-world examples
![Page 4: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/4.jpg)
Event-driven/ instant scale
Sub-second billing
Abstraction of
servers
What is Serverless?
![Page 5: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/5.jpg)
Focus on Business
LogicReduced Time To Market
Reduced DevOps
Benefits of Serverless?
![Page 6: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/6.jpg)
CSV ?
So many options, where do I start?
![Page 7: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/7.jpg)
Microsoft Serverless Services
Cortana Management Suite
Media ServicesStorage Traffic Manager
Visual StudioServices
OMS Management SuitMachine LearningCDNDocument DB
Search
SchedulerActive Directory Key Vault App Insights Cognitive Services Embedded Power BI
Hockey AppStream AnalyticsNotification HubIoT Hub Service Bus
Functions Logic App
![Page 8: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/8.jpg)
Functions Programming ModelTrigger(data) Input Input
code
Output
OutputInput
Yochay to update to node.js example
![Page 9: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/9.jpg)
Serverless Patterns
![Page 10: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/10.jpg)
File added toBlob Storage
Transform CSV to datarows Power BIChart graphic
Scenario Azure service event processing
![Page 11: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/11.jpg)
Tasks/ Activities Protect against
API DDOS Dynamically
configure CloudFlare (Block IP)
Source: https://www.troyhunt.com/azure-functions-in-practice/
![Page 12: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/12.jpg)
Block IP
Q msgIP 2 block
Blob Replication
DDOS
Site
Source: https://www.troyhunt.com/azure-functions-in-practice/
![Page 13: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/13.jpg)
Tasks/ Activities Protect against
API DDOS Dynamically
configure CloudFlare (Block IP)
Source: https://www.troyhunt.com/azure-functions-in-practice/
Before ServerlessSetup a VM/
Container/ WebJobsBuild/ patch/ deploy
(OS)Monitor infra (VM/
Container)Use Azure SDKManage CloudFlare
credsUse CLoudFlare API
Using ServerlessSetup a VM/
Container/ WebJobsBuild/ patch/ deploy
(OS)Monitor infra (VM/
Container)Use Azure SDKManage CloudFlare
credsUse CLoudFlare API
![Page 14: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/14.jpg)
Functions Programming Model - Best Practices
• Functions should “do one thing”
1
![Page 15: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/15.jpg)
Every 15 minutes Clean tableFind and clean invalid data
Scenario Timer based processing
![Page 16: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/16.jpg)
Tasks/ Activities Replicate logs
from one data center to another
Analyze the logsTake action
based on data
![Page 17: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/17.jpg)
FTP Download Function
Blob Replication
Blob Storage Cold Storage
Abnormal behavior
Stream analytics
![Page 18: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/18.jpg)
Before ServerlessSetup a VM/
Container/ WebJobsBuild/ patch/ deploy
(OS)Monitor infra (VM/
Container)Manage FTP credsUse FTP libraryUse Azure SDK
Tasks/ Activities Replicate logs
from one data center to another
Analyze the logsTake action
based on data
Using ServerlessSetup a VM/ Container/
WebJobsBuild/ patch/ deploy
(OS)Monitor infra (VM/
Container)Manage FTP creds, but
with automation with dynamic settings
Use FTP libraryUse Azure SDK
![Page 19: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/19.jpg)
FTP Download Function
Blob Replication
Blob Storage Cool Storage
Abnormal behavior
![Page 20: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/20.jpg)
Blob Replication
Blob Storage Cold Storage
Abnormal behavior
FTP Download Manager Function
Single Folder Single Folder Single Folder
![Page 21: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/21.jpg)
Functions Programming Model - Best Practices
• Functions should finish as quickly as possible
![Page 22: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/22.jpg)
Millionsof devices feedinto Stream Analytics
Store data inSQL Online
Transform to structured data
Scenario Real-time stream processing
![Page 23: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/23.jpg)
Tasks/ Activities Collect tweetsAnalyze tweetsDisplay rich
analysis
![Page 24: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/24.jpg)
Collect Tweets
Logic App
Analyze Tweets
Store Data
Store Data
![Page 25: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/25.jpg)
Tasks/ Activities Collect tweetsAnalyze tweetsDisplay rich
analysis
Before ServerlessSetup a VM/ Container/
WebJobsBuild/ patch/ deploy
(OS)Monitor infraConnect (auth)to
twitter Using Twitter API (SDK)Analyze tweetsBuild rich client to
show results
Using ServerlessSetup a VM/ Container/
WebJobsBuild/ patch/ deploy
(OS)Monitor infraConnect (auth)to
twitter Using Twitter API (SDK)Analyze tweetsBuild rich client to
show results
![Page 26: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/26.jpg)
Functions Programming Model - Best Practices
• Functions should be stateless• Functions should be idempotent
![Page 27: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/27.jpg)
Using digital insights to optimize transactions in the real world
Plexure
![Page 28: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/28.jpg)
![Page 29: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/29.jpg)
EVENT SWARM ENGAGEMENT CHANNELS
FLEXIBLE BIG DATA PIPELINE
INTELLIGENCE PIPELINE
3RD PARTY
EVENT INGESTION ENGINE
SQL DATA WAREHOUSE
DATA LAKE STORAGE & ANALYTICS
STREAMANALYTICS
WEBCUSTOM
SERVICES
WEARABLES
POS
DIGITAL DISPLAYS
BOTS
KIOSKS
MOBILE APP
SENSORS
OMNI CHANNEL ENGAGEMENT
WORKFLOW ORCHESTRATION
ENTERPRISE INTEGRATION
CUSTOM INTELLIGENCE
INTELLIGENTSERVICES
CUSTOMFUNCTIONS
MACHINELEARNING
COGNITIVESERVICES
EXISTING
NEW
API GATEWAY
API GATEWAY
![Page 30: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/30.jpg)
Event-driven/ instant scale
Sub-second billing
Abstraction of
servers
What is Serverless?
![Page 31: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/31.jpg)
Functions Programming Model - Best Practices
• Functions should “do one thing”• Functions should finish as quickly as possible• Functions should be stateless• Functions should be idempotent
1
![Page 32: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/32.jpg)
Building Serverless Apps With Azure FunctionsInstead of …• pulling –> triggers • ‘SDK’ –> bindings• routes in a Web App (server) –> single function• writing large functional tests against a server –> functional
tests look more like unit tests per function.• building and deploying servers –> deploy collections of
Functions
![Page 33: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/33.jpg)
• Thick clients & stateless backends• Statless Scale• SPA (Angular /React) are your friend (enable CORS )
• Sync works, but Async rocks! • Async Scale• Async, queue based systems are more resilient• Read and internalize the reactive manifesto - http://www.reactivemanifesto.org/
• Live and die by the cloud• Develop on the cloud, test on the cloud, ship on the cloud• Lots of different services • Not just FaaS, but use other serverless tech that best solves the problem (like
Logic Apps)
Serverless Architecture- Best Practices
![Page 34: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/34.jpg)
Microsoft and ServerlessTry Functions – https://functions.azure.comTry App Service – https://tryappservice.azure.com
![Page 35: Public v1 real world example of azure functions serverless conf london 2016](https://reader030.vdocuments.us/reader030/viewer/2022012914/586fb5db1a28abe57d8b771f/html5/thumbnails/35.jpg)