fxlacroix
fxlacroix

Reputation: 567

Multiple microservice symfony application share vendor folder

We are working on a new web project, with a microservice architecture.

We will need around 5 Front Web project, and about 5 API microservice orchestrate with an API manager.

We plan to use Symfony2 Framework, but I think it will be too Heavy. I mean because by the instance of the composer that will download all around the same library from symfony component, core... and same library used for each project (phpmailer for example).

Actually, I was asking myself about a great sharing strategy for the vendor folder assuming that each SF2 project would use a share vendor folder and compute all library in a unique folder. We need all the same version for each library in each project.

Does somebody have some experiment on this kind of sharing? Best practices? Is it preferable to have one vendor folder per project?

Open discution !

Cheers.

Upvotes: 3

Views: 1315

Answers (2)

user8700009
user8700009

Reputation:

You can define the vendor dir to be a shares folder into your composer.json

{
    "config": {
        "vendor-dir": "/usr/share/php/composer/vendor"
    }
}

Can it help you ?

Upvotes: 1

Constantin Galbenu
Constantin Galbenu

Reputation: 17683

You should not share anything between microservices. This is because you would loose the main benefit of microservices: you can deploy every microservice independently.

They should also be loosely coupled. They should be agnostic of the other technologies. This means that if you change from PHP to Java in one microservice then the others would not be affected. In fact they should not even know or care. The same with the database.

Upvotes: 0

Related Questions