简体   繁体   中英

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.

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM