Coursera About Service Contains a description of the course, along with some strategic goals and possible outcomes of taking the course.
- https://github.com/SDC-Builder/Tim-Proxy-Server
- https://github.com/SDC-Builder/Tim-About-Service
- Run
npm install
from the root directory to install dependencies - From within the
database
directory, runcsvCreator.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
/api/about/:id
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
},
]
}
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
Request
POST /api/about/:id
Body:
{
"recent_views": Number
}
Response
Status: 200
Body: Record Updated
Request
DELETE /api/about/:id
Response
Status: 200
Body: Record Deleted
- 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% |
- 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
Google PageSpeed insight score of 99