The SAP HANA Deployment Infrastructure (HDI) is a service layer of the SAP HANA database and helps create runtime database objects from design-time artifacts.
HDI manages dependencies; for example, a table might need to be created before we can create the view. HDI also executes as a transaction, that is, the whole operation either succeeds or fails (we do not want to make a mess of our database). HDI was introduced with SAP HANA 1.0 SPS 11 (2015) together with the SAP HANA XS Advanced application development Node.js and Java runtimes and the SAP Web IDE for SAP HANA development tool. Technically, HDI is a Node.js application.
In the first release of SAP HANA, development artifacts were stored in the repository. This repository was central to the application lifecycle management. Although not technically a part of the SAP HANA XS environment, the repository is closely related, and both have been deprecated since the SAP HANA 2.0 SPS 02 release. HDI differs significantly from the repository in two key areas:
- HDI offers no version control or lifecycle management capabilities. For these functionalities, the SAP Web IDE integrates with GitHub.
HDI containers always come in pairs: a design-time container (DTC) and a corresponding runtime container (RTC). The runtime objects are created in an HDI container based on the CDS persistence data model, which not only allows for multiple deployments but also for the deployment of multiple versions of a single application into the same SAP HANA database (which is not possible with the repository).
Inside the database, the HDI container is represented as a schema but is owned by a technical user and isolated from other database objects. Only local object access inside the container is allowed, and to access objects outside the container, synonyms are required with explicit grants from the object owner. As a result, the development of database objects is schema-less/free. In the repository, all objects were owned and accessible by a single technical user _SYS_REPO, and all modeled views were owned by _SYS_BIC/_SYS_BI.
HDI services are provided by a process called the diserver. This service is automatically configured and started with the installation of SAP HANA XS Advanced. Once your SAP HANA XS Advanced development environment has been configured, executing a Build command from the SAP Web IDE will execute the required steps to create HDI containers in your databases and to create the database objects, which will be displayed as shown in the figure below. Alternatively, you can interact with HDI on the command line with the xs (and cf) CLI or in the SQL prompt using the SQL API.
For hands-on exercises using HDI, you can try out the following tutorial on the SAP Developer Community:
- “Tutorial Navigator: Get Started with XS Advanced Development”
- “Tutorial Navigator: Build a Basic SAP HANA XS Advanced Application”
For more documentation, see the SAP HANA Deployment Infrastructure (HDI) Reference and “Deployment-Infrastructure Services in XS Advanced” in the SAP HANA Developer Guide for SAP HANA XS Advanced Model. Both guides are available on the SAP Help Portal for the SAP HANA platform.
Editor’s note: This post has been adapted from a section of the book SAP HANA 2.0: An Introduction by Denys van Kempen.