Introduction to SAP HANA - 1

This is the first post in a 6 part series of SAP HANA. This article aims to provide an in-depth explanation of SAP HANA along with its architecture and unique features.

This article will cover the following topics:

  • What is SAP HANA?
  • Dimensions covered by SAP HANA
  • SAP HANA Architecture
  • Row & column store
  • In-memory (Code pushdown)
  • Basics of migrating ABAP code to SAP HANA

So let's begin with the most fundamental question.


What is SAP HANA? 

SAP HANA stands for High-Performance Analytic Appliance. As the name suggests, this is a flexible application that uses an in-memory(Main memory/ RAM) database that allows the processing of massive amounts of data in real-time.

Unlike other RDBMS which uses the traditional approach of OLAP(Online Analytic Process) and OLTP(Online Transactional Process), SAP HANA consolidates OLAP and OLTP into HTAP(Hybrid Transactional Analytic Platform). HTAP leverages the power of in-memory(Main memory/ RAM) computing to bring OLTP & OLAP onto one platform.  The image below represents the comparison of the traditional approach vs SAP HANA approach.  
Difference between traditional database and SAP HANA database
Initially while using the traditional approach, OLTP & OLAP were both located into separate platforms and they were linked through the interface. And hence there was always data movement from OLTP to OLAP. To avoid this, HTAP came into the picture. HTAP supports OLTP and OLAP processing on the same data set, significantly reducing the complexity of moving data from different platforms and costs.

The goal of SAP HANA is to reduce redundancy. Due to HTAP, this approach works on the same single copy of data for any requirement.


Dimensions covered by SAP HANA

Listed below are the six important dimensions that need to be covered for any business scenario. They are 
  1. Real-time data (Recent data)
  2. High speed (Fast responsible time)
  3. Any data source (Structured or unstructured data)
  4. Simple( No processing data, no aggregates)
  5. Complex data 
  6. Cost
Although traditional Databases attempt to cover all these six dimensions as above, they tend to lack a few and hence they are inefficient. Traditional databases always have to choose between two things:
  1. Developing an application that requires high speed and which does not require any aggregates 
       OR

      2. Developing the application that uses real-time data and which is cost-efficient.

Here SAP HANA comes into the picture as an advanced database. It tries to cover all six dimensions. 
Features of SAP HANA

SAP HANA Architecture

SAP HANA database consists of multiple servers namely Index Server, Name Server, Statistics Server, Preprocessor Server, and XS Engine. The most important component is the Index Server.  SAP HANA Database High Level Architecture
                                                      Image Source

INDEX SERVER
  • This is the main component of SAP HANA Architecture
  •  It contains the actual data and the engines which are responsible for processing the data
  • The Index Server processes the queries in different languages such as SQL or MDX
  • This layer consists of one portion that is responsible for transaction logs
PERSISTENCE LAYER
  • This layer is the part of the Index Server which is responsible for the durability and atomicity of transactions
  • This ensures whether the transactions are completely done or completely undone
 PREPROCESSOR SERVER
  • This server is responsible for analyzing the text data
  • It extracts the information on which the text search capabilities are based and passes the results to the user
NAME SERVER
  • The name server in SAP HANA Architecture keeps all the information about the topology of the SAP HANA system
  • This server knows where all the components are running and which data is located on which server
STATISTIC SERVER
  • This server collects information about the status, performance, health of the overall components of the SAP HANA architecture
  • This server also provides the past data for the analysis
XS ENGINE
  • Using this server, clients can connect to the SAP HANA database to fetch data via HTTP
Now, let's check out a couple of unique features of SAP HANA.


Row store vs Column store

The first feature which SAP HANA database provides is the usage of both row store and column store. Previously, Traditional databases stored data simply in rows. The below picture shows the difference between row and column store.
Difference between row store and column store
Row Store:
Row store in SAP HANA
Column Store:
SAP HANA Column store

A key benefit of the column store is that all the same datatypes are together, for example, the datatype of  SOURCE is 'string'. Hence data compression is better. Also, the data access is faster with better parallel processing.


IN-MEMORY (Code to data paradigm)

The second feature which SAP HANA provides is an in-memory concept. Traditional RDBMS use to transfer bulk data to the application layer and then perform the required activities/ calculations. But SAP HANA's motive is to perform everything inside the database layer. Below is the image for the same.
Code pushdown
The image above represents that SAP HANA performs code to data approach or code-pushdown and traditional RDBMS performs data to code approach.
Traditional RDBMS transfers the data from the database layer to the application layer and performs data-intensive computations in the application layer. There is an unnecessary transfer of data which leads to poor performance.
SAP HANA overcomes the limitations of poor performance. It performs calculations in the database layer and sends only the result to the application layer.

NOTE: Manipulating database every single time is not a good practice, hence there is a replica in the database layer, so everything happens in the replica and time to time database changes.

Now, let's understand the guidelines to migrate ABAP code to SAP HANA.

Migrating ABAP code to SAP HANA  

For migrating ABAP code to SAP HANA, there are some rules which you must follow in order to get better performance.
  1. Minimize the amount of transferred data: Use SELECT with a field list rather than SELECT *
  2. Use joins instead of nested SELECT loops.
  3. Prefer array operations for INSERT, UPDATE and DELETE 
  4. Use BINARY SEARCH in read statement.
  5. Use ORDER BY PRIMARY KEY in select query.
More Enterprises or organizations these days are adopting SAP HANA as a vital part of their businesses. Thus it becomes imperative to understand the fundamentals of SAP HANA.

The illustrations above will help individuals and professionals learn about the basics of SAP HANA. It also explains how it overcomes the limitations of traditional databases.

 In the upcoming second tutorial, we will demonstrate the fundamental working of CDS Views.

Post a Comment

0 Comments