Skip to content

A redesign and optimization of a monolithic backend system to a set of microservices for an e-commerce web application.

Notifications You must be signed in to change notification settings

rfp2212-SDC1-honeyDijon/SDC-QA

Repository files navigation

Atelier Product Q&A API Service

  • Redesign and optimization of a monolithic backend system to a set of microservices for an e-commerce web application.
  • Responsible for the Product Q&A microservice that supports the frontend Questions & Answers module that allows users to view and search questions, ask questions, answer questions, and provide feedback on questions and answers for a given product.

Tech Stack


API Endpoints

Questions

GET /qa/questions retrieves a list of (non-reported) questions for a given product
POST /qa/questions adds a question for a given product
PUT /qa/questions/:question_id/helpful updates a question to show it was found helpful
PUT /qa/questions/:question_id/report updates a question to show it was reported

Answers

GET /qa/questions/:question_id/answers retrieves a list of (non-reported) answers for a given question
POST /qa/questions/:question_id/answers adds an answer for a given question
PUT /qa/answers/:answer_id/helpful updates an answer to show it was found helpful
PUT /qa/answers/:answer_id/report updates an answer to show it was reported


Performance Summary & Stress Testing

Metric Goal Achieved
RPS 1000 1000 for questions, 1500 for answers
Latency <1s 26ms for questions, 12ms for answers
Error rate <1% <1% for both questions and answers

Deployed and stress tested with loader.io, with bias on records within last 10% of dataset

GET questions /qa/questions
GET answers /qa/questions/:question_id/answers

Optimizations

Server optimizations

  • Horizontal scaling with 1 load balancer and 2 server instances (total of 3 AWS EC2 T2 micro instances)
  • Load balancer configurations: keepalive_requests and Nginx caching

Other optimizations

  • Database optimizations with indices (query time <50ms)
  • Server optimizations with Redis caching

About

A redesign and optimization of a monolithic backend system to a set of microservices for an e-commerce web application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published