Skip to content
Ameen Abozaid
Planned lessonMID-025-L06

Demo: splitting Shop's shared database

  • Lesson 6 of 6
  • Mid-level
On This Lesson 3 topics

This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.

In this lesson

separate schemas per service. Prepares MID-025-LAB1.

Draft outline details

Step by step

  1. Map every table to an owner and list queries that cross owners (for example a join of orders and products).
  2. Create separate schemas and database users: orders, inventory, payments.
  3. Replace the cross-owner join with a snapshot in order_lines and a call to inventory's API for stock.
  4. Migrate data and move Flyway migrations into each service.
  5. Planned mistake: give orders read access "just for reporting" on inventory's table. Show how a column rename in inventory breaks it, then revoke and use an event feed instead.
  6. Document the context map and data ownership table in the repo.

Practice

Apply this lesson with the module's lab, exercises and quiz.

Lab and exercises Quiz

Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.

Type to search levels, phases, modules and lessons.