All labs
Lab 5
Microservices

The Join Problem — One Query, Many Databases

A simple JOIN that takes 8ms in the monolith becomes impossible across separate databases. Try the three real fixes — API composition, a CQRS read model, and the shared-schema escape hatch.

The question to answer: “Show each learner with the courses they’re enrolled in and the total they’ve paid.”
Needs data from 3 capabilities: Identity (users) · Enrollment (courses) · Payment (amounts).
One database — three tables
🗄️ educonnect_db
👤
users
🎟️
enrollments
💳
payments
SELECT u.name, c.title, SUM(p.amount)
FROM users u
JOIN enrollments e ON
JOIN payments p ON
Result
Press “Run the JOIN” — it just works.
What just happened