asics
NA B
HA
HANA
BASICS
Follow Us on
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
HANA Basics
1. What is HANA ?
HANA stands for High Performance Analytical Appliance. It is an SAP’s in-
memory database.
An in-memory database (IMDB) is a database that stores data in a
computer's main memory, like RAM, instead of on a disk
2. Why HANA is called Appliance but not a database ?
It is because HANA is not a software. HANA is a combination of both software and hardware
We cannot directly install it on computer, It requires specialized hardware certified by SAP
for installation of HANA i.e. why it is called Appliance and it is not called a software.
3. Why HANA is so important and more popular
in the world?
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
RDBMS
Most of the traditional systems till today which we call RDBMS ( Relational database
management systems ) stores data in the hard disk, so if we want to process the data we
will have to bring it from hard disk to RAM and then RAM to CPU for processing it.
CPU <——> RAM <——> Hard Disk
So, It takes a lot of time to bring the data from hard disk to RAM and because of this
the performance of RDBMS systems decreases.
HANA
SAP comes up with an idea that we are going to store all the data in the RAM only ( i.e. in
memory database ), then be default the efficiency of SAP system started to increase.
How was it possible for SAP to come with this approach because RAM
was very costly ?
Innovations happening in hardware and software ultimately lead SAP to come with this approach.
1. Hardware Innovations :-
Over the period of years Cost of memory came down drastically. Ability to fabricate large space in small chips (
Companies like Intel, Seagate, Sony are currently building memories which are equal to size of our nails but can
terabytes of space ) which lead to reduction of memory prices.
Multi-core CPU ( Each core of multi-core CPU is itself a CPU and each core is capable of processing the computation
independently which means we can give instructions to each core parallelly and each core can process the data
process the data parallelly ). Within CPU we can process the data in caches as well.
Capability to connect multiple CPUs ( Suppose, I have 8 octa-core processors, so If I connect each of them then it
will become 64 processing unit for a single system and we will be able to process 64 instruction at the same time ).
Power backup devices ( Powerful UPS devices available now adays which helps in backup in case of power failure ).
2. Software Innovations :-
Compression ( compressing the data and then storing it ) i.e. we can store a massive
data in a small set of memory after compressing it.
Also compressing data do not causes lose of data.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
Storing data in column store and Row Store.
Data Ageing ( If there is a data which not ever updated, deleted, inserted from a very long time like 10 years ), then there is no
need to put this data in the RAM and we can move this data into the Hard Disk i.e. we should only need to store the data in RAM
which is active.
Insert-only approach { Updating the old data is never a good option as it is quite expensive, so instead of updating or deleting
we will only go for Insert only with a timestamp so that system will only read the latest data instead of old one .
Database Caching and Database Sectioning ( We do not store data randomly in database i.e. Data like master data, transactional
data, First we group them together and then we store the data into a particular section ).
With this innovations ( Hardware and Software ) happening in the market helped SAP to come with a approach so that all the
active data can be stored in the RAM itself and can be used by the CPU for processing.
So, As a result the overall performance increases comparing with RDBMS systems and i.e. why HANA is so popular in the
modern day market for real time data processing.
5. Row Store v/s Column Store :-
Note :-
HANA uses column store technique to store the data.
1. Row Store
Most of the traditional database uses the concept of row store to store the
data.
Fields :- Sales Order, Sold to Party, Material Number, Amount and
Currency
In the above figure we have 6 records . The data is stored in row store format one after
another. Now, Suppose if we want to calculate the total amount then we will have to go
to each
field one by one even if they are not of our use.
Total Sales Amount ?
So, to calculate total sales here, we will have to scan each field here and then we are
going to perform the calculation of sales amount.
Disadvantage of Row Store :-
In case of Row store if we want to perform operation on certain columns, we will have
to visit or scan all the fields even if they are not of our use and because of this,
operations on row store becomes costly and more time consuming.
Advantage of Row Store :-
In case of row store, if we want to get all the records (Select * from table ), then it will
be easier as all the fields are stored row wise.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
2. Column Store
In case of column store, if we have to store the same records that we store above, we will
use the concept of column store.
Fields :- Sales Order, Sold to Party, Material Number, Amount and
Currency
Here, we have again stored 6 records but in column format, and we can see clearly it is
very beneficial comparing with it row store.
Total Amount :-
Here, if we have to calculate the total amount, we will simply go for 4th columns and we
can use the aggregate function to calculate the sum of total amount.
So for calculating the total amount we are only require to use 6 cells here, but in case of
Row store we were forced to visit each and every cell.
Advantage of Column Store :-
If we want to perform any operation on any field, then it is very easy for us as all of
them are in the same column.
Disadvantage of Column Store :-
If we want to use select query to get all the records ( select * from table ), then it will be
relatively slower comparing to row store as in case of column store, we will have to go
one by one on different columns for each records.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
6. Which Store is more beneficial ?
In most of the cases we do not require to use select * , so it is always more advisable to use
column store database.
For e.g., if you check the mara table it has more than 300+ columns, but in projects we
rarely use 15+ columns so, it is never recommended to use Select * on any table.
The column store is
much faster in Reading Data
Easy to perform Aggregate functions
No, need to create secondary indexes, we can use columns as a secondary index here. (
it saves memory ).
Since Computers can process number faster and in our Practical part we play with
numbers more often i.e. why Column store can become more efficient.
Massive Parallel Processing etc.
With SAP HANA coming into the picture, SAP chose optimized column store concept
making HANA as fastest and most efficient among all the database present across the globe.
And In HANA you will be seeing most of the standard tables as column oriented only.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
Note :-
While writing any select query always write the field names instead of using * because we
are not going to need it.
7. When to choose Row Store and When to choose
Column Store :-
It is a certification and interview question as well that in which scenario we need to use row
store and in which scenario we need to use column store.
Since, for Standard tables SAP has already changed it but for custom tables, we need to
define it.
Row Store vs Column Store (2)
Row
Column Store
Store
1. IF there is
a table which
is READ less
frequently but 1. Frequently use/read data of columns ( 70% ERP operations DB are read operations )
updated often
Row
Column Store
Store
2. Data
Volume in 2. When we want only few columns in real life and we want to aggregate data
table is low
3. If you want
all field ( 3. If there are large duplicate values then it that situation compression will be very high.
select * )
4. If you have
large number
of unique
values, then
the
compressions
will not be
there because
4. Data Volume is very high.
the
compression
is more if we
have more
repeated
values , then
we should use
row store.
Untitled 5. Don't need all the records all the time.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
Note :-
In case of our ERP system, most of the tables have a lot of duplicate values i.e. why we use
column store in HANA as compression will higher and system will give a good compression in
this situation.
In case of HANA there is no concept of pooled and cluster table, that concept have been
deprecated in case of HANA.
8. How life of an ABAP Developer Changes
because of HANA ?
In our SAP Architecture for HANA
We have Presentation layer, Application Layer and Hana Database layer
Before {Data to Code Paradigm} :-
Till now, what we were doing
1. Using Selection Screen 2. Select * from database table
into internal table ( I_TAB ). 3. Loop at I_TAB into work area.
4. Display data to ALV or Report. 5. Update or Delete.
Slowly and gradually SAP won the trust of their customers and then they started to migrate
to HANA.
SAP has told to end support for ECC by the end of 2027.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
10. ABAP on HANA System
SAP launched NetWeaver 7.4 who has the support for direct connectivity of ABAP System
with the HANA Database and for that the minimum version that we need is HANA {
Support Pack 6 ( SP6 ) }
ABAP on HANA is the technology in which we need minimum version 7.4 of SAP
NetWeaver and Support Pack 6 of HANA DB.
Using ABAP of HANA Technology lots of solutions were made like Suite on HANA, SRM
on HANA, CRM on HANA, PLM on HANA, HCM on HANA, ECC on HANA.
So, ABAP on HANA is the Technology and Suite on HANA is the solution or Product which
was built on the top of this technology.
For e.g. ABAP is the Technology using which ECC was built, Similarly ABAP on
HANA is the technology on which Suite on HANA was built.
Suite on HANA was not big Success ?
In Suite on HANA lots of tables were still following row store concept, lots of
secondary indexes were there.
So, since this solution was not that big success that’s why in 2015 SAP came with
another solution in 2015 and they called it S/4 HANA.
11. S/4 HANA
S :- Simplified
4 :- 4th Generation
SAP launched its fourth generation in 2015 which was named S/4 HANA which works only
on HANA DB.
S/4 HANA is solution which was built on the top of ABAP on HANA technology which
only and only works on HANA DB.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
This is available on both On Premise and on Cloud as well. For On Premise set up we require
our own Hardware Setup and basis team to manage it. In simple word, S/4 HANA is a solution
launched by SAP in 2015 which comes in two
flavors on-premise and cloud as well, It is a fourth generation product built on technology (
ABAP on HANA ).
12. Architecture of HANA { Components of
HANA }
1. HANA XSA (Extensible Services Advance ) and
XS ( Extensible Services ) :-
It is a light weight application server inside the HANA architecture itself which is called XS Engine, i.e. we can run also
programs on HANA.
This means it is not only a database to perform read/write operation, It is also containing a light weight application server
which is called XS Engine, and it is capable of executing programs and building applications and its lifecycles directly on
HANA.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
Q. Here a question arises in our mind that if we already have a
application server inside HANA architecture, then why do we need
ABAP Application layer ?
Ans :- The answer is very simple.
Suppose, we have the below code on notepad.
If we try to execute the below code, it will not execute since there is no runtime
environment for the above code.
ABAP Application layer provides the ABAP run time environment which is essential
for executing ABAP code.
There are various applications supported by HANA application server :-
Node JS
JRE ( Java Runtime Environment )
HTML5
Other.
Note :-
We can build an end to end Node JS/JAVA/HTML application directly on HANA and
execute it without any ABAP application layer.
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944
Those people who works with this XSA and XS are called as Native HANA Developer.
2. Index Server :-
This is the actual in memory computer engine ( IMCE )
This is our actual database in HANA.
3. Nameserver :-
It helps us to coordinate between multiple HANA boxes in case of a distributed
environment.
4. Script Server :-
The script server allows us to support runtime for 3rd party integration libraries.
For e.g. R Language ( Used in machine learning development) AFL ( Application Function
Library ) which has lots of inbuilt functions which are used
to do a lot machine learning activities like calculations, predictions etc.
EML ( External Machine learning library ) allows us to integrate HANA server to
execute a logic in a third party server and get back the result in HANA.
5. Doc Store :-
It is a third type of database/store introduced in HANA 2.0 It allows us to store document
in form of a compressed JSON directly in HANA database. We cannot choose this from
ABAP side, those who specifically works on doc store
component, only they will use this particular data type.
6. Integration Tools, Data Lifecycle management
tools, tooling support for HANA administration
Helps in Integrating HANA with other components like Hadoop, Big Data etc.
We have tooling support for HANA administration
13. Various tools which can connects with HANA :-
There are various tools which connects with HANA for performing various purposes :-
1. ABAP Server :- For executing ABAP code 2. BW Server :- Used mainly for
performing analytics/read operations.
3. Web Server :- A web server or a browser can connects to SAP HANA
4. HANA Studio :- This tool also connects to HANA database to connect to HANA
Amrit Raj (Chief Operations Officer) | Srijan Institute & Training Center | +919220601944