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