OLTP vs OLAP

Developed by S. Rathinagiri with Gemini

OLTP vs OLAP: At a Glance

OLTP 🏃‍♀️

  • Purpose: Day-to-day operations
  • Data: Real-time, current
  • Queries: Simple, fast (Read/Write)
  • Database: Row-based storage

OLAP 🧠

  • Purpose: Analysis & decision making
  • Data: Historical, aggregated
  • Queries: Complex, multi-dimensional
  • Database: Columnar storage

OLTP: Normalized & ER Diagrams

Highly normalized to reduce redundancy, often visualized with ER diagrams where central entities are linked to attributes.

Data Sorting & Primary Keys

Data is sorted by a primary key (like 'OrderID') for fast lookups, essential for transactional operations.

OLAP: Star Schema

Uses Star Schemas where a central fact table (like 'Sales') is surrounded by dimension tables.

Database Access Simulation

Click a button to start the simulation.

Disk (Row-Based)

Disk (Columnar)

OLTP: Entity-Relationship Diagram

Customers(PK) CustomerID...
Orders(PK) OrderID(FK) CustomerID...

OLAP: Star Schema

Sales Fact(FK)s...SalesAmount
DimCustomer(PK) CustomerID
DimProduct(PK) ProductID
DimDate(PK) DateID

From 2D Reports to a Sparse 3D Data Cube

Product Sales

Laptop (150)
Mouse (100)
Keyboard (80)

Monthly Sales

Jan (150)
Feb (80)
Mar (100)

Customer Sales

Cust A (100)
Cust B (150)
Cust C (80)
150
100
80
Product
Month
Customer

Multiple transactions are tracked across different reports.

} The final version of the infographic is available in the `OLAPConcept.html` file. Can you provide a detailed description of the file's contents and how it works?