The Internet of Things on AWS – Official Blog
Architect a dual-path IoT conversation analytics solution on AWS
Organizations managing IoT at scale face a critical business challenge: every hour of equipment downtime costs thousands in lost revenue, while untapped sensor data represents missed opportunities for operational optimization. Research shows that digital maintenance and reliability transformations can increase asset availability by 5–15 percent and reduce maintenance costs by 18–25 percent (McKinsey), translating to significant recovered revenue annually. Yet many organizations face a perceived trade-off: invest in real-time systems that can’t handle historical analysis or build batch pipelines that miss critical anomalies. Meanwhile, complex analytics tools lock insights behind SQL expertise, leaving business stakeholders unable to access the data they need to make decisions.
This architecture alleviates those trade-offs by combining AWS IoT services with intelligent dual-path data processing and natural language analytics. By using Narrow Band IoT (NB-IoT) and Long Range Wide Area Network (LoRaWAN) connectivity, implementing dual processing pipelines, and enabling intelligent data interactions through visualization and conversational analytics, the solution provides a scalable framework for IoT data management. Whether managing urban smart meters or remote sensors, this solution delivers the flexibility and performance modern IoT implementations require.
In this post, we show you how to architect a system that processes IoT telemetry data for both real-time analytics and historical analysis, combining batch and stream processing to extract meaningful insights from diverse IoT sources. This approach alleviates the traditional trade-offs between real-time processing and historical analysis, while making data accessible to users of varying technical levels.
Solution overview
This IoT architecture combines NB-IoT and LoRaWAN technologies with AWS services to manage data from millions of devices. A dual-path processing strategy enables both real-time anomaly detection through Amazon Kinesis Data Streams and Amazon Managed Service for Apache Flink, with another path for batch analytics through a three-tiered Amazon Simple Storage Service (Amazon S3) storage system managed by AWS Glue. The solution integrates generative AI agents deployed on Amazon Bedrock AgentCore for conversational analytics, enabling natural language queries of IoT data, alongside Amazon Managed Grafana dashboards for real-time operational visibility and metrics tracking. This delivers scalable, cost-effective data ingestion and processing for immediate operational responses and long-term insights.
Figure 1: Overall architecture
Data ingestion
Managing data ingestion from millions of IoT devices across diverse locations presents a significant challenge. This architecture uses NB-IoT and LoRaWAN technologies to facilitate reliable data collection from widespread device fleets to AWS.
NB-IoT devices integrate with AWS IoT Core through a cellular network operator or connectivity partner that bridges the NB-IoT radio network to the AWS IoT Core endpoints. Devices typically use lightweight protocols such as UDP or CoAP, with a data broker handling protocol translation and forwarding to AWS IoT Core. The cellular network provides reliable coverage and deep penetration, facilitating consistent transmission from challenging locations like underground installations and dense urban areas. AWS IoT rules process data downstream.
Figure 2: Data ingestion
For remote locations, LoRaWAN provides the right coverage using gateways with LoRa Basics Station packet forwarders. This solution is effective for devices that transmit small data packets while maintaining long battery life. These gateways integrate with AWS IoT Core for LoRaWAN, a managed LoRaWAN Network Server. Incoming payloads from LoRaWAN devices arrive as base64-encoded binary and are routed through a destination (which maps to an IoT Rule). Within the IoT Rule, an AWS Lambda function invokes a device-specific decoder that parses the binary payload into a usable format such as JSON. Each device type may encode its payload differently, so decoder functions must be tailored per device model. The decoded data is then forwarded through the AWS IoT Rule action to Amazon Data Firehose, which buffers records before delivering them to Amazon Simple Storage Service (Amazon S3). This approach facilitates reliable, cost-effective, and scalable data ingestion across long ranges.
Dual processing paths
The AWS IoT Core rules engine integrates IoT devices with AWS services, so you can process device data through multiple services simultaneously.
Figure 3: Dual processing paths
This architecture implements a dual-path approach through AWS IoT Core Rules, directing data streams along parallel processing paths. The first path routes data to Amazon Data Firehose for batch processing, while the second enables real-time processing through Amazon Kinesis Data Streams. This strategy facilitates comprehensive processing for both immediate operational needs and long-term analytics. For example, the real-time path can detect when equipment temperature exceeds a threshold and triggers a cooling system automatically. For long-term analytics, an example would be analyzing temperature patterns over time to optimize maintenance schedules.
Real-time path
The real-time processing pipeline routes device data from AWS IoT Core rules into Kinesis Data Streams for large-scale, real-time data collection. The data then flows into Amazon Managed Service for Apache Flink for sophisticated stream processing, enabling real-time data transformation and analysis with stateful computations for immediate actions like anomaly detection based on historical patterns.
Amazon Timestream for InfluxDB 3, a purpose-built managed time series database engine, stores the processed streams (at the time of writing, Apache Flink doesn’t include a native InfluxDB sink connector, so a custom sink using the InfluxDB v3 write API is required). It delivers single-digit millisecond query response times for time-series data analysis. You can use SQL queries to analyze IoT sensor data and mission-critical workloads, quickly identifying trends and patterns.
Figure 4: Real-time processing path
With this pipeline, you can continuously monitor device health and performance, improving operational efficiency through immediate alerting and automated actions based on specific conditions. Amazon Managed Grafana enhances these capabilities through real-time dashboards and alerting, which we explore in the following section.
Near real-time and batch processing path
The data processing pipeline uses AWS analytics services for near real-time and batch processing through a three-tiered Amazon S3 storage strategy. It begins with Amazon Data Firehose delivering incoming data streams to the first tier, the raw data S3 bucket, preserving the original data in its unmodified form.
AWS Glue workflows, a serverless orchestration service, manages data quality and standardization by automatically processing new data upon arrival. The AWS Glue transformations and Extract, Transform, Load (ETL) scripts standardize formats and validate data completeness, then store the cleansed results in the second tier S3 bucket. This cleansed data tier provides consistent, validated data for downstream processing.
Figure 5: Near real-time and batch processing path
AWS Glue Crawlers then catalog the cleansed data in AWS Glue Data Catalog, enabling analytics tools to discover and access the data. In the final processing stage, AWS Glue ETL jobs perform business-driven aggregations and store results in the third tier S3 bucket, the aggregated data layer. This three-tiered approach (raw, cleansed, aggregated) tracks data lineage and optimizes query performance while the serverless processing scales cost-effectively with your needs.
Data interaction methods
This architecture offers two complementary ways to interact with your IoT data. Managed Grafana provides comprehensive dashboards for visualizing both real-time and batch-processed data, while a generative AI-powered conversational interface enables natural language queries.
Together, these approaches make data insights accessible regardless of technical expertise, serving diverse user roles across your organization.
Analysis and visualization
Amazon Managed Grafana provides a unified visualization application for both real-time and historical data analysis. Through integration with Amazon Athena, users can query batch-processed S3 data using standard SQL, creating interactive dashboards that reveal IoT device operations and performance patterns.
Figure 6: Analysis and visualization
For real-time monitoring, the Managed Grafana integration with Amazon Timestream for InfluxDB 3 provides immediate visualization of streaming IoT data. The solution offers various visualization options, including time-series graphs for historical trends and real-time gauges for current readings. The Managed Grafana alerting framework also sends automated notifications based on customizable thresholds for prompt response to critical conditions.
Figure 7: Sample solar farm IoT dashboard on Grafana
Conversational analytics
Amazon Bedrock AgentCore serves as the agentic platform in this architecture, hosting Strands AI agents that handle the natural language interaction with end users using Large Language Models (LLMs) provided by Amazon Bedrock. For example, a user might ask “Show me all devices with temperature above 80 degrees in the last hour,” which the system translates to SELECT device_id, temperature, timestamp FROM iot_data WHERE temperature > 80 AND timestamp > NOW() - INTERVAL '1 HOUR', or “What’s the average battery level by Region?” becomes SELECT region, AVG(battery_level) FROM device_metrics GROUP BY region.
The solution uses embedding models available through Amazon Bedrock, such as Amazon Titan Text Embeddings, to interpret AWS Glue Data Catalog metadata semantically. Retrieval-Augmented Generation (RAG) with Amazon Bedrock Knowledge Bases helps AI agents generate accurate SQL statements. An intelligent feedback loop with Amazon Athena automatically refines queries through a tool that’s deployed using AWS Lambda and accessed by the AI agents through Amazon Bedrock AgentCore Gateway. This loop self-corrects errors and engages users through chat when clarification is needed, creating an efficient data exploration experience.
Figure 8: Conversational analytics
Users access this functionality through a Streamlit application, enabling natural language data exploration without SQL expertise while maintaining accuracy and reliability. Alternatively, this interface can be built using AWS services such as Amazon CloudFront with Amazon S3 for static hosting, or AWS Amplify with React for a fully managed front-end deployment.
Figure 9: Sample conversational analytics interface for smart building
Implementation considerations
To build reliable, secure, and cost-effective IoT workloads, we recommend reviewing AWS Well-Architected Framework which provides design principles and best practices for production workloads. The IoT Lens extends these principles with specific guidance for IoT implementations, addressing challenges in device connectivity, data processing, and scalability.
Conclusion
This architecture provides a foundation that organizations can extend as their IoT needs evolve. The dual-path processing design scales from thousands to millions of devices, while the three-tiered S3 storage strategy can accommodate new data sources and compliance requirements over time.
Amazon Managed Service for Apache Flink enables increasingly sophisticated anomaly detection models as more operational data is collected, and the conversational analytics layer can be enhanced with domain-specific knowledge bases through Amazon Bedrock Knowledge Bases for more precise, industry-tailored insights. The modular design means teams can adopt individual components incrementally, starting with the path that addresses their most pressing operational challenge.
Together, these capabilities enable real-time anomaly detection, cost-effective scalability, and data-driven decision-making across levels of the organization.
To get started with this architecture, explore services documentation such as AWS IoT Core, Amazon Bedrock Agent Core Code examples, and Amazon Managed Grafana. If you need assistance, contact your AWS account team or engage with AWS Professional Services to accelerate your IoT implementation journey.