Understanding modern data warehouses

Operational database vs data warehouse

Compare transaction processing with analytical workloads using a workload switcher.

Module 1 · Lesson 2 of 6BeginnerAbout 20 minutes
Your learning goal

Choose an appropriate workload pattern for checkout transactions and historical analysis.

First, understand the meaning

An operational database supports the daily actions of an application. It stores the records needed to place an order, change an address or reserve an item. A data warehouse supports analysis: it helps us study many records and understand patterns.

OLTP means Online Transaction Processing. It describes many small operational reads and changes. OLAP means Online Analytical Processing. It describes questions that read and summarize data. The important difference is the kind of work, not simply whether the system is on the internet.

Picture it in everyday life

Think of a supermarket checkout and its monthly sales report. The checkout must record one purchase correctly while the customer waits. The monthly report studies thousands of purchases to find which products sell best. Both use sales data, but they do very different jobs.

Why do we need this?

The customer cannot wait several minutes for a stock reservation. At checkout, fast individual responses and correct updates matter. Meanwhile, a manager might accept a longer report calculation if it gives a correct summary of the entire year.

Running a very large report on the same resources as checkout can make the two kinds of work compete. Many businesses therefore feed a separate analytical system from the operational system. Moving the data takes work and can introduce a delay.

Let us follow it step by step

Follow one order through both kinds of processing.

  1. A customer buys two notebooks. The application checks stock and records the order: this is operational work.
  2. Within an appropriate database transaction, related database changes succeed together or are rolled back together. A transaction is one logical unit of work.
  3. A data pipeline brings the order into the analytical environment.
  4. At month end, a query adds notebook sales across many orders: this is analytical work.
  5. The manager uses the result to decide what to restock.

Worked example: one record versus many records

“Show order 101” finds one particular record. “What was the average order value last year?” reads many records and calculates a summary. That summary operation is called aggregation.

Worked example: one record versus many records
RequestTypeWhy
Change order 101’s delivery addressOLTPA small operational change
Reserve one notebookOLTPAn immediate application action
Calculate monthly sales by productOLAPA summary across many records
Compare return rates over two yearsOLAPHistorical comparison

Compare the design priorities

These are common workload patterns, not absolute product restrictions. Operational systems can run reports, and warehouses can change data.

Compare the design priorities
QuestionOLTP focusOLAP focus
What work is common?Small targeted reads and writesBroad reads, joins and summaries
What time period matters?Current application stateCurrent data plus useful history
What does success look like?Correct actions with quick responsesCorrect, useful analytical answers
ExampleConfirm one purchaseFind annual sales trends

Before you move on

OLTP helps the business perform an action; OLAP helps people understand many actions. Also separate query speed from data freshness: a report can open quickly and still show yesterday’s data.

Interactive explainer1 / 3

Operational database vs data warehouse

Find item
Reserve stock
Confirm order

Checkout

One customer needs one order recorded correctly.

Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.

Read the complete diagram explanation
  1. Checkout

    One customer needs one order recorded correctly.

  2. Pipeline

    Copy and prepare records for reporting. The reporting system may be behind the source.

  3. Report

    Read many orders to calculate a monthly total.

Important terms

OLTP
Many focused operations that keep an application working.
OLAP
Queries that compare and summarize data for analysis.
Transaction
A logical unit of database work that commits or rolls back together.
Aggregation
Combining many records into a total, count, average or another summary.
Put it into context

A practical example

Looking up order #201 is an operational request. Comparing average order value for all regions over twelve months is an analytical request.

Production tip

Measure the required response time and freshness separately. A daily finance report and a live stock reservation have different needs.

Common mistake

Do not assume moving checkout tables into a warehouse automatically makes the warehouse the right checkout database.

Check your understanding

Which request is primarily analytical?

Practice challenge

Classify a password reset, a monthly returns report and a stock reservation. Explain one choice.

Compare your reasoning

Password reset and stock reservation are operational. The monthly returns report is analytical because it summarizes many historical records.

What to remember

OLTP helps the business perform an action; OLAP helps people understand many actions. Also separate query speed from data freshness: a report can open quickly and still show yesterday’s data.

Revisit this concept in Visual Labs →