Skip to main content

Guidance for Near Real-Time Personalized Recommendations on AWS

Overview

This Guidance helps businesses build a real-time recommendation pipeline using Amazon Personalize. The pipeline creates personalized recommendations based on a user’s profile and behavior to improve the customer experience. Developers can use this Guidance to show personalized recommendations, including recommended products, promotions, and items for upsell or cross-sell.

This Guidance provides an Advanced Composite Recipe that retrieves information stored in Amazon DynamoDB about items similar to the item a user is viewing. It combines this information with a User Personalized Ranking Recipe to generate item recommendations for cross-selling.

How it works

These technical details feature an architecture diagram to illustrate how to effectively use this solution. The architecture diagram shows the key components and their interactions, providing an overview of the architecture's structure and functionality step-by-step.

Well-Architected Pillars

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.

You can monitor Amazon CloudWatch metrics like GetRecommendationsLatency, DatasetImportJobError, and PutEventsRequests in Amazon Personalize. You can configure CloudWatch alarms with Amazon Simple Notification Service (Amazon SNS) notifications. Additionally, you can monitor Amazon Personalize using the Amazon Personalize monitor

You can configure CloudWatch alarms based on metrics with Lambda, API Gateway, DynamoDB, and other services in this architecture.

Read the Operational Excellence whitepaper 

Data stored in Amazon Personalize is encrypted at rest with Amazon Personalize-managed AWS Key Management Service (AWS KMS) keys.

Amazon Personalize uses transport layer security (TLS) with AWS certificates to encrypt any data sent to other AWS services. Any communication with other AWS services happens over HTTPS, and Amazon Personalize endpoints support only secure connections over HTTPS.

Read the Security whitepaper 

The managed services in this architecture, including Amazon Personalize, use the AWS global infrastructure for data resiliency. When creating an Amazon Personalize resource in an AWS Region, Amazon Personalize manages the resilience and data redundancy of the resource across multiple Availability Zones. Additionally, DynamoDB uses AWS Auto Scaling to dynamically adjust provisioned throughput capacity in response to actual traffic patterns.

Read the Reliability whitepaper 

Services in this architecture scale according to traffic patterns. For example, API Gateway automatically scales to handle the amount of traffic received through the API. Throttling ensures that API traffic is controlled to help your backend services maintain performance and availability. Additionally, Lambda scales up as invocations increase exponentially. Lambda initializes a new instance for any request that can't be routed to an available instance. When the burst concurrency limit is reached, the function starts to scale linearly. Amazon Personalize automatically scales to meet demand of near real-time recommendations.

Read the Performance Efficiency whitepaper 

This architecture uses application level services, including Amazon Personalize, Lambda, and DynamoDB, which use the pay as you go model, meaning you only pay for the exact resources you use. Additionally, Amazon Personalize includes training costs based on training hours in addition to campaigns costs based on transactions per second (TPS)-hour for near real-time recommendations and the number of recommendations for batch processing.

Read the Cost Optimization whitepaper 

This architecture uses managed services (such as Amazon Personalize, DynamoDB, and Lambda) which optimize utilization of the architecture’s underlying resources. 

Read the Sustainability whitepaper 

Implementation resources

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. 
Open sample code on GitHub

Disclaimer

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.