3 ms·
Does anyone here do Microservices well? And keep them in a monorepo?
by vinay_ys 7y ago
Does anyone here do Microservices well? And keep them in a monorepo?
- gen220 7y agoWe (~150 eng) build microservices in a polyglot environment (mostly Python, JS, and Go), all in a monorepo! We also build + deploy in containers with Jenkins, etc. The structure looks something like this: |-- third_party (third party libs) `-- python |-- libs (internally-written, common dependencies) `-- application_name |-- client (react app, connects to flask) |-- server (flask app, connects to services) `-- services (microservices) We use a dependency-management + build tool (https://www.pantsbuild.org/index.html https://www.pantsbuild.org/index.html, we started before Bazel was public) to manage dependencies. Without pants, our repo would be a mess. Let me know if you have any questions, I'm happy to answer them! I'm super happy about our setup and eager to share it :)
- gotofritz 7y agoOrganising apps by language seems weird...
- jjgreen 7y agoI've seen this and it works rather well in that one can have per-language bottom level build setup (with autoconf for C, setuptools for Python, ...).
- gen220 7y agoI agree with the GP that it seems weird, and with you that it has its benefits. Of course, other approaches have their own benefits. Personally, I feel like the top-level directory ordering for a monorepo is somewhat arbitrary, in that you can argue for anything, but it probably doesn’t matter; especially if you have a decent build tool.
- talaketu 7y agoHierarchical layout demands choices be made, but there are advantages in grouping source packages by language: 1) can naturally reflect object packaging models of target language (eg python, jvm). 2) this can encourage reuse of packages across projects.
- reificator 7y ago> Without pants, our repo would be a mess. Filed under sentences I never thought I'd hear.
- gen220 7y agoHahaha, because pants is a bad tool? Or because it sounds funny? I’m sympathetic to both :) In defense of pants, I meant that our repo would be a mess without a versioned dependency graph + reproducible builds. Of course other tools give you that too, and definitely do it better than pants does. I guess I should have said “without some build tool”, our repo would be a mess.