Optimize System Design for Lalalime Similar Products Component

Optimized and horizontally scaled back-end of Lululemon clone. Seeded 10M records into both MongoDB and PostgreSQL in under 10 minutes. Deployed, horizontally scaled micro-service using PostgreSQL to 4 EC2 instances, and used Nginx Load Balancer (Round-Robin technique) to handle a throughput of 2,000 RPS with 0.5% error rate and an average latency of 182 ms. Deployed, horizontally scaled micros-service using MongoDb to 4 EC2 instances, and used Nginx Load Balancer (Round-Robin technique) to handle a throughput of 1,300 RPS with 0.0% error rate and average latency of 72 ms.

Inherited Component

Related Components

Table of Contents

  1. Usage
  2. Requirements
  3. Development

Usage

Start Mongodb

In database/mongoDB/index.js:

Update user, host, database, password

From within the root directory:

npm run startMongo
npm run seedMongo
npm run build

Start PostgreSQL

In database/postgreSQL/index.js:

Update user, host, database, password

From within the root directory:

npm run startMongo
npm run seedMongo
npm run build

Requirements

An nvmrc file is included if using nvm.

  • Node 6.13.0

Development

Installing Dependencies

From within the root directory:

npm install