Skip to content

MedusaJS Dropped the Foreign Keys Between Its Modules: The defineLink Gamble

7.5 relevance
Score Breakdown
technical depth
9
novelty
9
actionability
6
community
6
strategic
5
personal
7

Scored daily by a customisable AI persona to surface the most relevant engineering leadership news.

Bold architectural decision in e-commerce framework, insightful.

General dev.to
MedusaJS Dropped the Foreign Keys Between Its Modules: The defineLink Gamble
Summary

MedusaJS 2.0 eliminated foreign keys between its 20+ commerce modules, using defineLink to create link tables that decouple data models at the database level. Each module remains isolated with its own services and migrations, defaulting to a shared Postgres but enabling per-module datastore swaps. The architecture prioritizes modular portability over relational integrity, a deliberate trade-off for a customizable commerce platform.

Author

Andrii B.

More from Andrii B. →