Serverless E-commerce

Jul 5, 2024

Serverless E-commerce backend solution on AWS.

Overview

I've delivered a serverless e-commerce backend solution hosted on AWS that combines efficiency, scalability, and robustness. Designed to handle high-velocity transactions, the architecture ensures zero data loss, seamless service choreography, and unmatched operational resilience. The REST API endpoints has been developed per given api schema.

Technical highlights

  • Event-Driven Architecture: Leveraging AWS EventBridge as the core message broker, the system handles event choreography with events archive and replay capabilities.
  • Dead Letter Queues (DLQ) with ReDrive Queue and auto-replays: Ensuring zero tolerance for message loss by reprocessing failed messages and minimizing runtime errors. Automated message replay with back-off and alerts on replay failures.
  • Microservices Design: Each service operates independently using a single Lambda function, capable of serving multiple API endpoints for specific business processes.
  • Scalable and Fault-Tolerant: The solution scales automatically to handle varying loads while maintaining high availability.
  • Unified standard for the services: Standard service described as a building-block. That gives junior developers a solid guidance on service development, allowing to progress fast and cost-efficient..
  • Single Table Design: Every service has it's own DynamoDB table that utilize a single table design pattern..

Key solution features

Cart service

The cart service is a key component in any e-commerce solution. Using AWS DynamoDB for data storage, the cart system supports real-time updates and customer-specific cart sessions.

Cart Image Cart Design Schema

Order management

Order management integrates seamlessly with payment services, ensuring consistent order processing and reconciliation. AWS Lambda and SQS handle asynchronous order placement, updates, and cancellations, ensuring fast and reliable execution.

Order Image Order Design Schema

Category and product management

With a flexible category and product system, the architecture supports robust CRUD operations through API Gateway endpoints. AWS DynamoDB underpins both services, enabling fast and reliable access to category and product metadata.

Categories Image Categories Design Schema

Product Image Product Design Schema

Search service

The search service, built on AWS OpenSearch and AWS Lambda, provides instant search capabilities. It supports advanced filtering, sorting, and faceted navigation, ensuring an intuitive shopping experience for end-users.

Search Image Search Design Schema

Attributes and filters

Attributes and filters empower users to refine their product searches with precise criteria. This feature is integrated with the product search service to ensure tailored and relevant search results.

Product Attributes Image Product Attributes Design Schema

Robust message handling

The system implements Dead Letter Queues (DLQ) and ReDrive mechanisms to guarantee reliability. Messages that fail initial processing are sent to DLQs, where they are logged, monitored, and retried using ReDrive queues.

DLQ and ReDrive Image DLQ and ReDrive Design Schema

Summary

  • Improved Reliability: With robust error handling and message replays, the system ensures uninterrupted operations even during high traffic or unexpected failures.
  • Enhanced User Experience: Fast search responses and dynamic filtering enable customers to find products effortlessly.
  • Operational Efficiency: The serverless architecture minimizes infrastructure management, allowing the business to focus on strategic objectives.
  • Cost Optimization: Pay-as-you-go pricing and auto-scaling reduce overhead costs, especially during off-peak times.