X
Excel Zero to Hero Interactive Learning Platform
0%
Core Concept

OLTP vs OLAP Architecture

intermediate Status: Active

OLTP vs OLAP Architecture

A core distinction in data engineering is the separation between operational transaction systems (OLTP) and analytical decision-support systems (OLAP).


1. Comparison Matrix

Architectural Dimension OLTP (Online Transaction Processing) OLAP (Online Analytical Processing)
Primary Objective Fast, reliable execution of daily transactions Fast execution of complex aggregation queries
User Base Front-end apps, clerks, customers, APIs Analysts, data scientists, executives
Database Design Highly Normalized (3NF / BCNF) to prevent update anomalies Denormalized (Kimball Star Schema, Snowflake)
Workload Pattern High frequency of small, targeted INSERT, UPDATE, DELETE Large, infrequent bulk INSERT (ETL) and heavy SELECT
Query Complexity Simple point lookups (e.g. WHERE OrderID = 10248) Multi-table joins across millions of rows with GROUP BY
Data Scope Current operational state, recent history Multi-year historical trends, snapshots, SCDs
Storage Layout Row-oriented storage (optimized for single row mutations) Columnar storage (e.g. VertiPaq, Parquet, xVelocity)
Example Database AdventureWorks2022, Northwind AdventureWorksDW2022, Power Pivot Data Model

2. Structural Schema Differences

OLTP: Normalized (Snowflaked) Relationships

To query order revenue by product category in an OLTP database, an analytical query must traverse multiple tables:

SQL
SalesOrderHeader -> SalesOrderDetail -> Product -> ProductSubcategory -> ProductCategory

Every additional join consumes CPU and memory.

OLAP: Star Schema (Direct Fact-Dimension Joins)

In an analytical star schema, the measure table (FactInternetSales) connects directly to the dimension:

SQL
FactInternetSales -> DimProduct (contains Category and Subcategory attributes denormalized)

Analytical queries require only a single hop, optimizing columnar compression and aggregations.

← Back to All Concepts