Skip to content
Part IA Michaelmas Term

Redundancy, Consistency, Throughput, OLAP and OLTP

The redundancy/consistency/throughput trade-off

The relationship between redundancy, consistency, and throughput can be illustrated along a spectrum:

Database Workload Tradeoff Spectrum: contrasting normalized OLTP (write-optimized) and denormalized OLAP (read-optimized) database designs

  • Low redundancy: need only lock a few data items per update. Write throughput is high. Consistency is strong.
  • High redundancy: fewer files or blocks need be accessed per query. Read latency is low. Consistency is relaxed.

Read-oriented databases

Introducing data redundancy can speed up read-oriented transactions at the expense of slowing down write-oriented transactions.

Database indexes demonstrate this point clearly. An index is redundant data (it duplicates key values from the base table) that speeds up reads but must be maintained on every write. Each INSERT, UPDATE, or DELETE incurs additional work to update the index structures.

StructureRead effectWrite effect
B-tree indexFaster key lookups (O(logn)O(\log n) vs. O(n)O(n))Must update index on every write
Materialised viewPrecomputed query results, instant readsMust refresh after base table changes
ReplicaReads distributed across copiesAll copies must be kept in sync

OLAP vs. OLTP

Databases are broadly categorised by their primary workload:

OLAP: Online Analytical Processing

CharacteristicDescription
Write patternWrite once, or journal/ledger updates
Associated withDecision support, data warehousing
Data typeHistorical data
Access patternMostly reads
OptimisationOptimised for reads
Data redundancyHigh

OLTP: Online Transaction Processing

CharacteristicDescription
Write patternRich mix of queries and updates to live data
Associated withDay-to-day operations
Data typeCurrent data
Access patternMostly updates
OptimisationOptimised for updates
Data redundancyLow

The ETL pipeline

Data flows from operational systems to analytical systems through an ETL pipeline:

OLTP  ----Extract---->  Transform  ----Load---->  OLAP
(live, normalised)                             (historical, denormalised)
  1. Extract: pull data from OLTP databases.
  2. Transform: clean, reshape, and aggregate the data. This is where denormalisation and redundancy are introduced to optimise for analytical queries.
  3. Load: insert the transformed data into the OLAP system (data warehouse).

Update history

An update to a relational database occludes the previous value of a field. The old value is overwritten and lost.

A revision control system (like Git) stores the update history — an additional dimension. Even for OLTP systems, an update history within a limited time horizon is stored for ACID durability (via write-ahead logs).

SystemHistorical state
Relational DBMSOnly current state (previous values overwritten)
Version controlFull history of every change
OLTP with WALRecent history maintained for crash recovery

Further concepts (no longer on syllabus)

  • Data cube model: multi-dimensional views of data for OLAP.
  • Embedded databases (FIDO = Fetch Intensive Data Organisation): read-optimised snapshots extracted from a normalised database, stored on devices for fast local queries.

Summary

  • Low redundancy optimises for writes; high redundancy optimises for reads.
  • Indexes are a form of controlled redundancy.
  • OLAP systems prioritise reads and use high redundancy.
  • OLTP systems prioritise writes and use low redundancy.
  • ETL pipelines bridge the gap between OLTP and OLAP.