2.25.2015

OLTP vs. OLAP

We can divide IT systems into transactional (OLTP) and analytical (OLAP). In general we can assume that OLTP systems provide source data to data warehouses, whereas OLAP systems help to analyze it.

olap vs oltp



OLTP (On-line Transaction Processing):

-  This system is characterized by a large number of short on-line transactions (INSERT, UPDATE, DELETE).

- OLTP System deals with operational data. Operational data are those data  involved in the operation of a particular system.

- In an OLTP system data are frequently updated  and queried. So quick response to a request is highly expected. Since the OLTP systems involve large number of update queries, the database tables are optimized for write operations.

- The main emphasis for OLTP systems is put on very fast query processing, maintaining data integrity in multi-access environments and an effectiveness measured by number of transactions per second.

- To prevent data redundancy and to prevent update anomalies the database tables are normalized (usually 3NF). Set of tables that are normalized and fragmented. Normalization makes the write operation in the database tables more efficient.

Example: In a banking System, you withdraw amount from your account. Then Account Number, Withdrawal amount, Available Amount, Balance Amount, Transaction Number etc are operational data elements.


OLAP
(On-line Analytical Processing):

- This system is characterized by relatively low volume of transactions.

- In OLAP database there is aggregated, historical data, stored in multi-dimensional schemas (usually star schema).

- Updates are very rare in a Data warehouse. OLAP quiries will give aggregated information about the things happend in the past over a period of time and this will help the management in strategic decision making. Hence OLAP Queries are of  having  significant importance in strategic decision making.

Example: If we collect last 10 years data about flight reservation, The data can give us many meaningful information such as the trends in reservation. This may give useful information like peak time of travel, what kinds of people are travelling in various classes (Economy/Business)etc.


The following table summarizes the major differences between OLTP and OLAP system design.




OLTP OLAP
Application Operational: ERP, CRM, legacy apps, ... Management Information System, Decision Support System
Typical users Staff Managers, Executives
Horizon Weeks, Months Years
Refresh Immediate Periodic
Data model Entity-relationship Multi-dimensional
Schema Normalized Star
Emphasis Update Retrieval

  
Another  table to understand the differences -

OLTP System
Online Transaction Processing
(Operational System)

OLAP System
Online Analytical Processing
(Data Warehouse)

Source of data
Operational data; OLTPs are the original source of the data.
Consolidation data; OLAP data comes from the various OLTP Databases
Purpose of data
To control and run fundamental business tasks
To help with planning, problem solving, and decision support
What the data
Reveals a snapshot of ongoing business processes
Multi-dimensional views of various kinds of business activities
Inserts and Updates
Short and fast inserts and updates initiated by end users
Periodic long-running batch jobs refresh the data
Queries
Relatively standardized and simple queries Returning relatively few records
Often complex queries involving aggregations
Processing Speed
Typically very fast
Depends on the amount of data involved; batch data refreshes and complex queries may take many hours; query speed can be improved by creating indexes
Space Requirements
Can be relatively small if historical data is archived
Larger due to the existence of aggregation structures and history data; requires more indexes than OLTP
Database Design
Highly normalized with many tables
Typically de-normalized with fewer tables; use of star and/or snowflake schemas
Backup and Recovery
Backup religiously; operational data is critical to run the business, data loss is likely to entail significant monetary loss and legal liability
Instead of regular backups, some environments may consider simply reloading the OLTP data as a recovery method