Sign inSign up

sharan10860/nosql-lab10

By sharan10860

•Updated 8 days ago

MongoDB Labs 7-10: Kavach CTI website, replica set, write concern and transactions

Image
Databases & storage
0

68

sharan10860/nosql-lab10 repository overview

⁠23CSE528 NoSQL Database using MongoDB - Labs 7 to 10

Student: M Nagasai Girisharan | Roll no: 24BTRCL114 | Class: 5 AIML-B Submission: Exercise 10 - Transactions, Atomicity, Durability and Journaling

One image that contains all four labs and a website for them (Kavach CTI). MongoDB itself comes from the official mongo:7.0 image in the compose file.

⁠What is inside

LabWhat it does
Lab 7Kavach CTI website, schema design, working set, auto-update every 5 minutes
Lab 83-member replica set, failover, elections, arbiter and priority activities
Lab 9Write concern latency (w:1, w:majority, w:all), journaling, network partition
Lab 10Multi-document transactions: bank transfer, inventory reservation, retry with backoff, throughput

⁠Lab dependency rule

Starting a lab starts the labs below it first: Lab 10 needs Lab 9 needs Lab 8 needs Lab 7 So starting Lab 10 runs Lab 7, then 8, then 9, then 10.

⁠How to run (only Docker Desktop is needed)

docker run --rm sharan10860/nosql-lab10 compose > docker-compose.yml
docker compose up -d lab10

Wait 3 to 5 minutes, then open http://localhost:8000/#/labs⁠

⁠Pages on the website

  • Lab control centre - chain 7 -> 8 -> 9 -> 10, live output, status
  • Replica set lab 8 - live members, verify replication, step down the primary
  • Write concern lab 9 - live benchmark of w:1, w:majority and w:all
  • Transactions lab 10 - bank transfer, rollback, conflict and retry demo, concurrent reservations, throughput chart

⁠Run Lab 10 on the command line

docker compose exec lab10 lab10 all     # everything + PDF report
docker compose exec lab10 lab10 10.1    # only Lab 10.1
docker compose exec lab10 lab10 10.2    # only Lab 10.2
docker compose exec lab10 lab10 bench   # throughput test

⁠Stop and clean up

docker compose down        # stop
docker compose down -v     # stop and delete the data

⁠Notes

  • Ports used: 8000 (website), 27017, 27018, 27019 (MongoDB).
  • Transactions need a replica set, so this stack runs 3 MongoDB servers.
  • Tags: latest (works on Intel and Apple Silicon).

Tag summary

Content type

Image

Digest

sha256:79b33b944…

Size

117.8 MB

Last updated

8 days ago

docker pull sharan10860/nosql-lab10