The document discusses building a serverless IoT system to process up to 100K messages per second from IoT devices. It describes using Azure Functions to process messages, SignalR for real-time communication, IoT Hub to handle IoT device connectivity and messaging, and storage for data. Load testing showed that optimizing message processing by packing multiple messages together allowed the system to scale to the requirements using fewer resources and at a lower cost compared to an unoptimized implementation. While instant scaling from 0 to 100 is impossible, the serverless approach provided flexibility and was ultimately seen as cost effective compared to managing infrastructure.
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
300K Messages/Sec IoT Case Study
1. @AlexPshul
Testing 300K messages/sec Lessons
Alex Pshul
@AlexPshul
alex@pshul.com
https://pshul.com
https://codevalue.net
https://www.meetup.com/Code-Digest/
a serverless IoT system case study
2. @AlexPshul
Kids, I’m going to tell you an incredible story
The story of how we created a beautiful IoT serverless system
4. @AlexPshul
About Me
4
Alex Pshul
Architect, Consultant, lecturer & tech freak
More than 9 years of hands on experience
Co-organizer of the Code.Digest Meetup
https://www.meetup.com/Code-Digest/
Talk to me about:
11. @AlexPshul
Requirements
Support edge to cloud messages
Process the messages
Real-time & Near real-time processing
Minimum 4 messages/sec
Maximum 100K messages/sec
Store data for later use
Cloud to device messages
11
17. @AlexPshul
Azure Functions
Easy to start & deploy
Cost efficient
Scalable
Very Flexible
Locally (For debug)
As a Serverless cloud solution
In an AppService/Premium solutions
As a container
Easy microservices implementation
17
18. @AlexPshul
SignalR as a Service
Extreme realtime messaging
Two way communication
Scalable
Free tier for development
Can be run as a library
18
20. @AlexPshul
Azure Storage Tables
Good integration
Scales
Data price = Today + Previous days
Still, Crazy Cheap!
API matches CosmosDB
Write to both – For long and short term storage
20
21. @AlexPshul
Azure Event Hub
Messages between services
High throughput scalable units
Pay-for-use
Easy integration with Azure services
And Apache Kafka
21
24. @AlexPshul
IoT Edge
The “edge” of the cloud reach
Runs on the device
Easy OTA services
Version updates
Installations
Provisioning
Runs containers
Cloud Communication
24
25. @AlexPshul
IoT Hub + IoT Edge
Flexible Updates
Locally
Remotely to a large amount of devices
Variety of tiers
By features
By throughput
Units for scaling
Easy two way communication
25
28. @AlexPshul
Cloud “Magic” – Store Data
2828
Icon made by Freepik from www.flaticon.com
IoT Message
Functions
SignalR
Event Hub IoT Hub IoT Edge
Storage
29. @AlexPshul
Cloud “Magic” – Show Data
2929
Icon made by Freepik from www.flaticon.com
Functions
SignalR
Event Hub IoT Hub IoT Edge
Storage
30. @AlexPshul
Cloud “Magic” – Live Data
3030
Icon made by Freepik from www.flaticon.com
Live Data
Functions
SignalR
Event Hub IoT Hub IoT Edge
Storage
31. @AlexPshul
Cloud “Magic” – Update a Device
3131
Icon made by Freepik from www.flaticon.com
Update
Device
Functions
SignalR
Event Hub IoT Hub IoT Edge
Storage
44. @AlexPshul
0 100 Instant Scale is Impossible
44
Non HTTP - scales once every 30 seconds
20,000 Entities per second
Partitions # influence the functions scale
45. @AlexPshul
0 100 Instant Scale is Impossible
45
Use Premium/AppService plan or convert to containers
Use multiple storage accounts
Trial and error to see optimal configuration
48. @AlexPshul
Would I go serverless again?
Flexible
React to request changes
Different deploy options
Cheap
Neglectable while developing
Cheap in production
If used properly
Easy to deploy
Easy to debug
48