Week 3: Databases and Compose
Week 3: Databases and Compose
The app gets state. Reports go into MongoDB and a counter into Redis, and you learn what changes when the data has to survive a restart. Docker Compose runs the databases on your computer. They are not deployed to the server this week.
A full app on your computer that keeps its data. Do not tag in this week or the next: the server has no databases yet, so a deployed container would crash.
Issues
Work through the issues in order, in your own repository. Each one builds on the one before.
| Issue | What you do |
|---|---|
mongodb | Take a report through a form and keep it in MongoDB. |
list-reports | Show every report, newest first. |
redis-counter | Count the reports in Redis. |
docker-compose | One command starts MongoDB and Redis, with volumes so the data survives. |
Write the week report in report/week-3.md after the last issue.
Slide decks
Each deck is a self-study lecture of about 15–20 minutes, except the intro, which takes about five.
- Week 3 intro: what the week asks of you
- Data stores: document store and key-value store, stateful against stateless
- Docker Compose: one file for several containers, service names and environment parity
Reading material
docs/MONGODB.md,docs/REDIS.md,docs/DOCKER-COMPOSE.mdin your repo- MongoDB Node.js driver
- Redis documentation
- Docker Compose documentation