24 karma · joined July 8, 2023
In the docs, you will find more about this setup with IPython integration, if the code evaluation things is something you look for too.
Yes, Microservices is about boundaries, data and the organizational structure. But there is code that makes these things happen and much of that can be reused.
With Polylith, all of that code lives in the same git repo, and you don't publish them to a repository because you have it "right there". For Python, you reference the reusable code just as any other Python namespace package. Basically the same thing for a Clojure namespace.
Everything isn't sharing everything, but several different services or apps could be using one and the same brick (as it is called in Polylith). A brick is a small isolated part of the code (usually much smaller than a library, that is an entire feature). I hope this has cleared some things up!
Services living in a Polylith repo are deployed independently, that's a big part of the tooling support and how code is structured according to the achitecture.
There's a couple of things you can do to configure the REPL (like auto-reloading modules that has changed during the session). I submitted a link to my blog post about this subject here: https://news.ycombinator.com/item?id=37394439 (hope it is okay to cross-post like this).
If you were about to pass on the result from a calculation to somewhere else, a dictionary or list would probably be a good idea. You probably wouldn’t want the entire system be aware of a Pandas specific data type.
I usually would prefer having everything behind the endpoint (such as Pydantic schemas & FastAPI) as simple dicts and lists.
Would you do the same if you were about to make changes in a code base with only dictionaries and lists in it? :)
From my point of view, the main reason to have code in a Monorepo is to be able to easily share code between different projects and have the code & tools at your fingertips while writing new code. This is where the Polylith Architecture comes in, focusing on this particular thing. There's tooling support for Clojure and Python as of this writing.
Also, I don't see anything bad with an organization having more than one "monorepo" for grouping a number of related projects - an example would be different monorepos for different programming languages. This would probably mean that the organization is a "polyrepo" one (or maybe multi-project).
The Polylith Architecture support these kind of scenarios: one monorepo for all code, or a number of multi-project repos within an organization. There's also tooling support for this architecture, currently for Clojure and Python.
I'm the maintainer of the Python tooling, that is a combination of two Poetry plugins - one with the name "multi-project plugin". Here's the docs for the Python tool: https://davidvujic.github.io/python-polylith-docs/
It is about a different kind of Kafka: Apache Kafka, with examples on how to get started producing & consuming messages with Python and Polylith.
Keeping it simple with only using pip would work for the more straight forward & simplistic kind of projects. But you would probably want something like Poetry to have a nice Developer Experience - and the abilities of Poetry plugins like Polylith to handle monorepos and sharing code.