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.
- A customer buys two notebooks. The application checks stock and records the order: this is operational work.
- Within an appropriate database transaction, related database changes succeed together or are rolled back together. A transaction is one logical unit of work.
- A data pipeline brings the order into the analytical environment.
- At month end, a query adds notebook sales across many orders: this is analytical work.
- 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.
| Request | Type | Why |
|---|---|---|
| Change order 101’s delivery address | OLTP | A small operational change |
| Reserve one notebook | OLTP | An immediate application action |
| Calculate monthly sales by product | OLAP | A summary across many records |
| Compare return rates over two years | OLAP | Historical comparison |
Compare the design priorities
These are common workload patterns, not absolute product restrictions. Operational systems can run reports, and warehouses can change data.
| Question | OLTP focus | OLAP focus |
|---|---|---|
| What work is common? | Small targeted reads and writes | Broad reads, joins and summaries |
| What time period matters? | Current application state | Current data plus useful history |
| What does success look like? | Correct actions with quick responses | Correct, useful analytical answers |
| Example | Confirm one purchase | Find 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.
Operational database vs data warehouse
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
- Checkout
One customer needs one order recorded correctly.
- Pipeline
Copy and prepare records for reporting. The reporting system may be behind the source.
- 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.
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
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 →