This Guidance demonstrates how customers can livestream product reviews with interactive chat and push auto-discovered product data to viewers. It is a fully managed livestreaming service that supports product discovery in videos.
Video is streamed in near real-time to viewers watching on browsers and mobile devices.
Viewers are able to chat with each other and the broadcaster in near real-time with the Amazon IVS Chat service.
Broadcaster or support staff can moderate the chat and respond to viewers in near real-time.
AWS Lambda is used to continuously extract video frames from live streams to identify products in the scene.
Image frames are sent to a custom product detection artificial intelligence (AI) or machine learning (ML) model hosted on an Amazon SageMaker inference endpoint. Discovered products are returned to Lambda.
Products in scene are pushed through WebSocket APIs in Amazon API Gateway with connections to viewers in near real-time.
Viewer devices, including browsers or mobile devices, download product images from Amazon CloudFront.
The AWS Well-Architected Framework helps you understand the pros and cons of the decisions you make when building systems in the cloud. The six pillars of the Framework allow you to learn architectural best practices for designing and operating reliable, secure, efficient, cost-effective, and sustainable systems. Using the AWS Well-Architected Tool, available at no charge in the AWS Management Console, you can review your workloads against these best practices by answering a set of questions for each pillar.
The architecture diagram above is an example of a Solution created with Well-Architected best practices in mind. To be fully Well-Architected, you should follow as many Well-Architected best practices as possible.
This Guidance uses Amazon IVS to improve processes and deliver business value. Amazon IVS is a managed service that takes the work out of running and managing live video streaming capabilities.
In this Guidance, Lambda uses an AWS Identity and Access Management (IAM) role that only allows it to poll Amazon IVS for image frames that it sends to a SageMaker inference endpoint. It then updates the API Gateway WebSocket connection endpoint. The IAM role prevents Lambda from making any other service calls that are not part of the product discovery workflow.
All the services used in this Guidance are managed services. These are designed to be highly available across multiple Availability Zones, within a single Region, so that the workload performs its intended function correctly and consistently when it’s expected to.
CloudFront is a content delivery network (CDN) that sits at the global edge of AWS to deliver data quickly. In this Guidance, it is used to cache product images from the CDN edge network, making downloading faster.
Lambda is used to periodically poll the video streams to orchestrate a product discovery workflow, helping customers build and operate cost-aware workloads. The entire process takes place within seconds. By using Lambda, customers are only charged for those seconds of processing. This has a cost advantage over longer running services which may be underutilized in a similar scenario.
The practice of sustainability is understanding the impacts of the services used, quantifying impacts through the entire workload lifecycle, and applying design principles and best practices to reduce these impacts. Well-optimized bandwidth usage is one way of lowering overall energy usage of a solution. In this example, WebSockets from API Gateway are used to maintain a persistent client connection that is used to discover product information. This connection uses significantly less bandwidth than an HTTP polling method, which could send thousands of round-trip HTTP requests in a session.
A detailed guide is provided to experiment and use within your AWS account. Each stage of building the Guidance, including deployment, usage, and cleanup, is examined to prepare it for deployment.
The sample code is a starting point. It is industry validated, prescriptive but not definitive, and a peek under the hood to help you begin.
The sample code; software libraries; command line tools; proofs of concept; templates; or other related technology (including any of the foregoing that are provided by our personnel) is provided to you as AWS Content under the AWS Customer Agreement, or the relevant written agreement between you and AWS (whichever applies). You should not use this AWS Content in your production accounts, or on production or other critical data. You are responsible for testing, securing, and optimizing the AWS Content, such as sample code, as appropriate for production grade use based on your specific quality control practices and standards. Deploying AWS Content may incur AWS charges for creating or using AWS chargeable resources, such as running Amazon EC2 instances or using Amazon S3 storage.