cancel
Showing results for 
Search instead for 
Did you mean: 

CAPM on BTP Points to HANA DB On premise

sreehari_vpillai
Active Contributor
0 Kudos
1,217

I have a running CAPM application deployed on XSA on On premise HANA Database .

Question : I want to deploy this CAP application to Cloud Foundry in BTP , use its XSUAA but the DB must still be my on premise DB .

Can I do that ? if yes - how would I configure my hana service instance / user provided service in BTP ?

( in my on premise, after the application is deployed, I removed the DB service binding from the application and then tried to set the environment variable VCAP_SERVICES manually - System didn't obvioulsy let me do that )

Sreehari

gregorw
Active Contributor
0 Kudos

Could you explain why you want to do this? You will have quite some latency for your calls.

sreehari_vpillai
Active Contributor
0 Kudos

We have a 3 years agreement with hardware provider for SAP HANA. And we have an application , done on CAPM, deployed on on-premise XSA ( thanks to Bookshop demo ) . Now the customer wants to explore BTP - So to move this application to Cloud Foundry , using Launchpad service etc.

But, they ask - is it possible to keep the data in my HANA database , but application runtime in Cloud Foundry ?

perhaps its a bad option , because of the latency - Lets say HANA Database is from AWS and between AWS and BTP , we have a 1 GBPS connection , which ideally must reduce the latency . Is it still possible to do like this ?

What I tried to do in my on-prem

a) I created a user provided service , and pasted the content from hana service instance . Then bound this to the application service instance. I was checking if it just use these parameters to connect to db - Failed - Its-expecting a hana service connection .

b) then I tried to set the VCAP_SERVICES environment variable directly using xs cli - Failed , system wont let you set any env variables if it starts with VCAP

if its not something possible in CF , doesn't this mean that CAPM has a complete lock in with HANA services and BTP ?

Sreehari

Accepted Solutions (1)

Accepted Solutions (1)

gregorw
Active Contributor
0 Kudos

Hi Sreehari,

the best option that I see would use SSO from BTP via Cloud Connector using X.509 Client Certificates. You can follow Configure SSO with X.509 Authentication for XS Advanced Applications to setup this on the XSA part. For cloud connector you have to adopt the documentation Configure Principal Propagation for HTTPS for XSA. I've already used this technique to get SSO to a non SAP Java based solution.

I would suggest to host the UI5 part of your app in BTP and let CAP handle the OData part on HANA XSA.

Best Regards
Gregor

sreehari_vpillai
Active Contributor
0 Kudos

thanks for this Gregor. If I read this right , you are suggesting me to

  • Deploy my Application in XSA in my on-premise HDB
  • UI to be deployed on BTP
  • Then SSO between BTP & On-premise
gregorw
Active Contributor

Correct.

sreehari_vpillai
Active Contributor
0 Kudos

thanks for this Gregor .

So I can say that , CAPM framework , has complete lock-in with SAP HANA Cloud database , to use Cloud Foundry as application server.

Answers (2)

Answers (2)

daniel_schlachter
Product and Topic Expert
Product and Topic Expert

Hi Sreehari,

when you deploy a CAP application the connection to the HANA database is automatically taken care of by the hdi-shared service instance, which contains a service key.

This service key contains the connection details to the cloud database via jdbc together with schema name, certificate, user, password etc.

Instead of letting this hdi-shared instance be created automatically during deployment (which will pick the HANA cloud instance on the same account or one shared through instance sharing from another account) it is possible to create this hdi service instance manually and connect to a HANA DB anywhere else (even a different Global Account)

The issue you would be facing here however is, that the DB you are trying to access is not reachable from BTP without reaching through a destination and the cloud connector.

I am not sure, if it is possible to somehow reference a destination from the key.

Alternatively, it could be an option to:

- leave the CAP app running as it does at the moment and build a proxy (CAP) app on BTP that uses the onPrem CAP app as an external service

- build a proxy app that forwards jdbc traffic through destination and cloud connector to the backend and configure this as a jdbc endpoint (just an idea, haven't tried this)

- deploy a HANA Cloud database and federate data access e.g. through SDA towards the onPrem DB

Thanks

Daniel

sreehari_vpillai
Active Contributor
0 Kudos

Thanks Daniel . Makes sense

Sree

sreehari_vpillai
Active Contributor
0 Kudos

gregorw

I did an experiment today with this topic.

I have a DEV and QA landscape of HDB , with XSA installed. And I have a capm project .

  1. generated 2 mtar files. One with app router and service module . Another one with just DB module.
  2. DB mtar I deployed in DEV . Other one is deployed in QA.
  3. In dev , the DB service instance credentials is copied and kept it in a file in srv module
  4. In server.js , i loaded this file content as VCAP_SERVICES environment variable programmatically - expecting it would then reach DEV database

and it did. DEV DB sql port was reachable from QA and it all worked well. So , takeaway is , this works but with obvious workarounds.

Latency : My DEV server is in Dubai and QA is in Germany . I could notice considerable latency ( perhaps 200% ) in communication . I would try the same with BTP CF and On premise database ( this must work logically )

cheers

gregorw
Active Contributor
0 Kudos

It's not good from a security point of view to have credentials hardcoded in a file.

sreehari_vpillai
Active Contributor
0 Kudos

That was just to test if this works. I would rather create a user provided service with this content and load from that programatically.
these wouldn't be best practices , but I would like to have such an option to connect to external HANA DB from CF.