Home

Writeback

Writeback is a caching and data-management technique in which modifications to data are written to a fast cache or buffer first and are written to the backing storage later. The main goal is to improve write performance and reduce contention on slower storage by batching writes and keeping frequently changed data in fast memory. Writeback is contrasted with write-through, where every write to the cache is immediately and synchronously written to storage.

In hardware caches, a write-back cache stores modified blocks as dirty entries. A block is marked dirty

Writeback is also employed in storage controllers, operating systems, and certain database systems to optimize I/O

Advantages of writeback include higher write throughput, lower latency for individual writes, and reduced wear on

when
written,
and
the
actual
write
to
main
memory
or
to
disk
occurs
when
the
block
is
evicted,
when
a
flush
is
triggered,
or
at
scheduled
intervals.
This
reduces
write
bandwidth
and
memory
traffic
and
can
improve
overall
throughput,
but
it
increases
the
risk
of
data
loss
if
power
is
lost
before
the
cache
is
flushed.
The
risk
is
mitigated
by
using
non-volatile
memory
or
power-loss
protection
such
as
battery-backed
caches.
performance.
In
these
contexts,
a
cache
may
defer
writes
to
the
underlying
storage
and
consolidate
multiple
updates.
While
this
can
boost
latency
and
throughput,
it
requires
careful
handling
of
data
durability
and
cache
coherence
to
avoid
inconsistencies
during
failures
or
crashes.
backing
storage.
Disadvantages
include
potential
data
loss
on
power
failure,
increased
complexity
for
ensuring
data
integrity,
and
more
complex
recovery
procedures
after
crashes.
Related
concepts
include
write-through
caching
and
asynchronous
write-behind
strategies.