Sie sind auf Seite 1von 22

SAP HANA Architecture

In-Memory database
SAP HANA runs on multi-core CPUs with fast communication between
processor cores and contains terabytes of main memory.

All data is available in main memory.

The more you can do directly on the data in memory next to the CPUs,
the better the application will perform. This is the key to development
on the SAP HANA data platform.
Contd..
Disk or solid-state drives are used for permanent persistency.

The required backup operations to disk can take place asynchronously


as a background task.
Row & Column store
A database table is conceptually a two-dimensional structure
composed of cells arranged in rows and columns.

Because computer memory is structured linearly, there are two options


for the sequences of cell values stored in contiguous memory
locations:
Row Storage - It stores table records in a sequence of rows.
Column Storage - It stores table records in a sequence of columns i.e.
the entries of a column is stored in contiguous memory locations.

A table can be represented in row-order or column order.

SAP HANA supports both, but is particularly optimized for column-


order storage.
Contd..
Advantages of column-store
Columnar data storage allows highly efficient compression.

If a column is sorted, often there are repeated adjacent values.

SAP HANA employs highly efficient compression methods, such as


run-length encoding, cluster coding and dictionary coding as majority
of the columns contain only few distinct values when compared to
Rows.

The column scanning speed of the in-memory column store and the
compression mechanisms allow read operations with very high
performance.
Contd..
Eliminates additional indexes and thus reduces complexity.

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.
Merits of Row-store
Row based tables can be used in following circumstances:
The application needs to only process a single record at one time (many
selects and/or updates of single records).

The application typically needs to access a complete record (or row).

Neither aggregation nor fast searching is required.

The table has a small number of rows (e. g. configuration tables, system
tables).
De-Merits of Row-store
Row based tables cannot be used in following circumstances:
In case of analytic applications where aggregation are used and fast
search and processing is required.

In row based tables all data in a row has to be read even though the
requirement may be to access data from a few columns.
What type to choose?
In case of analytic applications where aggregations are used and fast
search and processing is required, column-store is used.
In row based tables all data in a row has to be read even though the
requirement may be to access data from a few columns. Hence these
queries on huge amounts of data take a lot of time.
In columnar tables, this information is stored physically next to each
other, significantly increasing the speed of certain data queries.
Contd..
Hence use column-store for OLAP queries (Queries using aggregate
functions).

For traditional OLTP queries (queries not using any aggregate


functions), it is more advantageous to store all attributes side-by-side
in row tables
Contd..
Select * from SALES where country = GERMANY
SAP HANA Database Architecture
Servers
Index server
Index server is the main SAP HANA database component.

It contains the actual data stores and the engines for processing the
data.

The index server processes incoming SQL or MDX statements in the


context of authenticated sessions and transactions.

Index server powers the robust SAP HANA analytics.

Pre-Processor Server
The Index Server utilizes the Pre-Processor Server to analyze text data
and extract data from text when called via the Search function.
Contd..
Statistical Server
The Statistical Server will analyze and present status, performance and
metrics from all SAP HANA Database components.

Name Server
The Topology of the SAP HANA Database is recorded here.

In a multi-server SAP HANA distributed landscape, the Name Server


will record which data is on which server to decrease time associated
with re-indexing.
Contd..
XS Engine (Extended application services )
Client applications can use HTTP to transmit data via the optional XS
Engine which uses SAP ICM (Internet Communication Manager)for
HTTP server.

This module provides access to the SAP HANA DB by transforming


the persistence model stored in the DB into a consumption model for
clients exposed via HTTP.

This allows an organization to host system services that are part of the
SAP HANA Database (ex. Search service )
Persistence layer
Responsible for recovery in the event of power failure.
Persistence layer components
Persistence layer of Sap HANA relies on Data and Log volumes.
Data and Log volumes are used as follows:
On regular basis, data pages and mirror images are written in the data
volumes. This process is called Savepoint.
Between two Savepoints, after images are written in log volumes. This is
done each time, the transaction is committed.
Before image - A copy of a record (or page of memory) before it has been
modified.
After image - A copy of a record (or page of memory) after it has been
modified.
The Savepoint relies to a concept called Shadow memory.
Shadow memory
With the shadow page concept, physical disk pages written by last
Savepoint are not overwritten until the next Savepoint is successfully
completed.
Until the next Savepoint is complete, two physical pages may exist for
one logical page-
The shadow page which still contains the version of the last Savepoint.
The current physical page which contains the changes written to disk after
last Savepoint.
Restart procedure
After a restart, the system is restored from the Savepoint versions of the
data pages.
This way all data changes written since the last Savepoint are not
restored.
After the Savepoint is restored, the log is replayed to restore the most
recent committed state.
Thank you.

Das könnte Ihnen auch gefallen