SAP HANA is more than just a database. It provides a platform with a myriad of libraries and tools for information management, complex analyses, and application development. Using SAP HANA, you can optimize existing applications as well as develop new applications from scratch.
1Overview of SAP HANA
At its core, SAP HANA is a modern, main memory-based relational database (in-memory database) that is optimized both for analytical and transactional scenarios and is designed for usage in business-critical areas. Both SAP Business Warehouse (SAP BW) and the entire SAP Business Suite can use the SAP HANA database and benefit from the advantages it provides. Based on the underlying in-memory technology, SAP HANA comprises a multitude of libraries and tools that can be deployed independently or in combination with other SAP solutions for business applications. For this reason, SAP HANA is referred to as a platform both for its own applications and for customers and partners.
[»]Meaning of the Name SAP HANA
Originally, the name HANA officially stood for High Performance Analytical Appliance because it was possible to process large amounts of data in real time for analytical scenarios, and SAP HANA was exclusively provided as an appliance (combination of hardware and software). In recent years, however, the usage scenarios have considerably increased and changes have occurred in the appliance model, so SAP no longer uses HANA as an abbreviation but as a separate brand name for various products.
In the first part of this chapter, we introduce the individual components of SAP HANA. We then describe the basic principles of the in-memory technology and the architecture of the SAP HANA database. To conclude this chapter, we present application cases for SAP HANA and explain the impact SAP HANA has on application development.
1.1Software Components of SAP HANA
This section presents the components of the SAP HANA platform based on Service Pack Stack (SPS) 9. The SAP HANA basic package comprises the following software components, which we’ll discuss in more detail in the following subsections:
-
SAP HANA database
The actual SAP HANA database with its core components. -
SAP HANA Client
Database driver for various programming languages and tools. -
SAP HANA Studio
The central Eclipse-based tool for administration and development. -
SAP HANA XS
The embedded web server for native SAP HANA applications and tools.
The following sections explain the structure of the basic components and their usage. In this context, we’ll focus on aspects that are relevant for application development.
1.1.1SAP HANA Database
As a full relational database, SAP HANA provides functions similar to other traditional relational databases that are supported by SAP. Like these traditional databases, SAP HANA provides functions for data backup and recovery, supports the SQL standard (SQL 92 Entry Level and some SQL 99 extensions), and guarantees data consistency by following the ACID principle(atomicity, consistency, isolation, durability) when executing transactions.
In contrast to other relational databases, SAP HANA can place all relevant business data in the main memory. It combines row-, column-, and object-based database technologies and has been optimized to use the parallel processing functionality provided by modern hardware technologies. With this, you can use multi-core and multi-CPU architectures to their fullest potential. You can thus optimize existing applications for the new technology and develop applications that you could only dream of with traditional database technologies. Section 1.2 and Section 1.3 discuss the internal architecture of the SAP HANA database in more detail. The abilities of the SAP HANA database (and their usage in ABAP programs) are presented later in this book.
There are various lifecycle management tools for using and operating SAP HANA. You can perform most system administration tasks using SAP HANA Studio; for some tasks, access at the operating system (OS) level is necessary or desirable:
-
You use the SAP HANA Lifecycle Manager tool (Program HDBLCM) for adapting the SAP HANA system. With this tool, you can make all adaptations to the system layouts, including the installing optional components, implementing updates, and adding further hosts for scale-out.
-
To install or update native SAP HANA applications, you must use SAP HANA Application Lifecycle Manager (Program HDBALM). You can call it in SAP HANA Studio or in a browser; access is also possible using the command line, which is useful for automation, for example. Application Lifecycle Manager isn’t used for ABAP applications on SAP HANA, however. Here, you still deploy the regular ABAP transport system for the lifecycle of applications.
-
Each SAP HANA host runs the SAP Host Agent, which makes it possible to monitor the individual hosts and their corresponding instances. This information is then made available for central monitoring via web services (e.g., via the SAP Management Console).
In case of urgent support is need, you can set up a connection between your SAP HANA installation and the SAP Support that provides restricted access via the SAP standard support infrastructure (especially SAProuter). Using the Diagnostics Agent on the SAP HANA appliance, SAP Solution Manager provides comprehensive options for technical monitoring of your SAP HANA system in the context of standard Application Lifecycle Management (ALM) processes (e.g., root cause analysis or SAP EarlyWatch Alert).
1.1.2SAP HANA Studio
SAP HANA Studio is comprised of the administration and development environment. This solution is based on the Eclipse platform, which SAP strategically intended as a new development environment. An Eclipse-based development environment is now also available for ABAP (ABAP Development Tools for SAP NetWeaver). We’ll primarily use this environment for the tasks described in this book.
[»]The Significance of Eclipse for SAP
Eclipse is a platform for development tools and environments (e.g., for Java, C/C++, or PHP). The platform is maintained and further developed by the Eclipse Foundation (see http://eclipse.org). As an active member of the Eclipse Foundation, SAP supports the organization in several projects.
In addition to SAP HANA Studio and the ABAP Development Tools for SAP NetWeaver, the following SAP development environments are based on Eclipse:
-
SAP NetWeaver Developer Studio (Java)
-
SAP Eclipse Tools for SAP HANA Cloud Platform
-
SAP UI Development Tools for HTML5
-
SAP Gateway Plug-in for Eclipse
One of the main advantages of the Eclipse platform is the capability to integrate different tools into one installation so that the user benefits from a homogeneous development environment. Particularly useful is the capability to install the ABAP Development Tools in SAP HANA Studio, which is described in Section 1.3.
As an example, administrators can use SAP HANA Studio for the following tasks:
-
Starting and stopping database services
-
Monitoring the system
-
Specifying system settings
-
Maintaining users and authorizations
-
Configuring the audit log
Administering SAP HANA isn’t the focus of this book. Please refer to the documentation at http://help.sap.com/hana for this information. As a developer, however, you can create content (e.g., views or database processes) using SAP HANA Studio. These development artifacts are stored in the repository of the SAP HANA database. The development environment of SAP HANA Studio is explained in detail in Chapter 2 and Chapter 4.
[+]SAP HANA Cockpit and SAP HANA Web Workbench
Besides SAP HANA Studio, administrators and developers can also use web-based tools that are executable in every Internet browser (and thus on mobile devices).
For some administrator tasks, you can also use the SAP HANA Cockpit, which you start via the URL https://<host>:<port>/sap/hana/admin/cockpit.
In addition to SAP HANA Studio, SAP HANA Web Workbench is available for native development, which we’ll briefly discuss in Section 1.1.4. For ABAP development for SAP HANA, however, this environment only plays a minor role.
1.1.3SAP HANA Client
Using the SAP HANA Client, you can connect to the SAP HANA database via a network protocol. The following standards are supported (see Figure 1.1):
-
Open Database Connectivity (ODBC) and Java Database Connectivity (JDBC) for SQL-based access
-
OLE DB for OLAP (ODBO) for multidimensional expressions (MDX) access
Internally, in particular the proprietary SQL Database Connectivity (SQLDBC) library from SAP is used.
Because the Eclipse platform is Java-based, SAP HANA Studio uses the JDBC client to establish the connection. This variant is also used in Java-based application servers, such as SAP NetWeaver AS Java.
Figure 1.1Options for Accessing SAP HANA via Clients
[»]SAP HANA SQL Command Network Protocol
SAP has published the specification of the network protocol for access to SAP HANA via SQL under http://help.sap.com/hana. This allows for implementations of SAP HANA drivers for other programming languages. For example, there’s a freely available implementation of an SAP HANA Client for node.js under https://github.com/SAP/node-hdb.
The SAP NetWeaver AS ABAP uses the Database Shared Library (DBSL), which is embedded in the SQLDBC client, to connect to the SAP HANA database. The database interface architecture of the AS ABAP is explained in detail in Chapter 3.
Special business intelligence (BI) clients, such as add-ins for Microsoft Excel, frequently use MDX-based access for multidimensional queries that are executed via the ODBO client.
In addition, SAP HANA provides direct HTTP access via the XS Engine, which is discussed in the next section.
1.1.4SAP HANA Extended Application Services
The SAP HANA Extended Application Services (SAP HANA XS) allow you to develop applications directly in SAP HANA without an additional application server. For this purpose, SAP HANA XS provides a complete development environment consisting of a web server, a development model, and supporting tools.
SAP Internet Communication Manager (ICM) and SAP Web Dispatcher are used as web servers, which are also used for all SAP NetWeaver application servers (ABAP and Java). Inbound HTTP requests are accepted and then transferred to the SAP HANA XS runtime, which assumes the processing of the associated program code in conjunction with the SAP HANA database.
Applications are developed with SAP HANA XS using several development objects that cover everything form defining a data model to developing user interfaces (UIs). The individual objects are defined as normal text files; you can use package structures for grouping. In this context, each development object has its predefined syntax, whereas the type is distinguished through the file extension. The objects are managed in the SAP HANA repository, and the repository can generate objects (e.g. a database table) in the database catalog upon activation. For the definition of data models (tables, views, etc.), for example, the Core Data Services (CDS) description language is available, which is stored in the files with the extension .hdbdd. The CDS description language is also supported in ABAP as you’ll learn in Chapter 6. Further central elements of programming using SAP HANA XS include writing application logic using server-side JavaScript as well as defining REST-based interfaces for web applications. Within the scope of this book, we won’t further detail the development using SAP HANA XS because for ABAP-based applications, the primary access to SAP HANA is made via ABAP development objects for logical reasons.
There are two options for development using SAP HANA XS: SAP HANA Studio or SAP HANA Web Workbench, which is executable in a regular Internet browser and thus doesn’t require any installation. In both cases, you’re provided with practical editors and graphical tools for defining the individual development objects. Additionally, the two environments provide options for syntax checks, debugging, and application configuration.
1.1.5Additional Options
Based on the core components, several additional options enable more usage scenarios. The following grouped list gives an overview of the options. Note, however, that we highlight those options that are addressed within the scope of this book.
Engines and Libraries
The functional scope of SAP HANA can be enhanced through engines (components with a separate runtime environment) and libraries (collections of algorithms). These enhancements are either part of the standard SAP HANA database or are installed later on as plug-ins.
The following packages are available in SAP HANA SPS 9:
-
SAP HANA Predictive
This option permits the usage of various functional libraries for mathematical operations, such as the creation of models for statistical predictions. In addition, this option comprises an integration with the statistical software package R. Chapter 12 discusses the actual use of the Predictive Analysis Library (PAL) that is contained in this option. -
SAP HANA Spatial
With this option, you can process geographical information in SAP HANA. This opens up interesting new options for business applications, which we’ll present in Chapter 13. -
SAP HANA Advanced Data Processing
This package comprises advanced search and analysis options in structured and unstructured data, including functions for extracting information from texts and documents (text mining). The options are presented in Chapter 10.
Replication and Integration of Data
As you’ll see in Section 1.4, you sometimes have to transfer data from existing systems to SAP HANA. The source systems can be, for example, SAP Business Suite, SAP BW, or any other data source.
This is referred to as data replication if the data structures and data records are basically transferred without modifications. Tools for data replication usually support both the initial data transfer (initial load) and the subsequent synchronization of changes (delta load), and they usually have the goal of transferring changes in near real time.
If you require additional transformations and other steps for data consolidation or improvement of data quality, this is referred to as data integration (or information management). For this purpose, you specifically require tools for extraction, transformation, and loading (ETL) processes. These tools are designed for batch operation so that data are available with a certain time delay. In some cases, human interaction is required, for example, to cleanse data records manually.
SAP provides several tools for data replication and data integration. However, we can’t offer a full product overview here. The following presents the most critical options and technologies used directly in SAP HANA:
-
SAP HANA Real-Time Replication
This additional option comprises several tools for data replication from various data sources to SAP HANA in real time. This specifically includes SAP Landscape Transformation Replication Server (SAP LT Replication Server) and SAP Replication Server (SRS). SAP LT is the standard option for the replication of tables from ABAP systems and is based on database triggers. -
SAP HANA Enterprise Information Management (EIM)
This package offers various options for efficient transfer of data from heterogeneous sources with data transformation and cleansing options. You can define your own adaptors and processes using a development environment and thus control the data flow flexibly. -
Smart Data Access (SDA)
You can use the SDA technology to access other systems from SAP HANA. This can involve another relational database or other data sources, such as a Hadoop cluster. The data is made visible in SAP HANA as virtual tables so that direct SQL access is possible. -
Direct Extractor Connection (DXC)
This technology allows you to use a direct HTTP connection to transfer data to SAP HANA using extractors that were developed using the SAP BW technology.
Selecting the right technology and the right tool for data replication/integration strongly depends on the usage scenario and the qualities required. We won’t discuss further the selection and operation of these components within the scope of this book. For extensive, up-to-date information on these variants and their usage scenarios, please see the SAP HANA Master Guide (available at http://help.sap.com/hana).
Further options
Besides the packages we mentioned previously, additional enhancement options are available:
-
SAP HANA Smart Data Streaming
By using this option, you can efficiently process continuous high-frequency data flows as they emerge in the context of machine data, for example. SAP HANA Smart Data Streaming is based on the SAP Event Stream Processor that is also available as a stand-alone product. -
SAP HANA Dynamic Tiering
This option allows you to enhance the in-memory capacities of an SAP HANA database through disk-based storage (extended storage). This is based on the same technology as the column-based SAP IQ database and is primarily used for data aging scenarios so that older data can be swapped from the main memory to more cost-efficient media. -
SAP HANA Accelerator for SAP ASE
If you operate the applications on the SAP Adaptive Server Enterprise (ASE) database, you can use this variant of SAP HANA as an accelerator for high-performance analyses to attain benefits without implementing a database migration. -
SAP HANA Data Warehousing Foundation
This option provides tools to obtain even data distribution on individual database servers in distributed SAP HANA systems.
As you’ve seen, SAP HANA provides several components and add-on packages in addition to the actual in-memory database to provide comprehensive data management. The following section now discusses the core concepts of SAP HANA in more detail with a special focus on the basic principles of in-memory technology.