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.

IssueWhat you do
mongodbTake a report through a form and keep it in MongoDB.
list-reportsShow every report, newest first.
redis-counterCount the reports in Redis.
docker-composeOne 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