Watch this video to learn about the runtime structure of the full-stack application.
At runtime, the full-stack MTA is commonly made in the following way:
- The user interface is written using HTML5 and rendered/executed in a web browser.
- The HTML5 program communicates with the router via the HTTP protocol. The router is a program running on the server. It does not execute business logic, it is just a dispatcher of HTTP messages.
- The router dispatches the HTTP message to the proper application, running on the server. This application is built out of the corresponding Node.js (Java, Python, and so on) module, coded by the developer within the MTA project in the Business Application Studio.
- The Node.js application communicates with the database via an SAP HANA service, that is connected to an SAP HANA Deployment Infrastructure (HDI) container stored in the database.
- Database objects (Tables, Views, Procedures, and so on) are stored in the HDI container.
- The procedures in the database use the SQLScript (alternatively the R) language, that is specialized in highly parallel and data intensive processing.
The SAP HANA Database Module
At design time, in the SAP Business Application Studio, an MTA project is created.
The database content of the MTA is defined using the db folder also called as SAP HANA database module.
This module contains the design time definitions of all the objects to be created in the database, for example:
- Domain Models (Persistence).cds
- Tables and Views(.hdbtable and .hdbview)
- Calculation Views(.hdbcalculationview)
- Procedures (.hdbprocedure)
Database Folder of CAP Project
A minimal SAP HANA database module contains:
An src folder, made to store the design time definitions of the database objects.
A package.json file for configuration for the MTA project is required for example, to set the version and the options of the deploy program. In case of CAP projects this file is shared by all three modules.
Additionally datafolder is required in case the data has to be provided by files (.csv). The system identifies the files based on its placement under datafolder under dbfolder and generates the .hdbtabledata files for deployment.
SAP HANA Cloud service instance
A service of type HANA (technical name com.sap.xs.hdi-container) needs to exist for the HDI container to be accessible from Cloud Foundry. When you create a new SAP HANA database module, a service is also added by default to the mta.yaml file, together with the configuration required for the service to be accessible by the module.
When the module is built, a service instance (of type HANA) is created in Cloud Foundry. This service instance is connected to the HDI container that is created in the SAP HANA database.