cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Read only

Deployment to separate micro services

marcmaur
Participant
1,752

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

Accepted Solutions (1)

Accepted Solutions (1)

falcaraz
Explorer
0 Likes

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 Likes

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 Likes

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

suraj-galande
Explorer
0 Likes
This statement "without any change in their models or code" is still there. Also no official guide seems to be available and linked in CAPM documentation.

Answers (1)

Answers (1)

gregorw
SAP Mentor
SAP Mentor
0 Likes

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 Likes

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