cancel
Showing results for 
Search instead for 
Did you mean: 

Deployment to separate micro services

marcmaurí
Participant

Hi CAP Community,

Here and here in the CAP documentation we are informed about the ability to deploy our developed services to separate micro services:

"Late-cut µ services This protocol-agnostic API allows mocking remote services, as well as late changes to service topologies, for example, co-locating services in a single process or deploying them to separate micro services later on.".

"Yet, given the uniform way in which services are defined and consumed, you can decide later on to separate, deploy, and run your services as separate microservices, without any changes to your models or your code.".

My CAP project services are running in a single process and I would like to separate them in multiple processes.

I have been playing around the mta, the cds.build.tasks and other stuff but I can't get it.

Could anyone give me some light on this?

Thanks in advance.

Best regards,

Marc

marcmaurí
Participant
0 Kudos

Support ticket 391049 / 2022 raised.

Accepted Solutions (1)

Accepted Solutions (1)

falcaraz
Explorer
0 Kudos

What I understand about that part of the documentation is that you have the opportunity to create microservices out of a single (monolithic) project that consists itself of several service definitions. That means that in order to split said project into several independent microservices, you'd have to create several projects (one for each service definition that you want to be "independent") and then use them like any other remote services as it is specified here.

marcmaurí
Participant
0 Kudos

Thank you Francisco for your insight. I hope the solution doesn't go that way 🙂 because, if so, the "without any change in their models or code" would not be true. I would rather expect some configuration in the mta and in the package.json or .cdsrc.json by which it could be defined.

falcaraz
Explorer
0 Kudos

I'm afraid it might go that way...

marcmaurí
Participant

Hi Francisco,

You were completelly right. The support ticket I opened has been resolved with the following information:

"

The sentence in the documentation is a bit misleading, we will adjust it.

So you need to a change a few things:

1) You need to create a new CDS app
2) You can import the model definitions of your first app and move the custom handlers there

If you want to send HTTP requests from one service to another, you need to create a destination and configure the services
as external services, as described here: https://cap.cloud.sap/docs/guides/using-services#introduction

"

FYI gregorwolf

Thank you and best regards,

Marc

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

The first step could be that you use the parameter instances in your mta.yaml#L26 to define that not just one srv instance should be started. But for the topic on how to really split into separate instances which take care about only one service is a different thing. Hope that someone from the SAP CAP Team can answer that.

marcmaurí
Participant
0 Kudos

Hi Gregor,

thanks for your answer! Yes, that's it, I would like to split my services into separate instances.

Looking forward to hearing from the SAP CAP Team.

Best regards,

Marc