Nowadays, practically all organizations can’t but accept big data streaming and processing as the most valuable resource to profit in their business. Due to
OLTP and OLAP are online processing systems to operate data of business environment. In this article, we are going to describe each system and its function whereupon you will see a comparison of both.
What is OLAP?
First of all what are those technologies about? Let’s try to figure it out together and define OLAP and OLTP first.
If you refer to the
OLAP software architecture includes two basic components:
- OLAP server: provides data storage, performing the necessary operations on it and the formation of a multidimensional model at the conceptual level.
- Online analytical processing client: presents the user with an interface to the multidimensional data model, providing him with the ability to conveniently manipulate data to perform analysis tasks.
The procedure of filling the OLAP system from the source systems takes place by
OLAP is usually divided into 3 types:
However, it’s better once to see then hear for one hundred times. So let’s now take a closer look at the example of OLAP and OLTP.
Example of OLAP
A simple example for a user would be an array containing data of the sales depending on territory and gender. The MDX query, in this case, would look the following way:
SELECT NON EMPTY VISUALTOTALS(HIERARCHIZE(HIERARCHIZE([Employee].[Gender].Levels(0).Members)), '* - Total**') DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CUSTOM_ROLLUP, UNARY_OPERATOR, KEY0, MEMBER_TYPE ON 0, NON EMPTY VISUALTOTALS(HIERARCHIZE(HIERARCHIZE([Sales Territory].[Sales Territory Country].Levels(0).Members)), '* - Total**') DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CUSTOM_ROLLUP, UNARY_OPERATOR, KEY0, MEMBER_TYPE ON 1 FROM [Adventure Works] CELL PROPERTIES BACK_COLOR, CELL_ORDINAL, FORE_COLOR, FONT_NAME, FONT_SIZE, FONT_FLAGS, FORMAT_STRING, VALUE, FORMATTED_VALUE, UPDATEABLE, ACTION_TYPE |
What is OLTP?
Continuing introduction to OLAP and OLTP we are moving to the second technology definition.
OLTP is generally compared to OLAP as both of the systems operate data. OLTP is short for Online Transaction Processing, which is typically marked by far less complex queries which are conducted in a larger volume. OLTP is to process a big number of online transactions, though short, in real time dealing with such kinds of queries as Read, Insert, Update and Delete.
The main goal for OLTP systems is to conduct rapid query processing, storing data integrity in multi-access environments. The efficiency is determined by a number of transactions per second. In order to conduct vast series of successful transactions in OLTP system, those transactions have to be atomic, consistent, isolated, and durable (ACID).
Example of OLTP
A query selects all issues owned by a user with ID=1 with statuses 'Resolved', 'Published', 'Closed', 'Done', sorts them, groups them by projects, and displays their number.
SELECT tab2.`key` AS project_key, tab1.`status` AS issue_status, COUNT(*) AS t_count FROM jira_issues AS tab1 LEFT JOIN jira__project AS tab2 ON tab1.project_id = tab2.id WHERE tab1.user_assigne = 1 AND tab1.`status` IN ('Resolved','Published','Closed','Done') GROUP BY project_key, tab1.`status` ORDER BY project_key |
Advantages and disadvantages of OLAP and OLTP
The next question is why are those systems so popular? Let advantages of OLAP and OLTP speak for themselves.
The system | Pros | Cons |
OLAP |
|
|
OLTP |
|
|
However, despite all the possible issues system can cause, advantages of OLAP and OLTP are higher than reasons to refuse of their using. Moreover, in some cases advantages of OLAP over OLTP are in greater number.
What about integration?
The frequent question business users ask: is the use of OLTP and OLAP on same server possible? The answer is yes, it is possible especially in such case as integration of OLAP and OLTP in ERP. However, it is important to take into account all possible challenges such integration can cause:
- OLAP database queries are often complex and time consuming. Direct access to the OLTP database significantly reduces the overall performance of the operating system;
- OLTP database does not store data in an aggregated, denormalized form, which is necessary for rapid analytical processing. Thus, OLTP to OLAP conversion of data during the execution of queries is too time consuming;
- Information for the past periods is lost when the OLTP database is updated (when new, up-to-date data is written into it). This impedes the implementation of time trend analysis, which is so important for many business areas;
- As a rule, there is no single enterprise-wide data model. In addition, when designing databases for an accounting system, different data models can be used (hierarchical, relational, object-oriented, flat files, “proprietary” models).
Difference between OLAP and OLTP databases
OLTP vs OLAP systems are in constant confrontation. As we have already mentioned OLTP handles transactions while OLAP serves as reporting for business intelligence. Whereas OLAP systems are mostly streamlined for reading, OLTP has to manage various kinds of queries: read, insert, update and delete. If OLTP needs to preserve transactions accuracy and integrity, it's not the purpose of OLAP. OLAP has a smaller group of users (executives, data scientists, marketers, managers) than OLTP systems and its interactions last longer. OLTP must be fast and sustained to mainstream plenty of transactions at a time, while OLAP ought to be large and powerful enough to encompass all relevant business data.
To define which system is better for you we need to compare characteristics of OLAP and OLTP. So let’s take a look at the difference between OLAP and OLTP in tabular form:
Category for comparison | OLAP system (Online Analytical Processing) | OLTP system (Online Transactional Processing) |
Purpose | To analyze the business: helps in decision-making, forecasting, planning, problem solving | To run the business: helps in business tasks management |
Data Source | Historical / archive data | Operational data |
Data Function | Multidimensional views of various business activities help planning, decision support | Running controlled business tasks, presenting an overview of ongoing business processes |
Inserts / Updates | Periodic long-running batch processes refresh the data | Short and fast inserts and updates carried out by end users |
Queries | Queries of any complexity | Simple queries |
Transaction speed | Depends on the amount of data | Very fast |
Space requirements | Vast because of aggregation structure | Relatively small |
OLTP vs OLAP Database design | Typically denormalized with fewer tables / star and snowflake schemas | Highly normalized with numerous tables |
Backup and Recovery | As a substitute for regular backups like in OLTP, some environments can offer to reload the data as a recovery method | Obligatory. The intelligence is crucial to run the business. Operational data loss can result in serious financial loss and legal liability |
Normalization | Tables are not normalized | Tables in the database are normalized in 3NF |
Integrity | Due to rare modifications, integrity is not affected | Maintaining data integrity constraint |
Users | Executives, CEO, data scientists | Programmers, database professionals, clerks |
Audience | Customer oriented | Market oriented |
As you can see, it is hard to say what is better OLTP or OLAP. It is all depends on your requirements and purposes of use. Talking about similarities of OLAP and OLTP both systems are aimed at daily business processes improvement and simplification.
How to get OLTP and OLAP systems?
We have already touched upon OLAP and OLTP definitions, pros and cons, difference between systems. Now it’s high time to know where to buy those great systems. Meet the list of top vendors and applications of OLAP and OLTP improvement:
- Micro Strategy
An enterprise analytics software that helps in decision-making and business improvements. Suggests forecasting and advanced analysis, real-time reports, SaaS, Big Data solutions.
- IBM Cognos
Interactive BI tool for sharing and analyzing data through the enterprise. Allows creating reports and dashboards.
- Ranet OLAP
A ready-to-use OLAP tool for reporting, analyzing, forecasting. Enables users to create reports of any complexity, so it can be utilized by different categories of specialists. Ranet OLAP offers
- Hadoop
Apache Hadoop is a group of software tools aimed to assist in the progress of computer problem-solving processes. The modules of Hadoop are developed with an idea that hardware breakdowns are commonplaces which should be managed by the framework. The frequent question is about possibility to work with OLAP and OLTP in Hadoop. However, Hadoop is more related to OLAP technology and combination of these systems leads to the number of business improvements.
- MySQL
The world's most popular open source database. Due to its proven performance, reliability and ease of use, the MySQL database is most commonly used for web applications.
Thread: OLAP and OLTP interview questions
Our OLAP and OLTP tools discussion is slowly moving to the end. However, before drawing the bottom line, we’d like to highlight the top questions users ask regarding the systems:
What are OLAP and OLTP?
OLAP or Online Analytical Processing is a technology that analyzes a large amount of data kept in a data warehouse. In OLAP environment all the data performed in multidimensional cubes, enabling users to detail, consolidate, and rotate it so that to see it from various perspectives and analyze trends.
OLTP stands for Online Transaction Processing, which is typically marked by far less complex queries which are conducted in a larger volume. OLTP is to process a big number of online transactions, though short, in real time dealing with such kinds of queries as Read, Insert, Update and Delete.
What is the difference between OLAP and OLTP?
As we’ve already mentioned OLAP database vs OLTP are in frequent contradiction. Let’s finally draw the line between them. The core differences between OLTP database and OLAP database are:
- OLTP handles transactions while OLAP serves as reporting for business intelligence;
- Whereas OLAP systems are mostly streamlined for reading, OLTP has to manage various kinds of queries: read, insert, update and delete;
- If OLTP needs to preserve transactions accuracy and integrity, it's not the purpose of OLAP;
- OLAP has a smaller group of users (executives, data scientists, marketers, managers) than OLTP systems and its interactions last longer. OLTP must be fast and sustained to mainstream plenty of transactions at a time, while OLAP ought to be large and powerful enough to encompass all relevant business data.
Which system is better?
The answer is neither. To be precise, OLTP and OLAP databases have a bit different purposes:
- OLAP purpose is to analyze the business. It helps in decision-making, forecasting, planning, problem solving;
- OLTP purpose is to run the business, it helps in business tasks management
So, as you can see it all depends on your needs.
Is it possible to implement OLAP and OLTP together?
Yes, it is possible, but can cause some difficulties as the databases are different and do not complement each other. One of them will be blocked. Besides the following difficulties can be caused:
- Direct access to the OLTP database significantly reduces the overall performance of the operating system;
- OLTP to OLAP conversion of data during the execution of queries is too time consuming;
- Information for the past periods is lost when the OLTP database is updated (when new, up-to-date data is written into it).
How to transfer data from OLTP to OLAP?
There are two basic concepts:
- Full synchronization: this method synchronizes data from the entire table to the corresponding OLAP table each time;
- Incremental synchronization: this procedure synchronizes the changed data with the corresponding OLAP table each time.
Conclusion
OLTP is a system to modify data online whilst OLAP is an online multidimensional data retrieval system, which extracts the data that can help in business to analyze the performance, develop strategies and make decisions. OLTP system is a provider of data for OLAP environment. The systems are functional to different objectives but both of them help deal with a big amount of data. OLAP is up to let you figure out places, time and reasons your clients buy, foresee market tendencies and future requirements thanks to data mining and analysis, whereas OLTP can grant your clients with personalized loyalty programs and provide them with a credible service.