DEV Community

Cover image for Build a Serverless Feedback & Rating System on AWS — Real-Time, Scalable & Event-Driven
Utkarsh Rastogi for AWS Community Builders

Posted on • Originally published at awslearner.hashnode.dev

3 1 1 1 1

Build a Serverless Feedback & Rating System on AWS — Real-Time, Scalable & Event-Driven

Ever wanted to collect product feedback in real-time without managing a single server? This guide walks you through building a complete serverless feedback and rating system using AWS — powered by Lambda, DynamoDB, API Gateway, and CloudFormation!


🌟 The Problem

In the digital age, user feedback is gold.

Whether you're building a SaaS product, running a blog, or launching a mobile app — understanding your users helps shape better experiences. But traditional feedback systems often involve:

  • Managing EC2 instances
  • Scaling backend services
  • Writing complex logic for real-time updates

This can be costly, time-consuming, and a real dev productivity killer.


✅ The Solution

What if you could:

  • Collect real-time feedback through a REST API?
  • Instantly update ratings and analytics as new data arrives?
  • Never manage a server again?

That’s where AWS Serverless shines.

This project demonstrates how to build a fully serverless feedback and rating system using:

  • API Gateway to receive feedback via HTTP
  • AWS Lambda to process logic
  • DynamoDB to store feedback and stats
  • DynamoDB Streams to update analytics in real-time
  • CloudFormation to deploy everything in minutes

🧠 System Architecture

Here's the high-level architecture for our feedback engine:

Architecture

Each piece works together to ensure new ratings update live stats — and it scales automatically.


🛠️ Core AWS Services Used

Service Purpose
API Gateway Expose REST endpoints
AWS Lambda Stateless logic execution
Amazon DynamoDB Store feedback and rating summaries
DynamoDB Streams Trigger real-time updates on data changes
Amazon CloudWatch Monitor and debug logs
AWS IAM Manage permissions securely

🚀 Why CloudFormation?

To make the system reproducible and portable, we define all resources in YAML using AWS CloudFormation.

Benefits:

  • 💡 No manual setup — automate everything
  • 🔁 Consistent environments (Dev, QA, Prod)
  • ⚙️ CI/CD ready from Day 1

🔄 Feedback Lifecycle in Action

1️⃣ Submitting Feedback

  • A user calls the submitfeedback API.
  • Lambda validates input and stores it in FeedbackTable.
  • Record includes productId, userId, rating, and comment.

2️⃣ Real-Time Rating Update

  • New entry in DynamoDB triggers a Stream Event.
  • Stream invokes a second Lambda.
  • It updates FeedbackRatingStatsTable by:
    • Adding new rating to the total
    • Incrementing feedback count
    • Calculating new average

3️⃣ Deleting Feedback (with Auto-Recalculation)

  • deletefeedback API deletes feedback.
  • Stream triggers stats recalculation.
  • If it was the last feedback for that product → stats entry is removed.

4️⃣ Retrieving Feedback and Stats

  • Use getfeedback to get raw feedback per product.
  • Use getratingsummary to fetch average ratings and feedback counts.

📷 Sample Outputs

✅ submitfeedback

Submits a new feedback entry via API and stores it in DynamoDB.

submitfeedback

✅ FeedbackTable

View of the DynamoDB table storing raw feedback entries.

FeedbackTable

✅ FeedbackRatingStatsTable

Aggregated ratings and counts per product stored in a separate table.

FeedbackRatingStatsTable

✅ getratingsummary

API output showing the calculated average rating and feedback count.

getratingsummary

✅ getfeedback

Returns user feedbacks for a specific product ID.

getfeedback

✅ deletefeedback

Removes a user's feedback and automatically updates the statistics.

deletefeedback


✅ Conclusion

This serverless rating and feedback system showcases how AWS services like Lambda, DynamoDB, API Gateway, and DynamoDB Streams can be seamlessly integrated to build a scalable, cost-effective, and fully managed solution with zero backend maintenance.

By leveraging stream-based triggers, the system updates rating statistics in real time while storing and processing feedback through simple APIs. Its support for real-time analytics, auto-scaling, and decoupled logic makes it ideal for modern apps that require lightweight yet powerful backend functionality.

Deployed with AWS CloudFormation, the system is reproducible across environments and extensible for use cases like:

  • Product reviews
  • Course ratings
  • Customer satisfaction systems
  • Event feedback forms

👨‍💻 About Me

Hi, I’m Utkarsh Rastogi, an AWS Community Builder and passionate cloud specialist. I love creating scalable cloud-native applications using serverless technologies and writing about them to help others in their cloud journey.

📚 I regularly share hands-on AWS projects, automation tips, and IaC templates.

🔗 Explore the full source code here:

👉 GitHub – Serverless Feedback System

✍️ More AWS projects & blogs:

🌐 awslearner.hashnode.dev

💼 Connect on LinkedIn:

🔗 Utkarsh Rastogi


Heroku

Deploy with ease. Manage efficiently. Scale faster.

Leave the infrastructure headaches to us, while you focus on pushing boundaries, realizing your vision, and making a lasting impression on your users.

Get Started

Top comments (1)

Collapse
 
binayak profile image
Binayak Sahu

Thanks Utkarsh

Create a simple OTP system with AWS Serverless cover image

Create a simple OTP system with AWS Serverless

Implement a One Time Password (OTP) system with AWS Serverless services including Lambda, API Gateway, DynamoDB, Simple Email Service (SES), and Amplify Web Hosting using VueJS for the frontend.

Read full post

Join the Runner H "AI Agent Prompting" Challenge: $10,000 in Prizes for 20 Winners!

Runner H is the AI agent you can delegate all your boring and repetitive tasks to - an autonomous agent that can use any tools you give it and complete full tasks from a single prompt.

Check out the challenge

DEV is bringing live events to the community. Dismiss if you're not interested. ❤️