HOME > CASE STUDIES > YOU ARE HERE

Case Study: IoT Application & Infra Optimization on AWS Cloud

Consultative Support for analyzing and proposing optimizations for an existing IoT Application & Infrastructure on AWS.

  • S3
  • Lambda
  • EC2 Spot
  • Amazon MQ
  • Aurora Serverless

Project Background

The client, a fast-growing IoT device manufacturer, was experiencing significant challenges in scaling and managing their AWS infrastructure efficiently. Their existing setup consisted of RabbitMQ for messaging, EC2 for compute resources, and Amazon RDS MariaDB for database management. As the number of connected devices increased, the infrastructure began to show signs of stress, including performance bottlenecks, higher operational costs, security gaps, and limited scalability.

The client sought recommendations for optimizing their existing application and infrastructure to improve scalability, enhance performance, and lower operational costs. Their primary goals included ensuring that their infrastructure could handle continued growth while remaining cost-efficient and reducing the need for manual intervention in scaling and maintenance.



Research & Development

Research & Analysis

Our analysis focused on identifying inefficiencies and areas where costs could be optimized without compromising performance. We conducted the following evaluations:

  1. Compute Resources: The client’s use of on-demand EC2 instances resulted in underutilized resources during periods of lower device activity, leading to higher costs. Additionally, manual management of scaling was contributing to operational inefficiencies.
  2. Messaging System: RabbitMQ, though functional, required frequent manual scaling and tuning to manage the growing volume of IoT messages. This increased the operational complexity and cost.
  3. Database Performance and Costs: The RDS MariaDB instance was facing significant performance challenges as device traffic increased. Scaling MariaDB was becoming costly due to the need for additional read replicas and larger instances to manage concurrent reads and writes.
  4. Cost Structure: The client was incurring unnecessary costs due to over-provisioning of EC2 resources and fixed database capacity. Given the fluctuating nature of IoT workloads, their infrastructure was not optimized for handling dynamic changes in traffic patterns.

Recommendations

We provided a set of recommendations tailored to the client’s specific requirements for cost optimization and scalability. These recommendations focused on leveraging AWS services that automatically scale to meet demand, thereby reducing manual intervention and operational overhead.

Compute Optimization:

  1. EC2 Auto Scaling with Spot Instances: To reduce compute costs, we recommended adopting Spot Instances for non-critical workloads. Spot Instances can offer up to 90% cost savings compared to on-demand instances, making them ideal for workloads that can tolerate interruptions. For critical workloads, we advised combining Reserved Instances with Auto Scaling, ensuring that the client could lock in lower pricing for predictable workloads while still maintaining flexibility.
  2. AWS Lambda for Event-Driven Compute: For IoT event-driven tasks, such as processing incoming data or triggering backend workflows, we suggested migrating to AWS Lambda. Lambda is a serverless service that only charges for the actual compute time used, significantly reducing idle costs compared to always-on EC2 instances. This approach would help eliminate the costs associated with running compute resources during off-peak times.

Messaging System Optimization:

  1. Switch from RabbitMQ to Amazon MQ: We recommended migrating from RabbitMQ to Amazon MQ, a managed message broker service that scales automatically based on workload demand. This would reduce the need for manual scaling and maintenance, leading to lower operational costs and better handling of the increasing message volume from IoT devices.

Database Optimization:

  1. Migrate from RDS MariaDB to Amazon Aurora Serverless: While the CTO expressed concerns about Aurora potentially being more expensive than MariaDB at scale, we clarified that Amazon Aurora Serverless offers significant benefits for their use case, given the dynamic and unpredictable nature of their workloads.

    • Cost Efficiency: Unlike RDS MariaDB, which requires the provisioning of a fixed instance size and storage capacity (even during periods of low activity), Aurora Serverless automatically adjusts its database capacity within a defined range, based on actual demand. The client pays only for the database capacity consumed during active periods and incurs minimal costs during idle times, potentially leading to significant savings during off-peak hours.
    • Performance at Scale: Aurora is designed for high-throughput workloads. At scale, this improved performance would reduce the need for costly additional read replicas and larger instance sizes, as Aurora can handle significantly more concurrent connections and transactions.
    • Scalability and Automation: Aurora Serverless eliminates the need for manual intervention to scale the database. It automatically adjusts to handle spikes in traffic, making it ideal for the client’s fluctuating IoT data streams. This also simplifies operational management, reducing the overall operational cost and complexity of scaling.

Data Storage and Cost Control:

  1. S3 with Intelligent-Tiering: We recommended using Amazon S3 for archiving IoT device data after completed analytics workflows, and enabling Intelligent-Tiering to automatically move infrequently accessed data to cheaper storage tiers. This would help the client optimize their storage costs without the need for manual data management.
  2. Cost Monitoring Tools: To ensure continuous monitoring and optimization of infrastructure costs, we recommended setting up AWS Budgets and Cost Explorer.

Architecture

The recommended architecture would ensure that the client’s AWS infrastructure is both scalable and cost-efficient. The key components were as follows:

  1. Amazon MQ would replace RabbitMQ for messaging, providing a managed, scalable solution that reduces operational complexity.
  2. EC2 Auto Scaling with Spot Instances would dynamically adjust compute resources based on workload demand, while AWS Lambda would handle event-driven tasks triggered by IoT device interactions, eliminating the costs of always-on instances.
  3. Amazon Aurora Serverless would replace RDS MariaDB, providing an elastic, high-performance database solution that scales automatically with demand, ensuring cost efficiency during periods of low activity.
  4. Amazon S3 Intelligent-Tiering would optimize data storage costs, and AWS Budgets and Cost Explorer would provide ongoing cost monitoring and controls.

Deployment

We provided clear recommendations for build, CI/CD, monitoring and observability, in line with the AWS Well-Architected and Security Reference Frameworks.

Conclusion

By following the recommendations provided, the client would stand to benefit from significant improvements in scalability, performance, and cost-efficiency. These include:

  1. Reduced Costs: By utilizing Spot Instances, AWS Lambda, and Aurora Serverless, our cost analysis concluded that the client could achieve up to 45% savings on infrastructure costs, depending on workload patterns and usage. The shift to a pay-per-use model for compute and database resources would ensure that the client only paid for what they actually used.
  2. Improved Scalability: The use of managed services such as Amazon MQ and Aurora Serverless would allow the client to scale reliably as the number of IoT devices increased, without the need for manual intervention.
  3. Reduced Operational Overhead: Managed services would reduce the burden on the client’s internal team, allowing them to focus on core business activities rather than managing the infrastructure. Aurora Serverless, in particular, would simplify database scaling, backups, and failovers, which further reduces operational costs.
  4. Long-Term Flexibility: The architecture recommended was considerably more future-proof than before, enabling the client to expand their IoT footprint without worrying about significant increases in operational complexity or cost.

Found this useful? Spread the word 🙏

Share this Case Study on LinkedIn

Need help with a Data or Cloud use-case? Get in touch today 🤝