Home

masterdetail

Master-detail is a data relationship pattern in which one record acts as the parent (master) and one or more records act as the child (detail). The detail records depend on the master for identity and often for security, ownership, and lifecycle. In many implementations, the detail table contains a foreign key that points to the master, and the master controls or constrains the existence of its details. A common characteristic is cascade behavior: deleting the master typically deletes its associated details, ensuring referential integrity. By contrast, a lookup relationship allows the child to exist independently and does not imply the same tight coupling or cascade deletion.

Key features commonly associated with master-detail designs include referential integrity, where detail records cannot exist without

Common use cases involve assemblies of items where a single parent aggregates multiple children, such as an

In practice, master-detail is often contrasted with the simpler lookup relationship, where records remain more independent

a
corresponding
master;
ownership
and
access
rights
that
often
flow
from
the
master
to
its
details;
and
the
ability
to
summarize
detail
data
on
the
master
through
roll-up
capabilities,
such
as
counting
or
aggregating
detail
records.
In
certain
platforms,
the
master
also
determines
the
visibility
of
the
detail
records
and
can
simplify
management
of
related
data.
invoice
with
line
items,
an
order
with
order
lines,
or
a
project
with
tasks.
The
pattern
is
widely
used
in
relational
databases
and
in
application
platforms,
with
minor
variations
in
constraints
and
feature
sets.
When
choosing
between
master-detail
and
other
relationships,
considerations
include
dependency
needs,
lifecycle
semantics,
and
performance
implications.
and
do
not
automatically
cascade
deletes
or
share
a
single
ownership
model.