Professional Documents
Culture Documents
Oltp vs. Olap and How Do They Connect To SAP?: Last Updated On January 21, 2020
Oltp vs. Olap and How Do They Connect To SAP?: Last Updated On January 21, 2020
Oltp vs. Olap and How Do They Connect To SAP?: Last Updated On January 21, 2020
inui.io
SAP
Last updated on January 21, 2020
In this article, you’ll learn what the differences are between OLTP and OLAP and
how they connect to SAP.
Contents
How to OLAP vs. OLTP and SAP
What Is a Database?
What Is a Database Management System?
What Is a Relational Database Management System?
What Is a Data Warehouse?
What Is Online Transaction Processing?
What Is Online Analytical Processing?
Differences between OLTP and OLAP
OLTP, OLAP, and SAP
As these names indicate, the difference between them is how they are used.
OLTP and OLAP describe two different types of databases and two different ways of
processing data.
Because the data is used differently, it is also structured differently in the database.
These are the kinds of requests to the database from applications used in standard
business operations, such as maintaining sales orders.
These are the kinds of requests to the database from applications used for business
intelligence and data mining.
To understand the differences between OLTP and OLAP and how they function in
SAP, you’ll need to begin by understanding these terms:
DB (Database)
DBMS (Database Management System)
RDBMS (Relational Database Management System)
DW (Data Warehouse)
OLTP (Online Transaction Processing)
OLAP (Online Analytical Processing)
What Is a Database?
A database (DB), also called a database system, is a collection of structured data
and software to access that data (the DBMS, or database management system).
The actual database consists of just the data in a database system, which is
managed by the DBMS.
animal names,
zoo areas,
zookeeper wages, and
etc.
The DBMS
The DBMS organizes the structured storage of the data and controls all reading and
writing access to the database.
In order to make a request of the DBMS, they must format their request in the
language that the particular DBMS uses.
You have an application to manage the zoo animals, and you add a new animal in
the application:
1. The application takes the provided animal data and sends it to the application
server.
2. The application server translates the request to save the data into the
database system into the DBMS language and then sends it to the DBMS.
3. Finally, the DBMS puts the animal data into the database.
This means that the data is grouped in logical units in tables, and those units link to
each other using keys.
The tables have relations with each other through the keys.
DBMSs are made to retrieve and store data with the presence of redundant data.
RDBMSs are made to retrieve and store data on a data basis without the presence
of redundant data.
Let’s say that you would like to save the zoo animals according to their zoo area.
In a so-called flat and non-relational database, you would save all animals and their
zoo area together in one table, like this:
But in a relational database, you would save the animals and the zoo areas as
logical units in separate tables.
Each entry in the animals table would have a key that points to an entry in the zoo
areas table.
The keys relate to each animal entry with an entry in the zoo areas table.
The process of structuring data that belongs logically together in a database into
separated tables is called normalization.
Here is the animals table with relations via the zoo area ids to the zoo areas table:
ID Zoo Area
1 Water
2 Desert
3 Mountain
4 Snow
There are two key advantages of a relational database over a flat database that
saves all data in one table:
Let’s say that you would like to add zookeepers to the database, along with the
animals and zoo areas.
You want this to include information about who is responsible for which animal and
therefore works in which zoo area.
In a flat (not relational) database, you would have to extend your one table with the
data about the zookeepers.
The table already holds the data about your animals and zoo areas. The table gets
more and more packed, complex, and redundant.
In a relational database, you would just add a new table for the zookeepers, and use
a key to relate the entries of the zoo area tables to the zookeeper table.
The key relates each entry in the zoo area table with an entry in the zookeeper table:
Now you know which zookeeper is responsible for which zoo area through the
relation of the zookeeper table to the zoo area table.
Plus, you know which zookeeper is responsible for which animal through the relation
of the zookeeper table through the zoo area table to the animal table.
In comparison to a DBMS and one single table, an RDBMS and its multiple related
tables are less packed, less complex, and do not have any redundancies.
Tables in an RDBMS are well structured and make sense for a human through their
logical groupings, such as animals, zoo areas, and zookeepers.
A data warehouse extracts, transforms, structures, and finally stores data from
operational databases and external sources.
data consolidation,
analysis,
and reporting, including the aggregation of data.
You are thinking about closing your zoo for a month because you want to go on
vacation to Hawaii.
However, you are not sure which month would be the best month to close your zoo
in terms of revenue.
You use an analytical application that is connected to a DW to get the net value of all
sold zoo tickets for each month over the past two years.
Then you can pick the month with the least net value of sold tickets for your vacation
to Hawaii.
These requests are by far the most frequently used in business operations, such as
managing sales and other interactions.
Operational requests are not requests from applications that are used for analytics
such as decision support.
OLTP systems are designed to serve data to operational applications that access the
database by providing fast and consistent processing of the applications’ requests.
transactions, and
processed online.
This means that after the request is processed successfully, the request leaves the
database consistent.
Consistent, in turn, means that the data is changed only in a way allowed by the
database, so that data integrity remains intact.
Either a transaction successfully executes, or it is rolled back until the database has
the same status as if the transaction had never been executed.
Therefore, if a transaction is aborted during its processing, then all the transaction
changes in the database until its abortion must be undone.
At each zoo area’s entry is a note with the vacation times of the zoo area.
Each zoo area and the animals inside of it get four weeks of vacation in a year,
during which the area is closed to visitors.
Let’s take some liberties and say that the animals can decide on their own when they
want their zoo area closed so they can take their vacations.
The hawk from the desert zoo area decides to take two weeks of vacation from
January 01, 2019 to January 14, 2019.
The hawk communicates its vacation to Michael, the zookeeper for the zoo’s
mountain area.
Michael then records the vacation in the mountain area’s vacation note.
write January 01, 2019 into the field vacation from for Chad the hawk.
write January 14, 2019 into the field vacation to for Chad the hawk.
end of the transaction.
That is a valid transaction that leaves the vacation note in the database consistent.
But imagine that the above transaction gets aborted before Michael has written to
the “vacation to” field: the zoo area gets closed but never reopened again.
If this note were left in the database and its instructions followed, this would cause
some problems.
When a transaction is aborted, all its changes done in the database must be rolled
back to retain the consistency of the database.
Let’s look at another scenario: it’s now June, and Chad the hawk took two weeks of
vacation in January, and another two in April.
If zookeeper Michael did not read the field “remaining vacation” before entering any
vacation requests, Chad the hawk could take as much vacation as he wants, even
though he’s already used up his four weeks of vacation per year.
The transaction again would not be a transaction but a mere request, because the
request would not be consistent.
The transaction would violate the custom integrity rules of the note, which say that a
zoo area has overall only four weeks vacation in a year.
The “online” in OLTP means that the transactions in an OLTP system are processed
in real-time, without any delay.
The data is processed as soon as the request is made and gives an answer as fast
as possible.
An ATM is a good example: as soon as you confirm your PIN code, the ATM checks
immediately if the entered PIN code is correct, and then allows you to proceed with
your transactions.
An example of this is a program to optimize images: during the day, new images get
uploaded by users to a server, and at night, when the workload of the server is
lower, the program optimizes the new images on the server in a batch.
The results are then available the next day when the processing is complete.
Real-time processing requires constant user interaction: the user interacts with an
application, the application fires the request up to the database, the database
processes the request, and it fires a response back to the application.
The user starts the batch process, and the system processes the batch until it is
finished.
The other option is that the user schedules a batch request, and the system
processes the batch automatically.
In this time, data and programs were stored on punch cards, and those punch cards
were read and processed in batches, often at night.
These are requests from applications that are used for decision support, such as an
application to analyze the aggregated net value of sales orders per month or the
average empty seats on flights overall.
analytical, and
processed online.
An OLAP database is made to analyze data and thus to answer questions about the
data.
For example, you, as the zoo owner, would like to know all about your zoo, such as:
What is the net value of all sold tickets for last year?
What is the average amount of food that each zoo animal has eaten last
month?
Who is the zookeeper with the most overtime overall?
Therefore, it does not use any of the computation power of an operational database
to answer analytical requests and thus does not slow down the day-to-day-business
applications.
The online in OLAP means the same as online in OLTP: the requests to the
database are processed in real-time, without any delay.
Data is processed as soon as the request is made, and the results of the requests
are made available as quickly as possible.
Data from these databases have traditionally been extracted into OLAP databases,
used in SAP NetWeaver Business Warehouses.
But the future is bright in the world of SAP: SAP’s own database called HANA
combines the functions of OLTP and OLAP systems in a single database.
In-memory means that the data does not reside on a hard drive, to be loaded into the
memory only when it is needed for processing or analysis.
Because the data resides permanently in memory, and therefore no hard drive
access is necessary, a HANA database is super fast.
Therefore, OLTP and OLAP requests can be processed altogether in a single HANA
database.
SAP’s newest generation of ERP and CRM applications use HANA, such as