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.

Architecture Diagram

Download the architecture diagram PDF 

Well-Architected Pillars

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.

  • 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. 

AWS Architecture


This post demonstrates how...


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.

References to third-party services or organizations in this Guidance do not imply an endorsement, sponsorship, or affiliation between Amazon or AWS and the third party. Guidance from AWS is a technical starting point, and you can customize your integration with third-party services when you deploy the architecture.

Was this page helpful?