Skip to content

SDC-Builder/Tim-About-Service

 
 

Repository files navigation

Service - About

Build Status

Coursera About Service Contains a description of the course, along with some strategic goals and possible outcomes of taking the course.

View the sample on Coursera under "About this Course"

Deployment Architecture Server Design (1)

Related Projects

Table of Contents

  1. Usage
  2. CRUD_API
  3. API_Performance

Usage

  • Run npm install from the root directory to install dependencies
  • From within the database directory, run csvCreator.js to generate 10 million records.
  • Seed a Cassandra database with database/cassandra/cassandraFiller.js
  • Run npm build to build the webpack bundle
  • Run npm server-dev to start the server. Server runs on port 3002
  • Run npm run test to run the jest and Enzyme tests, CI/CD also enabled

CRUD_API

Endpoints:

/api/about/:id

GET:

Request

GET /api/about/:id

Response

Status: 200
Body:
{
    "course_id": Number,
    "description": String,
    "what_you_will_learn": [
        ArrayOfStrings
    ],
    "skills_you_will_gain": [
        ArrayOfStrings
    ],
    "recent_views": Number,
    "learner_career_outcomes": [
        {
            "icon": String,
            "pct": Number,
            "outcome": String
        },
    ],
    "metadata": [
        {
            "icon": String,
            "title": String,
            "subtitle": String
        },
    ]
}

PUT:

Request

PUT /api/about/:id

Body:
{
    "course_id": Number,
    "description": String,
    "what_you_will_learn": [
        ArrayOfStrings
    ],
    "skills_you_will_gain": [
        ArrayOfStrings
    ],
    "recent_views": Number,
    "learner_career_outcomes": [
        {
            "icon": String,
            "pct": Number,
            "outcome": String
        },
    ],
    "metadata": [
        {
            "icon": String,
            "title": String,
            "subtitle": String
        },
    ]
}

Response

Status: 200
Body: Record Added

POST:

Request

POST /api/about/:id

Body:
{
  "recent_views": Number
}

Response

Status: 200
Body: Record Updated

DELETE:

Request

DELETE /api/about/:id

Response

Status: 200
Body: Record Deleted

API_Performance

Local Testing

  • Using K6 I tested a Cassandra DB against a Postgres DB in local development
Database Requests Total Requests Latency (ms) % Status Code 200
Cassandra 10,000 RPS 600000 3420 87%
Postgres 10,000 RPS 60000 5026 79%
Cassandra 1,000 RPS 600000 52 99%
Postgres 1,000 RPS 60000 139 97%

Deployment

  • Deployed 3 cassandra nodes and 3 EC2 Micro instances behind an NGINX load balancer
  • Sustained 1,500 RPS to random routes at back 10% of db, tested wtih Loader.io

Screen Shot 2021-06-16 at 10 47 43 PM

SSR Deployment and Performance

Google PageSpeed insight score of 99

Screen Shot 2021-06-21 at 11 42 21 PM

Screenshot of deployed page Screen Shot 2021-06-20 at 10 41 30 PM

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 94.2%
  • CSS 5.0%
  • Other 0.8%