Skip to Content
Technical Articles
Author's profile photo Sreekanth Surampally

Apps and Services of DB module in XSA MTA Project – Part 1

When I started working on XS advanced developments in Web IDE for HANA, it took some time to understand  how Applications and services  getting created in a space for Data base artifacts also. Because, it is much different from how we used to do in XS classic HANA repository. Also, it is very similar working on HANA as a service on Cloud foundry environment, because they both share same design principles of cloud foundry.

In this blog, I would like to take a very simple of DB module creation and explain how the services and apps are created during build and deployment of it. Of course, there is official SAP documentation, also developer tutorials on this topic. So I am not explaining the steps to create, build and deploy the  applications, you can find this information from developer tutorials. Here, my objective is to explain how services and apps are being created/modified based on mta.yaml file configurations. It applies to HANA as a service on CF environment on cloud as well for the most part.

I will start with creating a basic DB module in MTA project in Web IDE for HANA.,  from context menu of the MTA project, create a DB module, it does not hold any design time artifacts at this time. Then, tool generates following code in mta.yaml file, we will understand it in detailed.

Picture 1:

Resources and modules:

As shown in the above picture, a resource for hdi container is created and it is assigned to DB module as required object. Resource is a service with hdi-shared plan which will be used to hold the DB artifacts. DB module is an application which requires the hdi container service.

Properties of a resource: properties are useful to expose the resource in other parts of MTA application, you can have dynamic parameter to hold the resource name. In this example it is ${service-name}. so the service name goes into it.

Let us build DB module in Web IDE, we can call this as private build, because it is specific to developer 1, the service generated with this, is going to be my user name prefixed and some technical GUID, you can find that in xs cl tools command,

  xs services

Note: With private build by developer, DB module does not build the application in space, so you don’t have that yet. But you will have di-builder application attached as part of the local build, It all gets deployed by the single di-builder instance in each space.

Let us deploy the MTA application now, first generate the .mtar file and then run xs deploy command, CL tools to deploy in space.

After deployment, run xs apps command,

We can see that module name DB is created as application, it will be in a stopped state most of the time, it is used only during deployment for HDB modules.

also run xs services command,

now, a service will be created in that space with out my user name prefix. That is the cleaner name hdi_DB_services which is the resource name in mta.yaml file and  it is bound to the app (DB) created just now.  

So, now let us navigate to Picture 1 and put all these pieces together,  we get a basic understanding  of how the private build and actual deployment works in Web IDE for HANA.

——————————–

TARGET_CONTAINER

—————————–

When there are multiple resources are getting assigned to a DB module, we would like to provide a dedicated resource as the primary one, so that DB objects will get created in that resource.

—————————

SCHEMA parameter

—————————-

If the SCHEMA parameter is not defined during DB module creation, then it generated the schema with project name + module name _1 for Developer 1 and it will be _2 for Developer 2 during the private build, this is to isolate the containers and keep them separate for each developer with no overwriting each others.

Private build:

Actual Deployment: SCHEMA name is generated with some GUID.

In the case of SCHEMA is provided, which is going to be the case in most of the times, Private build will have <SCHEMA_NAME given in yaml file>_1, for developer 2, <SCHEMA_NAME given in yaml file>_2 etc..,  the real deployment will have just the <SCHEMA_NAME given in yaml file>.

when schema value is given, mta.yaml file looks like below.

so in this case private build hdi container will have,  REPORTING_1, REPORTING_2 for each developers,  clear actual deployment will have REPORTING as the SCHEMA name.

Summary: 

In this blog 1, tried to cover the basics of services and apps created during build and deployment, In my next technical article, I will explain what happens during deployment of cross schema services, service_replacements here Part 2 in Web IDE for HANA.

 

Thank you.

Sreekanth

 

 

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally
      Blog Post Author

      Hi Daniel, Can you highlight the difference you found? I can't identify that in your above comment.

      Author's profile photo Debanshu Mukherjee
      Debanshu Mukherjee

      Good start Srikanth. Keep it up !

      I also believe that since you're starting from basics, it's imperative that we should clarify the term 'container' since it's much overloaded and mixed up. HDI containers are not the same as the application containers which the industry-wide tools such as Kubernetes deals with. HDI containers are rather DB level schema abstraction which is a lower level object compared to application containers. Both the HDI containers and application containers are micro-services based and thus are similar in nature.

      Regards
      Deb

      Author's profile photo Mohan Jagadeesan
      Mohan Jagadeesan

      Hello Sreekanth,

       

      If I have to debug a calculation in the target deployment which could be my production deployment, what is the mode to access it? I cannot debug a calculation view from DB explorer, have to be inside the container for that. How does that work?

      Regards.

      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally
      Blog Post Author

      Debugging calculation view is done in Web IDE Dev work space, which is design time activity and that will be done in Dev system. If you would like to debugging in QA or Production, then you will need to have your Web IDE for HANA installed on those servers.That is the only way I found.

      Author's profile photo Ranjithkumar Ayyavu
      Ranjithkumar Ayyavu

      Hi Sreekanth Surampally,

      I have provided the scema while creating a databasemodule in my mta project . As you mentioned i'm getting new scema for the private build. But i don't have the privalge to access the both scemas. Then i tired to create new scema using the SQL console in Database explorer and i have access for the scema.

      Questions:

      1. How to enable the privalige for the scema which is created during the build?
      2. How to use the scema in the mta project which is created using the SQL console in Database explorer ?
      Author's profile photo Sreekanth Surampally
      Sreekanth Surampally
      Blog Post Author
      1. You will have to a grant privilege on your container schema to users. This process is explained in other blog, https://blogs.sap.com/2019/08/02/xs-advanced-db-access-scenarios-overview/

      you can also go through the video on how to do that, https://www.youtube.com/watch?v=hbk7euYjCKo&t=756s

      2. You don't want to create schema directly in SQL console in XSA, because you can't use them in MTA project, you will have to always create them as design time artifacts using HDI containers.

      You may need to create schema in classic DB(not HDI containers), in this case, you will have to access the schema objects through user provide service and synonyms as explained in the blog I shared.

      Thanks  Sreekanth