cancel
Showing results for 
Search instead for 
Did you mean: 

CAP best practices - usage of hana native objects in CAP

lucascardoso3
Explorer

Hey experts,

I work for a SAP partner company and we have recently started to adopt the use of CAP in our Nodejs backend development. I have to say that everything is looking great so far, however my colleagues and I come from a classic SAP Hana development which means that we used to use xsjs for some tasks, Table Functions and Calculation Views for other.

In CAP development I personally have to say that i prefer use pure Nodejs development (with typescript), but some of my teammate prefer to use SAP Hana objects to solve some harder tasks because they don't have to much practice with Nodejs javascript and typescript coding style.

So my question is: What are the pros and cons about using SAP Hana native objects inside CAP development?

Some things that I've notice so far:

- We're not able to run full local development when using SAP Hana native objects

- Debugging is not friendly like Nodejs applications

- General testing is way better in Nodejs in terms of ease

- Generally Table Functions and Calc Views are harder to maintain than ts code

We will be very happy if the experts help us.

Thx,
Lucas

View Entire Topic
chathia
Explorer

Hi Lucas,

When you say "solve some harder tasks" -- I presume it got to do with the performance related complex topics. When we use HANA in any of the business use case, we tend to take advantage of its processing capability and potential to push-down complex calculations.

General advice is to build with layers of CDS views. However, in case of limitations we do in calculation views, TF and expose it via CDS layer. Either ways, it solves the (huge) data transfer to Node.js layer as much possible if the solution is designed effectively.

Point to think: If you are building with multiple layers of CDS Views to solve a complex business problem (with more data) and of course it is compatible to deploy in any db (practically), but as of now HANA and Eg. PostgreSQL by community contribution - CAP - Using Databases, I always wonder will the DB be able to handle such a push-down effectively for the logics built in CDS views alone.

My suggestion is to think thoroughly on the business use case and if HANA is your primary ingredient, then go for full blown CAP CDS layers of views + HANA artifacts. Keep the Node.js layer as a orchestration oriented.

- We're not able to run full local development when using SAP Hana native objects

- Debugging is not friendly like Nodejs applications

  • True, this is one area which is not straight forward. But if we use BAS / WebIDE there are ways to debug SQL Script

- Generally Table Functions and Calc Views are harder to maintain than ts code

  • It depends on the skill set 🙂 we do have solutions built and maintained in Native HANA (FYI, there are also cases we were unable to rebuild some of the HANA Calc.View / TF logics in Node.js "easily", it still runs as HANA artifacts exposed by CDS)

Regards,

Chathia