IoT Analytics Modules 3–4
JIIT Noida · IoT Analytics · Dr. Vikash · Modules 3 & 4

IoT analytics in the cloud, from sensor to insight

Expanded notes for Module 3 (IoT Analytics in Cloud Environments) and Module 4 (Data Collection, Processing and Exploration). Every topic carries its exam keywords, the slide figures are included (tap any figure to enlarge), and a practice set with model answers sits at the end.

27 topics21 slide figures0 MCQs0 long-answer questions0 glossary terms
Jump to a section
03

IoT Analytics in Cloud Environments

3.1Why cloud for IoT analytics

IoT deployments produce data that is massive in volume, heterogeneous (temperature floats, GPS traces, images, logs), real-time and geographically distributed. Sizing an on-premises data centre for this is hard: you would have to buy for the peak load and leave it idle most of the time. The cloud gives scalable, flexible and cost-effective infrastructure plus ready-made analytics tools.

BenefitWhat it means for IoT analytics
Scalability & elasticityCapacity grows and shrinks with the data stream, so you avoid over-provisioning local servers for peak traffic.
Cost efficiency (pay-as-you-go)Pay only for the compute and storage actually consumed. Capital expense (buying servers) becomes operational expense.
Variety of servicesStorage, compute, machine learning, visualisation and messaging are all available as managed services.
Security & complianceBuilt-in encryption, identity management and audit, essential for sensitive domains like healthcare and smart cities.
AgilityRapid experimentation and faster time-to-market: spin up a cluster in minutes, throw it away when done.

Worked example: talking to a Mars rover replica

The slide shows an AWS application that retrieves IoT data (temperature on Mars) through voice. It touches voice recognition, speech generation, storage, device interaction, networking, security and messaging in one flow:

Fig 3.1 Voice-driven IoT request flow on AWS (Module 3 slide 4).
  1. IoT device → AWS IoTThe user asks for the temperature on Mars through an IoT device; AWS IoT receives the request securely.
  2. AWS Lambda → Amazon LexA Lambda function passes the request to Lex, the conversational (chatbot) service.
  3. Lex recognises the intentLex identifies the intent "get temperature on Mars".
  4. Lex asks a follow-up"Celsius or Fahrenheit?" A slot is filled through dialogue.
  5. Lambda queries DynamoDBA second Lambda fetches the reading from the NoSQL database; it can also call SNS/SES to send a text or email.
  6. Lex responds, Polly speaks"Mars is minus 125 degrees Celsius." Amazon Polly converts the text to natural speech. CloudWatch records logs and metrics throughout.
Keywordsover-provisioningpay-as-you-goelasticityheterogeneous dataLexPollyDynamoDBSNS/SESCloudWatch

3.2Elastic analytics concepts

Definition

Elastic analytics is the ability of a data analytics system to dynamically scale up or down its computing and storage resources based on demand, giving performance, cost-efficiency and adaptability for fluctuating workloads.

Scaling comes in two flavours. Vertical scaling (scale up) gives one machine more CPU or RAM. Horizontal scaling (scale out) adds more machines; this is what distributed IoT analytics relies on. The five design principles from the slides:

PrincipleExplanation
Separate compute from storageKeep data in elastic object storage (AWS S3, Azure Blob Storage) that grows with the stream. Compute clusters can be started, resized or destroyed without touching the data. No pre-purchased fixed storage capacity.
Build for scale from the startDesign code and services so they handle one user or a million without a rewrite: stateless services, partitioned data, queues between stages.
Make your bottleneck wetware, not hardware"Wetware" means the human brain. The limiting factor should be your thinking, never "my laptop doesn't have enough memory to run the job". If a job needs 500 GB of RAM, rent it for an hour.
Manage to a spend budget, not to available hardwareThe constraint is money, not a fixed rack of servers. Expand when needed, contract quickly to stay efficient.
Experiment, experiment, experimentSpin up resources, terminate failures, iterate towards the right solution, then scale up or down as needed. Failed experiments cost little.
Keywordselastic analyticsscale up / scale outcompute–storage separationwetwarespend budget

3.3Traditional distributed computing

Definition

Distributed computing is a paradigm where a collection of interconnected computers share resources, divide tasks and work together to solve problems or process data as a unified system. It is also called cluster computing.

  • Each computer in the cluster is a node. A cluster can be a few nodes or thousands.
  • The framework (Hadoop, Spark) handles orchestration: splitting work, scheduling tasks on nodes, moving data and retrying failures.
  • To the programmer it appears as one system; the distribution is hidden "under the covers".

When a single server is the better choice

Distribution carries a complexity cost. Even with frameworks doing the heavy lifting, you still have to design your analytics to work across multiple nodes (data partitioning, network shuffles, partial failures). Keep it simple and use one server when:

Use a single server
  • Not much need for scale
  • Small data instead of big data
  • Resource needs are minimal
Use distributed computing
  • Data exceeds one machine's memory or disk
  • Job runtime must drop through parallelism
  • Fault tolerance is required
Keywordscluster computingnodeorchestrationcomplexity costunified system

3.4Cloud security and analytics

The rapid growth of IoT devices demands robust cloud security. Cloud platforms enable scale but also introduce new vulnerabilities: every device is an entry point, and data travels over public networks. Security analytics (analysing logs, traffic and behaviour) enables proactive threat detection, catching anomalies before they become breaches.

What is cloud security in IoT?

Protection of data, devices and communication in cloud-integrated IoT systems, using encryption, authentication, access control and secure APIs.

Key threats in IoT cloud environments

ThreatIoT exampleMitigation
Data breachesHealth-monitor readings exposed from a misconfigured public bucketEncryption at rest, private buckets, least-privilege IAM
Denial-of-service (DoS)Thousands of compromised cameras flooding an endpoint (botnet / DDoS)Rate limiting, AWS Shield / WAF, auto scaling
Malware and ransomwareDevice firmware infected; stored data encrypted and held for ransomSigned firmware updates, backups, patching, network segmentation
Unauthorized accessDefault or shared credentials used to log in to a gatewayNamed accounts, key-based auth, MFA, security groups
Keywordssecurity analyticsproactive threat detectionencryptionauthenticationaccess controlsecure APIsDoSransomware

3.5Public/private key cryptography in cloud and IoT

Asymmetric encryption uses a key pair: a public key that is shared freely and a private key kept secret. Whatever the public key encrypts, only the matching private key can decrypt. That is why distributing the public key widely poses no security risk.

Symmetric

One shared secret key encrypts and decrypts (e.g. AES). Fast, but the key must somehow reach both parties safely.

Asymmetric

Public key encrypts, private key decrypts (e.g. RSA, ECC). Solves key distribution; slower, so it is often used to exchange a symmetric session key.

  • Cloud providers rely on this model to secure communications. It underpins SSL/TLS, the protocol behind HTTPS websites.
  • In IoT analytics, key pairs act as a stronger version of username/password authentication: an EC2 login uses an SSH key pair, and an AWS IoT device authenticates with an X.509 certificate and its private key.
  • The scheme is proven, robust and widely trusted in cloud environments.
Keywordsasymmetric encryptionkey pairSSL/TLSHTTPSSSH keyX.509 certificate

3.6Public vs private subnets

Subnets are logical segments of a cloud network (an IP range carved out of the VPC) where resources are deployed.

Public subnetPrivate subnet
Internet reachabilityReachable from the internet, but only if the resource has a public IPNo direct internet access
Route to internetRoute table points 0.0.0.0/0 to an Internet GatewayOutbound traffic goes through a NAT gateway placed in a public subnet
Typical residentsWeb servers, load balancers, bastion hostsDatabases, analytics engines, Spark/Hadoop clusters

For security, most analytics workloads should run in private subnets, even though this adds complexity (NAT, bastion hosts, VPN for access). Always identify and manage your subnet types carefully to prevent unauthorized access.

Keywordssubnetpublic IPNAT gatewayinternet gatewayroute table

3.7Access restrictions in IoT analytics

  • Use named user accounts. Avoid shared credentials so every action is traceable to a person: accountability.
  • Protect private keys when using public/private key authentication. A leaked private key equals a leaked password.
  • Restrict network traffic to only what is necessary and block everything else by default (default deny).
  • Start with a locked-down environment, then selectively open access as needed. This is the principle of least privilege.
  • In distributed computing, misconfigured network or security settings are a common cause of analytic failures (nodes cannot reach each other), so apply best practices from the outset.
Keywordsnamed accountsleast privilegedefault denylocked-down environment

3.8Securing customer data

IoT data is sensitive and can reveal personal insights (when you are home, your heart rate, where you drive). It must be protected with strong access controls and encryption, and failing to secure it creates legal risk under data-protection laws.

Encryption in transit

Protects data while it moves across the network, e.g. SSL/TLS between device, gateway and cloud.

Encryption at rest

Protects stored data on servers, disks and databases, e.g. S3 server-side encryption, encrypted EBS volumes, AWS KMS keys.

  • Use public/private key pairs for seamless encryption, especially when data is widely accessible.
  • If data is tightly controlled and stored in a private subnet, encryption can be relaxed slightly, but only when the risk is minimal.
  • Best practice: always encrypt when possible, especially data exposed to the public internet.
  • Cloud platforms offer built-in security features; leverage them fully.
Keywordsin transitat restlegal riskKMS

3.9Amazon Web Services

  • AWS is the dominant global cloud provider. The slide dates its launch to 2005.
  • Ranked #1 in Gartner's Magic Quadrant for cloud infrastructure.
  • As of 2016, AWS had about 10× the compute capacity of its 14 closest competitors combined.
  • Netflix and Airbnb run their operations on AWS.
  • Market share: AWS about 30%. The text slide gives the nearest rival at 9% (older figure); the Q2 2025 chart shows Azure 20% and Google Cloud 13%.
Fig 3.2 Cloud infrastructure market share, Q2 2025 (Synergy Research Group). Total market $99B, up 25% year on year. Includes IaaS, PaaS and hosted private cloud.
Fig 3.3 AWS service catalogue by category. For this course, focus on Compute (EC2, Lambda, VPC, Auto Scaling), Storage (S3), Database (DynamoDB, Redshift), Analytics (Athena, EMR, Kinesis, Glue, QuickSight), Security (IAM, KMS), Management (CloudFormation, CloudWatch) and IoT (AWS IoT, Greengrass).

Global infrastructure

ConceptMeaning
RegionA geographic area (e.g. Mumbai, ap-south-1) containing one or more data centres, designed for low latency to nearby users. Data stays in the region you choose.
Availability Zone (AZ)An isolated data centre (or group of them) inside a region with independent power and networking. Spreading resources across AZs gives high availability and fault tolerance: the application keeps running if one zone fails.
Global networkHigh-speed private fibre connecting AWS data centres worldwide.
Keywordsregionavailability zonefault tolerancehigh availabilityGartner Magic Quadrant

3.10Virtual Private Cloud (VPC)

Definition

A VPC is a logically isolated section of a public cloud where you launch resources in a virtual network you define. It gives control over networking: IP ranges, subnets, route tables, gateways and security settings.

  • Isolation: your VPC is private to your account even though it runs on shared infrastructure.
  • Subnets: public (web servers) and private (databases, analytics engines).
  • Security controls: Network ACLs and Security Groups.
Fig 3.4 A VPC spans a region; each subnet lives in one Availability Zone; the Internet Gateway is the VPC's door to the internet.
Security GroupNetwork ACL
LevelInstance (network interface)Subnet
StateStateful: return traffic is automatically allowedStateless: return traffic needs its own rule
RulesAllow rules onlyAllow and deny rules
EvaluationAll rules evaluated togetherNumbered rules, lowest number first
AnalogyFirewall on each serverCheckpoint at the subnet boundary
Keywordslogical isolationCIDRroute tablesecurity groupNACLstateful / stateless

3.11Identity & Access Management (IAM)

Definition

IAM provides secure access control to AWS resources. You manage users, groups, roles and permissions so that only authorized identities can access specific services or data.

Fig 3.5 IAM = identities (who is asking) + permissions (what they may do). Permissions are written as policies, and each policy contains statements.
IdentityWhat it isIoT analytics example
UserA person or application with long-term credentialsData analyst "priya" who logs into the console
GroupA collection of users sharing the same policies"DataScientists" group with read access to the sensor bucket
RoleAn identity assumed temporarily; issues temporary credentials, no passwordA Lambda execution role allowed to write to DynamoDB
CredentialsPassword, access keys, MFA deviceAccess key used by a gateway script
Fig 3.6 IAM in one sentence: who can access what, decided by policies. It applies fine-grained permissions to AWS services and resources.

A policy, statement by statement

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:ListBucket"],
      "Resource": [
        "arn:aws:s3:::iot-sensor-data",
        "arn:aws:s3:::iot-sensor-data/*"
      ]
    }
  ]
}

Each statement has an Effect (Allow/Deny), Action (API calls), Resource (ARNs) and optionally a Condition. Evaluation rule: everything is implicitly denied by default, an explicit Allow grants access, and an explicit Deny always wins.

Keywordsusersgroupsrolespoliciesstatementstemporary credentialsexplicit denyARN

3.12Elastic Compute Cloud (EC2)

Definition

A scalable compute service to launch and manage virtual servers (instances) for hosting applications, analytics and data pipelines. It is the backbone for running scalable IoT analytics workloads.

  • Choose the memory, storage and CPU you need (the instance type), and stop the instance when done so you stop paying for compute.
  • Instances boot from an AMI (Amazon Machine Image) and you log in with a key pair.
  • Secure, reliable, high-performance and cost-effective; deploy applications without managing physical hardware.
  • Secure instances with VPC, subnets and security groups.
  • Attach Auto Scaling to add or remove instances automatically based on demand or traffic.
  • Pricing models: On-Demand, Reserved/Savings Plans (cheaper for steady load) and Spot (very cheap, can be reclaimed; good for batch analytics).
Keywordsinstanceinstance typeAMIkey pairAuto ScalingSpot

3.13Simple Storage Service (S3)

Definition

A highly durable, scalable and cost-effective object storage service used for IoT data, logs, datasets and backups. It integrates with analytics and ML tools (Athena, EMR, Redshift, SageMaker) to process stored data.

Fig 3.7 Users upload and download objects to an S3 bucket over the internet (HTTPS API).
  • Bucket: top-level container with a globally unique name. Object: the file plus metadata. Key: the object's name/path.
  • Designed for 99.999999999% (eleven nines) durability; single objects up to 5 TB; virtually unlimited total storage.
  • Storage classes trade cost against access speed: Standard, Infrequent Access, Glacier for archives.
  • S3 is the usual data lake for IoT: raw readings land here and are queried later with Athena or processed with EMR/Spark.
Keywordsobject storagebucketobject keydurabilitydata lakestorage class

3.14Microsoft Azure

Definition (slide)

Azure cloud offers solutions that integrate with business data, illustrated through a Quality Management System. Its pitch is integration at both the infrastructure and application level: "our solutions are not islands".

Azure Analysis Services

  • Built on Microsoft SQL Server Analysis Services (SSAS); compatible with SQL Server 2016 Analysis Services Enterprise Edition.
  • Supports tabular models (in-memory semantic data models used by BI tools).
  • Functionality: DirectQuery (query the source live instead of importing data), partitions (process large tables in pieces), row-level security (users see only their rows), bidirectional relationships (filters flow both ways between tables) and translations (model metadata in multiple languages).
  • Use the same tools as SSAS: build and deploy tabular models with SQL Server Data Tools (SSDT) or Azure templates in SQL Server Management Studio (SSMS).

Case study: Modus Consulting, ProcessFrame

SituationA quality management system must pull data from ERP (enterprise resource planning) and CRM (customer relationship management) systems, push data back to BI tools, and simplify secure authentication and user management.
SolutionAzure Hybrid Connections: scheduled CSV import/export, access to SQL Server views and input/output web services, letting ProcessFrame offer integration. Azure Active Directory (now Microsoft Entra ID) gives transparent user management and single sign-on, even when ProcessFrame runs in remote cloud infrastructure.
BenefitsIntegration as smooth as an on-premises install; cloud solution and security for Modus customers without traditional hardware costs.
KeywordsSSAStabular modelDirectQueryrow-level securitySSDT / SSMSHybrid ConnectionsAzure ADSSOERP / CRM

3.15ThingWorx (PTC)

ThingWorx is developed by PTC (Parametric Technology Corporation). It is a purpose-built IIoT (industrial IoT) platform for rapidly developing and deploying connected applications.

ThingWorx Core

Central platform that manages IoT applications, models and data.

Connection Services

Connectivity between devices and the platform; handles protocols and adapters.

ThingWorx Edge

Lightweight runtime on devices to communicate with the platform.

Key concepts (the ThingWorx data model)

ConceptMeaningExample
Thing TemplateBlueprint defining properties, services and behaviours of a "thing""CNCMachineTemplate"
ThingInstance created from a template; represents a real device"CNC_Line3_Unit7"
PropertyAttribute of a Thingtemperature, status
ServiceFunction the Thing can performresetDevice, updateConfig
EventNotification triggered by a change or conditionOverTemperature alert
Thing Shape / Data ShapeReusable sets of attributes / data structuresA "Vibration" shape reused by many machines
EntityAny logical building block of a ThingWorx applicationThings, templates, mashups, users

Why ThingWorx for IoT analytics: rapid drag-and-drop application development; integration with industrial protocols (OPC, MQTT, REST APIs); real-time dashboards (mashups); scalable for IIoT; built-in machine learning and predictive analytics extensions.

Connection Services: integrating AWS IoT with ThingWorx

Fig 3.8 AWS IoT ↔ ThingWorx integration through Connection Services.
  1. Device publishesThe AWS IoT Edge SDK (Node.js) publishes state to the MQTT topic $aws/things/{thingName}/shadow/update.
  2. Broker and Device ShadowThe AWS IoT MQTT broker updates the Device Shadow, a JSON copy of the device's last known state, and replies on /accepted, /rejected or /delta.
  3. Rule Engine → KinesisAn IoT rule (select … from $aws/things/+/shadow/update/accepted) forwards accepted updates into a Kinesis stream.
  4. Adapter → CoreThe ThingWorx Connection Server's AWS IoT Adapter reads the stream and calls UpdateSubscribedPropertyValues on the matching AwsIotThing in ThingWorx Core.
  5. Writes flow backReadProperty/WriteProperty from ThingWorx update the Device Shadow; the device receives the change on the delta topic.
KeywordsPTCIIoTThing TemplateThing ShapeData ShapeEdgeConnection ServerDevice ShadowMQTTOPC

3.16AWS CloudFormation

Definition

CloudFormation is an Infrastructure as Code (IaC) service to model, provision and manage AWS resources automatically, so you spend less time managing resources and more on your applications. It can simplify infrastructure management, quickly replicate infrastructure (dev, test, prod, other regions) and control and track changes (templates live in version control).

Fig 3.9 How it works: write template (YAML/JSON) → store locally or in S3 → create stack via console, CLI or API → CloudFormation provisions and configures the resources.
Fig 3.10 CloudFormation for IoT analytics: one template → one stack → VPC (networking), EC2 cluster (processing), S3 (storage) → Kinesis / EMR / Redshift (analytics).
TemplateStack
WhatBlueprint file (JSON or YAML) defining infrastructure and configurationRunning instance of a template: the actual set of AWS resources
AnalogyArchitectural planThe building constructed from the plan
NatureStatic: a definition, not deployedDynamic: live infrastructure

Structure of a template

SectionRequired?Purpose
Format VersionOptionalVersion of the template language (2010-09-09)
DescriptionOptionalHuman-readable notes
MetadataOptionalExtra data to guide deployment tools
ParametersOptionalInputs to customise resources (e.g. instance type)
MappingsOptionalKey-value maps for region- or environment-specific values (e.g. AMI ID per region)
ConditionsOptionalLogic controlling resource creation (only create RDS in production)
ResourcesMandatoryThe AWS resources to create (EC2, S3, IAM…)
OutputsOptionalValues returned after creation (load balancer URL, VPC ID)
AWSTemplateFormatVersion: "2010-09-09"
Description: IoT analytics base network and sensor data lake
Parameters:
  EnvName:
    Type: String
    Default: dev
Resources:
  AnalyticsVPC:
    Type: AWS::EC2::VPC
    Properties:
      CidrBlock: 172.31.0.0/16
      EnableDnsSupport: true
      EnableDnsHostnames: true
  PrivateSubnetA:
    Type: AWS::EC2::Subnet
    Properties:
      VpcId: !Ref AnalyticsVPC
      CidrBlock: 172.31.0.0/20
      AvailabilityZone: ap-south-1a
  SensorDataBucket:
    Type: AWS::S3::Bucket
    Properties:
      BucketName: !Sub "iot-sensor-${EnvName}-${AWS::AccountId}"
Outputs:
  VpcId:
    Value: !Ref AnalyticsVPC

Stack lifecycle

  • Creation: launching a stack provisions every resource in the template, in dependency order. If anything fails, it rolls back.
  • Update: change the template; CloudFormation works out what to add, modify or delete (preview it with a change set).
  • Deletion: deleting the stack removes all its resources.
  • Drift detection: checks whether resources were changed manually outside CloudFormation.
KeywordsInfrastructure as CodetemplatestackResources (mandatory)ParametersMappingsConditionsOutputsdrift detectionchange set

3.17Creating an AWS cloud analytics environment: VPC setup

Fig 3.11 Hierarchy: Account → Region (Mumbai) → VPC 172.31.0.0/16 → AZ → Subnet. Subnet 1 = 172.31.0.0/20, Subnet 2 = 172.31.16.0/20, each with 4091 usable addresses.
  1. Create the VPC and define its IP range (pool)Set the boundary with a CIDR block, e.g. 172.31.0.0/16 or 10.0.0.0/16 (65,536 addresses). At least one VPC is required per region. Choose tenancy: default (shared hardware) or dedicated.
  2. Subdivide the range into subnetsSize each subnet to its needs. VPCs are regional; subnets are tied to a specific Availability Zone.
  3. Create routing tables (optional)AWS creates a main route table by default; create custom ones for specific routing needs.
  4. Set up an Internet Gateway (IGW)The access point connecting the VPC to the wider internet.
  5. Configure the route table with the IGW and subnetAdd a route 0.0.0.0/0 → igw and associate the relevant subnets, which makes them public.
  6. Enable public IP configuration on the subnetAuto-assign public IPs so instances there can be reached.
  7. Enable DNS hostname resolution for the VPCNeeded by services such as EFS and RDS that are addressed by DNS name.
CIDR maths, exam favouriteAddresses in a block = 2(32 − prefix). /16 → 216 = 65,536. /20 → 212 = 4,096. AWS reserves 5 addresses in every subnet (network address, VPC router, DNS, one for future use, broadcast), so a /20 subnet gives 4,096 − 5 = 4,091 usable IPs. That is the 4091 on the slide. A /16 split into /20s yields 24 = 16 subnets: 172.31.0.0/20, 172.31.16.0/20, 172.31.32.0/20 …
KeywordsCIDR blockIP pooltenancyinternet gatewayroute tableDNS hostnames5 reserved IPs
04

Data Collection, Processing and Exploration

4.1Data collection techniques

Definition

Data collection techniques are the methods, tools and processes used to gather raw data from different sources (sensors, applications, logs, user interactions, devices, external systems) for storage, processing and analysis. In cloud environments like AWS they involve streaming, batch ingestion, transformation and querying to make data useful for analytics, decisions and machine learning.

CharacteristicMeaningAWS example
Source diversityData from IoT devices, applications, databases, APIs, logs or streamsAWS IoT Core, API Gateway
Collection modeReal-time (streaming) vs batch (periodic uploads)Kinesis vs scheduled S3 uploads
TransformationRaw data filtered, cleaned or structuredLambda, Glue ETL
Storage destinationS3, databases or data warehousesS3, DynamoDB, Redshift
Analysis readinessPrepared for querying, dashboards or MLAthena, QuickSight, SageMaker
KeywordsingestionstreamingbatchETLsource diversityanalysis readiness

4.2Amazon Kinesis

Definition

A fully managed AWS service for real-time data streaming and processing. Developers can ingest, analyse and respond to large volumes of streaming data from IoT devices, application logs, social media feeds and video streams.

Fig 4.1 Producers → stream of shards → consumers → destinations (S3, DynamoDB, Redshift, EMR, Firehose).
Fig 4.2 The four Kinesis components (slide table).
ComponentPurposeRemember it as
Kinesis Data StreamsCapture and process real-time streams at scale; you write the consumersThe raw pipe
Kinesis Data FirehoseDeliver streaming data to S3, Redshift or Elasticsearch/OpenSearch with no consumer code; can batch, compress and transformThe delivery truck
Kinesis Data AnalyticsAnalyse streams with SQL or Apache Flink in real timeThe live calculator
Kinesis Video StreamsIngest and process video for analytics and MLThe camera feed

How it works

  1. Data ingestionProducers send records (JSON or binary) from sensors, applications or logs.
  2. Sharding and scalingRecords are split across shards using a partition key, giving parallel processing and fault tolerance. Add shards to scale horizontally. One shard takes about 1 MB/s or 1,000 records/s in and 2 MB/s out.
  3. Processing and bufferingTransformations such as filtering or aggregation are applied; data is retained for 24 hours by default (extendable) so consumers can replay it.
  4. Data access and deliveryProcessed data is exposed via APIs or delivered to other AWS services for storage or analysis.
Keywordsproducerconsumershardpartition keyData StreamsFirehoseData AnalyticsVideo Streamsretention

4.3AWS Lambda

Definition

AWS Lambda is a serverless computing service that runs your code in response to events without provisioning or managing servers.

Core featureDetail
Event-driven executionFunctions trigger automatically on events from S3, DynamoDB, API Gateway or Kinesis
Fully managed infrastructureAWS handles provisioning, scaling, patching and monitoring
Automatic scalingScales with demand, down to zero when idle (you pay nothing while idle)
Flexible runtimesNode.js, Python, Java, Go, .NET, Ruby and custom runtimes
MicroVM isolationRuns in Firecracker microVMs: secure, fast, lightweight execution environments
Fig 4.3 Classic event-driven example: an upload to S3 triggers Lambda, which resizes the photo for web, mobile and tablet.
  1. Upload codePackage as a ZIP file or container image.
  2. Define triggersHTTP requests, file uploads, database changes, stream records.
  3. Configure runtime and permissionsPick a runtime, allocate memory (CPU scales with it) and attach an IAM execution role.
  4. Execute and scale automaticallyLambda runs on each trigger and scales with traffic. Limits to remember: max 15 minutes per invocation; first call after idle may see a cold start.

IoT use: a Kinesis stream of temperature readings triggers a Lambda that flags readings above a threshold and writes alerts to DynamoDB or sends them through SNS.

Keywordsserverlessevent-driventriggerscale to zeroFirecrackerexecution rolecold start

4.4Amazon Athena

Definition

Amazon Athena is a serverless, interactive query service that analyses data directly in Amazon S3 using standard SQL or Apache Spark.

  • Serverless: no infrastructure; you pay only for the queries you run (billed per data scanned).
  • SQL and Spark: ad-hoc SQL queries, or analytics applications built with Spark.
  • Fast: queries run in parallel and scale automatically for large datasets.
  • Integrated with AWS Glue: the Glue Data Catalog stores table metadata (schema, location); Glue also runs ETL jobs.
  • Notebook interface: develop Spark applications in Python in a simplified notebook.
SELECT device_id, AVG(temperature) AS avg_temp
FROM iot_db.sensor_readings
WHERE dt = '2026-10-09'
GROUP BY device_id
HAVING AVG(temperature) > 45;

Because cost depends on bytes scanned, storing IoT data in columnar formats (Parquet/ORC), compressing it and partitioning it by date cuts both cost and latency. Athena's model is schema-on-read: the schema is applied when you query, not when data is written.

Keywordsserverless queryS3SQLGlue Data Catalogpay per queryschema-on-readParquet

4.5Data processing: batch, stream and message queue

Batch processing

Collect data over a period, then process it all at once, periodically.

Used in: payroll, data warehousing (ETL), end-of-day reporting, large-scale transformation.

Challenges: unsuitable for real-time feedback; data goes stale if intervals are long.

Stream processing

Continuously analyse data as it arrives, in real or near-real time, record by record or in small chunks.

Used in: fraud detection, monitoring (server logs, sensor data), live dashboards, IoT.

Challenges: managing state and reliability; handling out-of-order data and failures.

Message queue

Asynchronous protocol: messages are stored in a queue until a consumer processes them. Decouples sender and receiver.

Used in: microservices, task scheduling, background jobs, event-driven systems, reliable delivery.

Fig 4.4 Batch is driven by a schedule, stream by arrival/trigger, and a message queue sits between producers and subscribers.
BatchStreamMessage queue
Unit of workLarge bounded datasetUnbounded flow of eventsIndividual message/task
LatencyMinutes to hoursMilliseconds to secondsDepends on consumer speed
TriggerSchedule or manualData arrivalMessage in queue
Main goalThroughputLow latency insightDecoupling, reliable delivery
ToolsHadoop MapReduce, EMR, GlueKinesis, Spark Streaming, FlinkRabbitMQ, Amazon SQS, Kafka
IoT exampleNightly energy-usage report per buildingInstant alert when a turbine vibrates abnormallyQueue firmware-update jobs for 10,000 devices
Keywordsbatchstreammessage queuedata stalenessout-of-order datadecouplingasynchronous

4.6Hadoop and MapReduce

Hadoop

An open-source framework for distributed storage and processing of large datasets on clusters of commodity hardware. It gives scalable, fault-tolerant data management and is widely used in big data analytics. Core parts: HDFS (storage, files split into replicated blocks), YARN (resource management) and MapReduce (processing).

Hadoop MapReduce

A programming model and processing framework (Java-based) for large-scale data across clusters. It splits tasks into smaller units, processes them in parallel and aggregates the results.

  • Two important tasks: Map converts input into intermediate key/value pairs (tuples); Reduce takes the map output and combines those tuples into a smaller set. Reduce always runs after map.
  • The processing primitives are called mappers and reducers.
  • Decomposing an application into mappers and reducers can be nontrivial, but once written, scaling it to hundreds, thousands or tens of thousands of machines is merely a configuration change. This easy scalability is its main advantage.

Three stages

  1. Map stageInput (a file or directory in HDFS) is passed to the mapper line by line; the mapper emits small chunks of key/value pairs.
  2. Shuffle stageThe framework sorts map output and groups all values with the same key, sending each key to one reducer.
  3. Reduce stageThe reducer processes each key's list of values and writes the final output back to HDFS. (The slide treats shuffle + reduce together as the "reduce stage".)
Fig 4.5 Many mappers feed many reducers; the crossing arrows are the shuffle.

Worked example: counting device statuses

Input log (two splits): ok fail ok and ok ok fail.

StageOutput
Map (split 1)(ok,1) (fail,1) (ok,1)
Map (split 2)(ok,1) (ok,1) (fail,1)
Shuffle & sortfail → [1,1], ok → [1,1,1,1]
Reduce (sum)(fail,2) (ok,4)
Fig 4.6 MapReduce at a glance. Used in: index & search, classification, recommendation, analytics. Implemented by Google and Apache Hadoop (with HDFS, Pig, Hive, HBase). Design patterns: summarization (inverted index), classification (top-N), recommendation (sort), analytics (join, selection).
Keywordscommodity hardwareHDFSmapperreducerkey/value tuplesshufflefault toleranceHivePigHBase

4.7Apache Spark Streaming for IoT

Definition

Spark Streaming is an extension of Apache Spark for real-time processing of streaming data from sources such as Kafka, Flume, Twitter or TCP sockets, processed with Spark's core APIs. It is scalable, fault-tolerant and has second-scale latencies.

Fig 4.7 Inputs: Kafka, Flume, HDFS, Kinesis, Twitter. Outputs: HDFS, databases, dashboards.

How it works

Fig 4.8 Receivers chop the stream into batches of a few seconds; each batch is an RDD processed by the Spark engine; results leave in batches.
  • Micro-batching: the stream is chopped into batches of a few seconds (the batch interval).
  • DStream (Discretized Stream): the continuous stream represented as a sequence of RDDs, one per batch.
  • RDD (Resilient Distributed Dataset): an immutable, partitioned collection processed in parallel. "Resilient" because lost partitions are recomputed from their lineage.
  • Operations: transformations (map, filter, reduceByKey) and window operations (e.g. average temperature over the last 60 s, sliding every 10 s).
  • Input sources: Kafka, Flume, HDFS, sockets, custom sources. Output operations: HDFS, databases, dashboards, external systems.
Batch vs Spark StreamingSpark Streaming is "stream processing implemented as many tiny batches". That is why its latency is seconds, not milliseconds. Newer Spark versions offer Structured Streaming, built on DataFrames, which follows the same micro-batch idea.
Keywordsmicro-batchDStreamRDDreceiverbatch intervallineagewindow operationsecond-scale latency

4.8Apache Kafka

Definition

Kafka is "publish-subscribe messaging rethought as a distributed commit log". It is fast, scalable, durable and distributed.

Every topic is an append-only log. Producers append records; each record gets an offset. Consumers read at their own pace by tracking offsets, and records stay on disk for a retention period, so several consumers can read the same data independently and replay it.

Why is Kafka so fast?

  • Fast writes: Kafka persists all data to disk, but writes essentially go to the OS page cache and are appended sequentially.
  • Fast reads: data moves from page cache to the network socket very efficiently (zero-copy transfer).
  • Combined: on a cluster where consumers are caught up, you see no read activity on the disks; everything is served from cache.
  • Batching, compression and parallel partitions add to throughput.
Fig 4.9 Topic zerg.hydra has 3 partitions (P0–P2), each replicated on 2 brokers. A bold box marks the leader replica. ZooKeeper stores cluster state.
TermMeaning (read off Fig 4.9)
BrokerA Kafka server; the cluster here has broker1–3
TopicNamed stream of records ("zerg.hydra")
PartitionOrdered slice of a topic; unit of parallelism (P0, P1, P2)
Replica / leaderCopies of a partition on different brokers; the leader handles reads and writes, followers copy it. P0 leader = broker1, P1 = broker2, P2 = broker3
Producer / consumerWrites to / reads from topics; consumers in a consumer group split partitions between them
ZooKeeperCoordination service used by brokers, producers and consumers to manage and share state
Beyond the slidesRecent Kafka releases replace ZooKeeper with the built-in KRaft consensus mode (ZooKeeper support was removed in Kafka 4.0). For this exam, answer with ZooKeeper as the slide shows.
Keywordsdistributed commit logpublish-subscribebrokertopicpartitionoffsetreplicaleaderpage cachezero-copyZooKeeper

4.9RabbitMQ

Definition

RabbitMQ is a lightweight, open-source message broker that lets parts of a system communicate by passing messages through queues. It implements AMQP (Advanced Message Queuing Protocol) and is used for asynchronous, decoupled and reliable messaging in distributed applications.

  • Acts as message-oriented middleware implementing AMQP; supports multiple protocols (AMQP, MQTT, STOMP).
  • Queues deliver in FIFO (first in, first out) order.
  • Enables distributed systems built on asynchronous messaging.
Slide correctionThe slide says RabbitMQ is developed by the Apache Software Foundation. It is not an Apache project: it is written in Erlang and maintained by VMware/Broadcom (originally Rabbit Technologies). Kafka is the Apache one.
Fig 4.10 Producer → exchange → bindings → queues → consumer. Three exchange types shown: direct, topic, fanout.
ExchangeRouting ruleExample from Fig 4.10
DirectRouting key must exactly match the binding keyKey "PDF process" → Queue 1
TopicPattern match on dot-separated words: * = exactly one word, # = zero or more wordseu.de.* matches eu.de.berlin; us.# matches us, us.ny, us.ny.temp
FanoutBroadcast to every bound queue, key ignoredOne message → Q4, Q5 and Q6

Core concepts

  • Producer: sends messages (to an exchange, which places them in queues).
  • Queue: stores messages until processed.
  • Consumer: retrieves and processes messages, then acknowledges them so they are removed.
  • Exchange: routes messages to queues based on rules.
  • Binding: connects an exchange to a queue with routing logic.
Keywordsmessage brokerAMQPexchangebindingrouting keydirect / topic / fanoutFIFOacknowledgement

4.10Kafka vs RabbitMQ

KafkaRabbitMQ
ModelDistributed commit log, pub-subMessage broker with queues
After consumptionMessages retained for a period; can be replayedMessages deleted once acknowledged
Consumer stylePull; consumer tracks its offsetPush from broker to consumer
RoutingBy topic and partition keyRich routing through exchanges and bindings
StrengthVery high throughput event streaming, log aggregation, feeding Spark/FlinkComplex routing, task queues, per-message reliability
ProtocolOwn binary protocol over TCPAMQP (plus MQTT, STOMP)
IoT fitIngest millions of sensor events per secondDispatch commands or jobs to devices and services
Q

Practice questions

Part A is multiple choice: tap an option to check it and read why. Part B is long-answer: try writing the answer first, then open the model answer.

Score 0 / 0 answeredof 0

Part A · Multiple choice

Part B · Long answer

B1Why is the cloud preferred over on-premises infrastructure for IoT analytics? Explain with five benefits.M3 · 5 marks
Model answer

IoT data is massive, heterogeneous, real-time and geographically distributed, which makes on-premises processing expensive and rigid.

  1. Scalability and elasticity: resources scale with load, avoiding over-provisioning for peaks.
  2. Pay-as-you-go: pay only for compute and storage used; CapEx becomes OpEx.
  3. Variety of services: managed storage (S3), compute (EC2, Lambda), streaming (Kinesis), ML and visualisation.
  4. Security and compliance: built-in encryption, IAM and auditing for sensitive domains like healthcare and smart cities.
  5. Agility: rapid experimentation and faster time-to-market.

Example: the voice-driven Mars rover application chains AWS IoT, Lambda, Lex, Polly, DynamoDB, SNS and CloudWatch with no servers to buy.

B2Trace the Mars rover replica example and state the role of each AWS service.M3 · 6 marks
Model answer
  1. The user asks for the temperature on Mars through an IoT device; AWS IoT receives it.
  2. Lambda passes the request to Amazon Lex.
  3. Lex recognises the intent (get temperature on Mars).
  4. Lex asks a follow-up: Celsius or Fahrenheit?
  5. A second Lambda queries DynamoDB for the reading; SNS/SES can send it as text/email.
  6. Lex replies "Mars is minus 125 degrees Celsius"; Polly converts it to speech. CloudWatch logs and monitors the whole flow.

It demonstrates voice recognition, speech synthesis, storage, device interaction, networking, security and messaging together.

B3Define elastic analytics and explain its five design principles.M3 · 5 marks
Model answer

Elastic analytics is the ability of an analytics system to dynamically scale computing and storage up or down with demand, giving performance, cost-efficiency and adaptability.

  • Separate compute from storage: data in S3/Blob grows independently; clusters come and go.
  • Build for scale from the start: one user to a million without major changes.
  • Bottleneck should be wetware, not hardware: human thinking limits progress, not machine memory.
  • Manage to a spend budget: scale freely within budget, contract quickly.
  • Experiment: spin up, terminate failures, iterate, scale.
B4What is distributed computing? When should you prefer a single server instead?M3 · 4 marks
Model answer

Distributed (cluster) computing is a paradigm where interconnected computers (nodes) share resources and divide tasks to work as one unified system. Frameworks such as Hadoop and Spark handle orchestration so the cluster looks like one machine, whether it has a few nodes or thousands.

It carries a complexity cost: analytics must be designed to run across nodes. Prefer a single server when there is little need for scale, the data is small rather than big, and resource needs are minimal.

B5Discuss key security threats in IoT cloud environments and how public/private key cryptography helps.M3 · 6 marks
Model answer

Threats: data breaches, DoS attacks, malware/ransomware, unauthorized access. Cloud security in IoT protects data, devices and communication using encryption, authentication, access control and secure APIs; security analytics enables proactive detection.

Asymmetric cryptography: a public key (shared) and private key (secret). Data encrypted with the public key can only be decrypted by the private key, so sharing the public key is safe. It underpins SSL/TLS and HTTPS, and works as a stronger form of username/password authentication (SSH key pairs for EC2, X.509 certificates for IoT devices). Private keys must be protected.

B6Differentiate public and private subnets. Where should an analytics cluster be placed and why?M3 · 4 marks
Model answer

A subnet is a logical segment of a cloud network. A public subnet routes to an Internet Gateway; resources are reachable only if they have a public IP. A private subnet has no direct internet access; outbound traffic goes through a NAT gateway.

Analytics clusters and databases belong in private subnets because they hold sensitive data and never need inbound internet traffic. This adds complexity (NAT, bastion hosts) but sharply reduces attack surface. Combine with security groups (stateful, instance level) and NACLs (stateless, subnet level).

B7Explain AWS IAM: identities, permissions and how a request is evaluated.M3 · 5 marks
Model answer

IAM provides secure access control to AWS resources: who can access what.

  • Identities (who): users (people/apps, long-term credentials), groups (sets of users), roles (assumed temporarily, temporary credentials, e.g. Lambda execution role), credentials (passwords, access keys, MFA).
  • Permissions (what): JSON policies made of statements with Effect, Action, Resource and optional Condition.
  • Evaluation: default implicit deny → explicit Allow grants → explicit Deny overrides everything.

Best practice: named accounts, least privilege, no shared credentials.

B8What is AWS CloudFormation? Differentiate a template and a stack, and list the template sections.M3 · 6 marks
Model answer

CloudFormation is an Infrastructure-as-Code service that models, provisions and manages AWS resources automatically. It simplifies management, replicates infrastructure quickly and tracks changes.

Template: static JSON/YAML blueprint, like an architectural plan. Stack: the live, dynamic set of resources created from the template, like the building.

Sections: Format Version, Description, Metadata, Parameters, Mappings, Conditions, Resources (mandatory), Outputs.

Stack features: creation (provision all), update (CloudFormation applies add/modify/delete), deletion (removes all resources), drift detection (detects manual changes).

B9List and explain the steps to set up a VPC for an AWS analytics environment. How many usable IPs does a /20 subnet give?M3 · 6 marks
Model answer
  1. Create the VPC and assign a CIDR range (e.g. 172.31.0.0/16 = 65,536 addresses); choose tenancy. One VPC is required per region.
  2. Divide the range into subnets; VPCs are regional, subnets are per AZ.
  3. Create route tables (optional; a default exists).
  4. Create and attach an Internet Gateway.
  5. Add the IGW route (0.0.0.0/0) and associate subnets.
  6. Enable auto-assign public IP on public subnets.
  7. Enable DNS hostname resolution (needed for EFS, RDS).

/20 → 212 = 4,096 addresses; AWS reserves 5, so 4,091 usable.

B10Describe ThingWorx, its core components and key concepts.M3 · 5 marks
Model answer

ThingWorx, by PTC, is a purpose-built industrial IoT platform for rapidly building and deploying connected applications.

Components: Core (central management), Connection Services (device-platform connectivity), Edge (lightweight device runtime).

Concepts: Thing Templates (blueprints), Things (device instances), Properties (attributes), Services (functions), Events (notifications), Thing Shapes and Data Shapes (reusable attribute sets/structures), Entities (building blocks).

Why: drag-and-drop development, OPC/MQTT/REST integration, real-time dashboards, IIoT scalability, built-in ML. Integration with AWS IoT runs device → MQTT broker/Device Shadow → Rule Engine → Kinesis → ThingWorx AWS IoT Adapter → Core.

B11Explain the architecture and working of Amazon Kinesis with its components.M4 · 6 marks
Model answer

Kinesis is a fully managed service for real-time streaming data. Producers (EC2, clients, mobile, servers) write records into a stream made of shards; consumers (EC2 apps) read and deliver to S3, DynamoDB, Redshift, EMR or Firehose.

Components: Data Streams (capture/process), Data Firehose (deliver to S3/Redshift/Elasticsearch), Data Analytics (SQL/Flink on streams), Video Streams (video for ML).

Working: (1) ingestion of JSON/binary records; (2) sharding by partition key for parallelism and fault tolerance, scaling horizontally; (3) processing and buffering (filter, aggregate); (4) access via APIs or delivery to other services.

B12Compare batch processing, stream processing and message queues with use cases and challenges.M4 · 6 marks
Model answer

Batch: collect data over time, process together periodically. Uses: payroll, ETL/warehousing, end-of-day reports. Challenges: no real-time feedback, data staleness.

Stream: process data continuously as it arrives. Uses: fraud detection, sensor/log monitoring, live dashboards, IoT. Challenges: state management, reliability, out-of-order data, failures.

Message queue: asynchronous; messages wait in a queue for consumers, decoupling sender and receiver. Uses: microservices, background jobs, event-driven systems, reliable delivery.

Summary: batch optimises throughput, stream optimises latency, queues optimise decoupling and delivery guarantees.

B13Explain the MapReduce algorithm with an example. Why is it easy to scale?M4 · 6 marks
Model answer

MapReduce is a Java-based programming model in Hadoop for processing huge data in parallel on commodity clusters.

  • Map: input from HDFS is passed line by line; mapper emits key/value tuples.
  • Shuffle: tuples are sorted and grouped by key.
  • Reduce: reducer combines each key's values into a smaller set and writes to HDFS.

Example (count statuses in "ok fail ok" / "ok ok fail"): map → (ok,1)(fail,1)(ok,1) and (ok,1)(ok,1)(fail,1); shuffle → ok:[1,1,1,1], fail:[1,1]; reduce → ok 4, fail 2.

Scaling: once written as mappers and reducers, running on thousands of machines is merely a configuration change.

B14How does Spark Streaming work? Explain DStreams and RDDs.M4 · 5 marks
Model answer

Spark Streaming extends Spark for real-time processing from Kafka, Flume, HDFS, Kinesis, sockets. It is scalable, fault-tolerant, with second-scale latency.

Receivers chop the incoming stream into micro-batches of a few seconds. Each batch is an RDD (Resilient Distributed Dataset: immutable, partitioned, recomputable from lineage). The sequence of these RDDs is a DStream (Discretized Stream). Spark applies RDD operations to each batch and pushes results out in batches to HDFS, databases, dashboards or external systems.

B15Explain Kafka's architecture and why it is fast. How does it differ from RabbitMQ?M4 · 6 marks
Model answer

Kafka is publish-subscribe messaging rethought as a distributed commit log: fast, scalable, durable, distributed. Producers write to topics split into partitions spread over brokers; each partition has a leader and follower replicas; consumers read by offset; ZooKeeper manages shared state.

Speed: writes go to the OS page cache and are appended sequentially; reads go from page cache straight to the network socket, so caught-up consumers cause no disk reads.

vs RabbitMQ: RabbitMQ is an AMQP message broker using exchanges (direct, topic, fanout), bindings and FIFO queues; messages are deleted after acknowledgement and pushed to consumers. Kafka retains messages for replay, consumers pull, and it is built for very high-throughput streams.

A–Z

Keyword glossary