Matching supply and demand
| CMCOST_4: How do you optimize cost by matching backend resources with demand? |
|---|
Connected vehicle solutions generate a massive amount of data and events, which can quickly become overwhelming for traditional, request-response-based architectures. Event-driven architectures allow for a more scalable solution, as events are processed asynchronously, allowing for faster and more efficient handling of large volumes of events and consume resources only when and if events occur.
[CMCOST_BP4.1] Implement event driven architectures for your backend systems.
-
Use AWS managed services such Amazon EventBridge
or Amazon Managed Streaming for Apache Kafka (MSK) for event bus, AWS Lambda or AWS Fargate for event processing, and AWS Step Functions for orchestrating the business. The combination of event driven architectures and AWS managed services helps you consume resources only when an event occurs and for the time processing the event while decoupling the different components of the system. -
You can leverage event-driven architecture to process events from vehicle as illustrated in this blog Building event-driven architectures with IoT sensor data
. You can also expand the event-driven pattern to other business applications as illustrated for Building an Interactive Sales Portal for Automotive Using AWS Microservice Architecture
Evaluate and select your compute type depending on events processed by your backend systems.
-
Consider using AWS Lambda for events that can be processed asynchronously with one or a cascade of processing steps short lived time (up to 15 minutes) that can be orchestrated with AWS Step Functions. As an example, Lambda are suitable for an API based service such subscription management for a service. Use AWS Step Functions to coordinate serverless workflows. It helps manage and control the execution order of your Lambda functions and other services, reducing the time and resources needed for complex tasks.
-
Consider using containers through Amazon Elastic Kubernetes Service (Amazon EKS) or Amazon Elastic Container Service (Amazon ECS) when you need near real time event processing of large-scale number of events or require more processing time. Both Amazon EKS and Amazon ECS offer AWS Fargate that run your containers serverless without any underlying infrastructure to maintain.
-
As an example, containers are suitable for large number of MQTT messaging based events that needs near real time processing such vehicle diagnose data collection and processing after a defect being detected.
-
Amazon EC2 Spot Instances: For non-critical workloads, consider using EC2 Spot Instances. Spot Instances are available at significantly lower prices compared to On-Demand instances but can be interrupted with short notice when the Spot price exceeds your bid. Use Spot Instances to handle non-time-sensitive tasks and save costs.
-
AWS Cost Explorer and AWS Budgets: Utilize AWS Cost Explorer and AWS Budgets to monitor and analyze your AWS costs. These tools provide insights into spending patterns and can help you identify opportunities for optimization.
-
Finally, for large batch processing AWS Batch that helps you to run batch computing workloads on the AWS Cloud.