Skip to content

PoC: database with MongoDB

Checks whether MongoDB fits the AREA data: users, workflows with a variable number of nodes, deduplicated hook events and stored OAuth tokens. It serves the persistence selection document. This PoC and pocs/database-postgresql/ reach the same target, so the two can be compared.

  • Author: Ethaniel
  • Date:
  • Timebox: 45 minutes
  • Why this timebox: the same for both database PoCs; long enough to start a database in Docker and run a short script, short enough to leave time for the selection document before the Plan defense.
  • Time actually spent:
  • Stack: MongoDB in Docker Compose, a Python script with pymongo

Target

The same for both database PoCs.

  • The database starts with docker compose up, its data kept in a named volume
  • The connection string is read from the DATABASE_URL environment variable, not a literal in the source
  • A schema (or collections) for users, workflows, workflow nodes and processed hook events
  • A script saves one user and one workflow with a trigger, a condition and 4 reactions, then reads the nodes back in order; nothing in the model limits the number of reactions to 4
  • Saving the same hook event twice (same subscription, same external id) is rejected by the database
  • After docker compose down then up (without -v), the data is still there
  • An OAuth token is stored encrypted, not in clear text (bonus)

Where I was when the time ran out

What took the most time

What it would take to go further

Running the PoC


Evidence

How the target was checked: the script output, the error raised by the duplicate event, the data after a restart.

Impressions

What felt good, what got in the way, and what it suggests for AREA (relations between users, services and workflows, transactions, deduplication, migrations, Docker).