Topics Covered Lecture 2: Potential of Internet of Things (IOT) and Its Architecture and Infrastructure • Understand the potential case studies of IOT • Understand the architecture and infrastructure of IOT Potential Scenarios of IOT Infrastructure Potential Scenarios of IOT Infrastructure Mini Quiz • Any differences between the previous 2 images? • Which one is better or are they equal? • Any business consideration? What do your C-level managers say? • Do you need to share data? • Is it allowed to share data? (By the company or by the government?) • Different opinions: CEO wanna share data, but the CTO doesn’t want it Hints • Do you need all the use cases to talk to each other? • Do you need all the use cases to subscribe data from each other? • Give example scenario where sharing platform is plausible: • When all use cases are owned by the same company • When there’s agreement to sell data to 3rd party – may need to anonymize the data • When there are no private/personal data used • When there is Intellectual Property Protection: Businesses sharing a workspace establish guidelines for protecting confidential information, trade secrets IOT Architecture IOT Architecture: What would happen in one transaction? 1. Microservice based architecture a.k.a. REST API based services a.k.a. stateless communication 2. Sensor sends message using MQTT to IOT platform 3. The message arrives at Message Broker that checks that the message is authorized and has valid authentication creds using the Broker Auth Service 4. Message Broker transforms the message to AMQP and sends it to Event Consumer Service 5. Event Consumer Service queries device spec from Device Admin Service and transforms it into a universal format, then sends it to Scene Evaluation Engine IOT Architecture: What would happen? 6. Scene Evaluation Engine retrieves the rules associated with this message type. If an external API needs to be called, that request would be sent to External Services Module (which would interact with that external API) 7. Scene Evaluation Engine will also evaluate whether it needs to send a message to the same or another device within the IoT network. To do that, an outbound message (action request) is sent to the Device Interaction Engine 8. Device Interaction Engine then requests the device-specific info from Device Admin Service and customizes the outward message based on it IOT Architecture: What would happen? 9. Device Interaction Engine sends the message to the Message Broker, which then sends the message to the device over the network PS: • For certain devices, Protocol Converter Service may be needed to convert from MQTT to and from the device-specific protocol that the device uses • For rules that are triggered by scheduling rather than when an inbound message arrives, Schedule Management Service will execute the rule Mini Quiz 1. What are the available message broker software out there? 2. Which one do you think is the best? 3. Compare in terms of specs e.g. max transactions per second, capacity, pricing, ease of configuration, etc 4. Compile in a comparison matrix and submit here: https://forms.gle/4QbjxhuUjyUmqKNK8 IOT Architecture: Microservices Mini Quiz: 1. Anything wrong with the previous architecture? Potential Problem & Possible Improvement 1. Take a look at the 'REST' all over the place. Most microservices are RESTful. What's the problem? Risk of blocking implementation; for every HTTP request, a thread is assigned & the thread is held for the whole lifecycle of the request a.k.a. limiting the number of concurrent requests (but not a problem if there are only 500–1000 concurrent users) 2. Possible solution: • Use the Message Broker for communication between individual microservices • Use non-blocking approach; subsequent calls to different classes/methods & external systems to run in a separate thread, hence letting the current thread to do other tasks or return to the container pool IOT Business Architecture Mini Quiz: 1. Any idea about IOT bundling? Pricing per unit? 2. Who owns the data? Platform? Each tenant? Customer's consent? Country's regulation? 3. Can the data be "monetized"? Any terms and conditions to any party involved? IOT Platform Software Stack: Open Source-driven So what's up w/ open-source driven? 1. Easy to modify 2. Scalable 3. Upgradeable 4. Future proof (no vendor lock-in) IOT Container Deployment on AWS: Max Capacity 10k TPS How much does IOT platform cost? 1. Devices (preferably support MQTT & JSON): • Device price varies subject to type • Integration/installation fee was found about USD50k (may be waived for large deployment) 2. Estimated input load: 5,000 TPS from all tenants in 6 countries. Rule of thumb: roughly 200 TPS per less than 7 millions population (Ref: Managing & Assessing NaaS Capacity for Telecommunication Sector on medium.com - also written by me) 3. 5,000 TPS costs USD50k/year on AWS (incl. hardware, storage, & analytics cluster) 4. New IOT solution varies subject to complexity, no of devices, coverage area, etc 5. New analytics capability costs could be similar to existing i.e. 2-6 weeks of dev 6. New GUI app may cost 8-12 weeks of dev 7. Connection cost i.e. Wired, 5G, Sigfox, satellite. Quite vary 8. New solution's scenes: subject to complexity design, but implementation could be less than 5 mins 9. Overall time cost for new solution: 3-4 months (including testing) Cost Minimization possible? 1. Dockerization on AWS: • It uses resources efficiently e.g. no duplicating of OS functions, thus... • It pays only for what it uses 2. REST-dominated comm is quite burdening (HTTP-based), however still capable (10k TPS were successfully tested) - But may replace it with a more scalable message broker (is RabbitMQ the best?) 3. Smart anticipation: Build a generic solution blueprint to use as skeleton THANK YOU!