SAP HANA for beginners

E:BackupmysapbookHANApowered-by-SAP-HANA.jpg

Friends, remember the days when we had only 128 MB of RAM in our computer in early 20’s. The gals/guys who started using computer recently or 5-6 years back, they can’t even believe the same as they started using computers having minimum 1-2 GB RAM.
Here all I meant is about SPEED.
We know time is money!

SAP comes up with a very effective and efficient database called HANA which makes revolution in database world.
Now a days, when every organization is having a huge volume of data causing slowdown of  all the database operations, SAP introduces the HANA database which makes any database operation very fast which is well desired for any kind of organization.

Now let’s dig into the so called HANA (High-performance ANalytic Appliance).
SAP HANA manages massive data volume at high speeds.
HANA is combination of both advanced hardware and innovative software.
Hardware In-Memory RAM
Software   Column-Oriented RDBMS.

SAP HANA is written in C, C++.

E:BackupmysapbookHANAHANA_basic_architechture.png

Data resides in separate database server (Database on Dick) need additional load (120MB/s) while pulling (select) data to application server or manipulate (update/insert) data to DB server.

In the right hand side of the above image we can easily understood that pulling data to SAP application or manipulate data into DB is super-fast (100 GB/s).

The super-fast database access is possible because the total database stored in RAM (memory).

We know RAM is volatile memory, so your next question would be…
You: will all the data be lost if there is any disruption in system like power cut off!!!
SAP: NO!

SAP came up with two more things to manage the data.
  1. Log area (Disk).
  2. Data area (Disk).

All the current data stored in In-Memory database (RAM) and for each database-commit it will go into Log area. And if there will be power failure after the database commit, all the committed data will be synced into database from the Log area. That means Log area will hold only the current data. Please check the below image.
SAP HANA Recovery
All the current data (In-Memory DB) will be synced into Data area (Disk) after a certain interval (SAVEPOINT), by default it configured for 300 Sec (5 mins) in system but we can alter the savepoint as per our requirement.

So your most valuable data will not be lost in anyway and it’s totally safe to upgrade your database into HANA and gear up your business. Cheers!

Q: Is it only all about the database that goes into RAM?
Ans: No.

As I have already mentioned that HANA is based on advanced hardware and innovative software.

HANA advanced Hardware that I have already tried to make you understood about In-memory (RAM) cache database.

Another side of the HANA’s advanced Hardware innovation is multi-core architecture
CPU (8 X 15 cores per blade) which enables massive parallel processing resulting high speed in database operation.

E:BackupmysapbookHANAHW_SW_1.png

Now let me try to explain HANA’s innovative software part.

Let’s take an example of a table that contains sales data like below.

ROW based stored table
Column based stored table
SO No
Country
Product
Total sales
SO No
Country
Product
Total sales
1
INDIA
Coca-Cola
100
1
INDIA
Coca-Cola
100
2
USA
Sprite
130
2
INDIA
Sprite
120
3
CHINA
Mazza
110
3
USA
Sprite
130
4
INDIA
Sprite
120
4
CHINA
Mazza
110
5
GERMAN
Beer
90
5
GERMAN
Beer
90

Primary index
=
Sorted

So, here we can see when table stored in columnar based then  all the table fields behaves as primary key and as a result all the fields value comes in sorted basis.
(No need to create secondary index while querying data with non-key field).

Advantages in columnar stored table (HANA) over row stored table:

SELECT *
FROM TAB_SALES
INTO IT_SALES
WHERE COUNTRY = ‘INDIA’.

C:UsersParthaDesktopHANAimg_1.jpg

As you can see from the above mysapbook image,
The country field value (INDIA) is being searched all over the table as it is not a primary key for the row based stored table.
But when the same search happens in HANA table (columnar based stored), as all the fields treated here as primary key and all are sorted, the search algorithm will begin only on country field and came out of search while there will be mismatch of the field value.

Please note: SAP HANA supports row oriented storage as well. So SAP HANA has given the flexibility to switch between column and row oriented storage.

The basic concept is when we need any analytical view (select data from DB) then we will go for columnar based and when we need DB update/insert then we can go for row based stored table. We will dig into it in more details.

Data Compression in HANA:

C:UsersParthaDesktopHANAimg_2.jpg

The columnar stored table is always stored in compressed format for the identical column (field) values.
But multiple rows cannot be identical to grasp the same functionality.
So, the total database storage would be less for HANA compared to other database.

HANA based DB is for Faster Aggregation / Any other arithmetic operations:
C:UsersParthaDesktopHANAimg_3.jpg

HANA’s columnar based storage characteristics makes all the database level arithmetic operation very fast compared to row stored table.

Parallel processing in HANA:

C:UsersParthaDesktopHANAimg_4.jpg

In a column store, data is already vertically partitioned. This means that operations on different columns can easily be processed in parallel. If multiple columns need to be searched or aggregated, each of these operations can be assigned to a different processor core

In-Memory operations for HANA:

C:UsersParthaDesktopHANAimg_5.jpg

Other database:
  1. Huge data volume in all over the process.
  2. Unnecessary Data load in application layer.

In-Memory database:
  1. No data load as we are doing all the operation (filtrations and all arithmetic operations) in DB level and carrying only the required data into application layer.
  2. DB is also synced in memory cache so it will not overload the data.

FYI…
  • HANA started with 1 TB RAM and now it’s successfully tested with 200 TB RAM.
So how big your business/database, it’s doesn’t matter to HANA at all. HANA can accommodate all your data in in-memory database.

  • Latest SAP HANA version is SPS 11 (Support Package Stack 11 (Last Update: November 25, 2015, Revision 110))

Please let me know if you liked the page. Feel free to put your valuable comments for any kind of suggestions or if you want more discussion on SAP HANA basics.

Thank you!
Happy New Year!



10 thoughts on “SAP HANA for beginners”

Leave a Reply

Your email address will not be published. Required fields are marked *