cancel
Showing results for 
Search instead for 
Did you mean: 

CAP Runtime & database support

martin-kl
Explorer

Hello everyone, especially the CAP team,

we are currently getting started with a CAP project and after some tryouts we ran into some general questions regarding CAP:

Runtime

  • The first and most important question for us is: which runtime environment should we commit ourselves to?
    I went over quite some similar questions and the consensus seems to be "whatever the team is more comfortable with". That's why we started our prototype with Java but as we progressed, we noticed that most of the available information and examples are in Node.js. Furthermore, new features seem to be available for Node.js first (like the very new Hybrid testing or Streaming & Media types which were only available in Node.js earlier this year).
    Therefore, we are now thinking of changing to Node.js where Typescript would also be an option, but an early test showed that this is also not that straightforward to setup and use and there isn't much content available yet to help us (hoping that improves over the next months...).

Database support

  1. If we understand this correctly, Hana is the only supported database for productive use on the BTP?
  2. For our project, a Hana database would be more than overkill which is why I looked into the cds-pg and cds-dbm projects. On a first look at the CAP Database Support this adapter seems to only support the Node.js runtime. But after quite some trial and error and adaptions of various build and deployment steps, I finally managed to deploy a CAP Java application with the PostgreSQL, hyperscaler option (thanks to gregorw for the really helpful pg-beershop btw). For anyone interested: I had to remove the "cds" commands from the cds-maven-plugin, adapt the build of the service module in mta.yaml to use cds-dbm and use most of the db-deployer-apt from the beershop project. Most of this was caused by the fact that I could not fully customize the "cds cds" and therefore "cds build" tasks, which also entails that I could not use the cds-maven-plugin as intended since it only uses "cds" and cannot be changed to "cds-dbm". If we look at the current Readme of cds-dbm and the CAP Changelog it seems that this changed with cds@5.3.0 and we can now fully customize these tasks, including a change to use cds-dbm instead of cds, is this correct?
    Cause if I understand that correctly, we are then able to integrate this into the cds-maven-plugin and therefore get PostgreSQL support also for projects using the Java runtime. (unfortunately I could not test this yet as I have compatibility problems with @sap/cds >5.1.5 with postgres...)
  3. This gets us to another question: is a support for other databases planned? Or is it the current take that anyone should use HANA in production and Postgres is only possible via a community project without any official support (as it is the case now)?
    And what about MongoDB, where an out of the box support is marked as "in progress" for the Java runtime? That would be an interesting option but I cannot find any further information about this. Can you tell us something about it? Like is there a planned timeline for a release and does that entail that we may see new, non-Hana, DB offerings on the BTP or is this supposed to work with offerings directly from the hyperscalers?

Best regards
Martin

Accepted Solutions (0)

Answers (2)

Answers (2)

robinjayasinghe
Advisor
Advisor

BTW: at least for hybrid testing we now have basic support for the Java stack: please check or documentation for hybrid-testing. Deeper integration e.g. for better IDE support is possible and on the roadmap.

robinjayasinghe
Advisor
Advisor

CAP Java vs. CAP node.js

We have a shared roadmap for both runtime environments in CAP and try to implement bigger topics in the same pace. However, sometimes a given feature is easier to implement in the one enviromnment than in the other and the release of the feature deviates. So, in the end the choice still depends on the preferences of your team.

Database support:

Yes, SAP HANA is the only fully supported database for productive usage at the moment.

Currently, the CAP Java team is working on a similar pluggable-db approach like the one available in the CAP node.js environment. With that it would be possible to use other JDBC compliant databases together with CAP Java. Of course only if somebody implemented a plugin for the desired database. This, however, would cover the runtime aspect only.

The CAP Java runtime is tested with PostgreSQL 12. But there are severe limitations that rule out productive use: there is no support for schema generation, no schema lifecycle management and no support for multitenancy - to name a few.

To support other databases but HANA for productive use we also have to cover schema generation, deployment and lifecycle management. For both, node.js and Java. I cannot tell you a date / target release at the moment as we have not published an official roadmap so far. Regarding the sketched solution with cds-pg and cds-dbm I have to say that you're leaving the supported scope of CAP Java. And also with node.js you would have no support from SAP for anything generated or executed by community modules.

Regarding the MongoDB support in CAP Java we can say that this effort is still in progress. Thus, it's neither documented nor supported at the moment. Also, as the roadmap is not public at the moment we cannot tell any timeline for MongoDB support.