Inherited a front-end e-commerce application. In this project I built and optimized a back-end API for an e-commerce application. I worked I with over 12 million data entries regarding questions and answers for products.
Throughput | Latency | Error rate |
---|---|---|
1,000 rps | <= 50ms | < 1% |
The questions and answers data has over 12 million data entries. I transferred the data from a csv file into a postgreSQL database by performing an ETL process.
Deployed the server and database to AWS, I used a EC2 T2 micro instance for my server. I stress tested using Loader.io, and took the average of three test with randomized product ID.
Throughput | Latency | Error rate |
---|---|---|
1,000 rps | 1,200ms | 32% |
I scaled horizontally and deployed another server. Then, I used Nginx as my load balancer.
Throughput | Latency | Error rate |
---|---|---|
1,000 rps | 312ms | 6% |
Switched to least connection load balancing from round robin load balancing in Nginx.
Throughput | Latency | Error rate |
---|---|---|
1,000 rps | 6ms | 0% |
Performed content caching in load balancer.
Throughput | Latency | Error rate |
---|---|---|
1,000 rps | 1.66ms | 0.16% |
Increased throughput to 5,000 rps.
Throughput | Latency | Error rate |
---|---|---|
5,000 rps | 3ms | 0% |
Ensure postgreSQL is installed in your computer
Copy example.env
file and rename to .env
, then fill in the variables
npm install
npm run server-dev