Polylith
Polylith is a software architecture that enhances backend development by promoting functional thinking, offering composable building blocks, and simplifying code sharing, while being adaptable across various programming languages.
Read original articlePolylith is a software architecture designed to enhance the development of backend systems by applying functional thinking at a system scale. It aims to create simple, maintainable, testable, and scalable systems, likening its approach to assembling LEGO® bricks. This architecture allows developers to work with all code from a single location, providing the benefits of a monolith while promoting flexibility in production deployment. Polylith addresses common challenges in software development, such as code sharing across teams, communication of architectural concepts, and the complexity of growing codebases. It introduces composable building blocks, or "bricks," that can be easily shared and utilized, improving the development experience with tools for instant creation of components, incremental testing, and project visualization. While primarily used with the Clojure programming language, Polylith is language-agnostic and can be adapted for use in various programming languages, including Python. The architecture is not a framework or library but offers tooling support to facilitate its implementation. Resources for learning Polylith include documentation, example applications, and community engagement through platforms like Slack. The architecture is designed to simplify the development process, reduce complexity, and enhance the ability to make changes efficiently.
Related
Show HN: Triplit – Open-source syncing database that runs on server and client
The GitHub URL provides details on `@changesets/cli`, a tool for versioning and publishing code in multi-package and single-package repositories. Full documentation and common questions are accessible in their repository.
Igneous Linearizer: semi-structured source code
The Igneous Linearizer project enhances source code in Obsidian Markdown format, enabling features like links and transclusion. It sacrifices AST correctness for compatibility with text editors and Git, benefiting literate programming. Users must follow specific input file formats for optimal use.
I see this criticism of libraries from monolith fans a lot, and it confuses me. That would be true anyway - you cannot use code until you've built it (unless it's in a language which is interpreted/unbuilt/uncompiled etc.). This would be true if the code lived in a separate repo or in the same monorepo.
I suspect what they really mean is "you can't consume a new version of a library until that new version has been built _and pushed to a package registry_ from which it can then be referenced", which is just false in any language I have any familiarity with - Yarn Workspaces[1] allows the "live" use of Typescript libraries in a local development environment, Python has plenty of solutions[2], even the minimalist GoLang has Workspaces[3]. What am I missing? Is there some language which lacks this Workspaces support for "depending on local versions of dependencies" that is driving all this monolith-fever?
[0] https://polylith.gitbook.io/polylith/introduction/sharing-co... [1] https://yarnpkg.com/features/workspaces [2] https://stackoverflow.com/questions/1112618/import-python-pa... [3] https://go.dev/doc/tutorial/workspaces
This way, if any one service changes its API, the developer can just see what breaks and change all dependents. API changes are atomic, so we don't need any API migrations or versioning, and it's much, much easier to document API functions that are strongly typed with the appropriate types than HTTP calls.
The tooling is also great, to deploy a new application you just run the Django `startapp` command and that's it. You get authentication, background processes, events, linters, etc for free. It's very convenient, you don't even need to talk to infra.
So far so good.
Understanding Polylith through the lens of Hexagonal architecture - https://news.ycombinator.com/item?id=38109928 - Nov 2023 (2 comments)
Polylith is a functional software architecture at the system scale - https://news.ycombinator.com/item?id=30697724 - March 2022 (82 comments)
Show HN: Polylith – the last architecture you will ever need? - https://news.ycombinator.com/item?id=25253731 - Nov 2020 (10 comments)
Show HN: Polylith – A software architecture based on Lego-like blocks - https://news.ycombinator.com/item?id=18123996 - Oct 2018 (5 comments)
As for Polylith itself, it seems to have some fairly sensible non-controversial ideas like building atop a foundation of pure functions, building up shared libraries, separating code by component instead of layer, etc.
I'm curious as to what has been built (by yourselves or others) in the 4 (?) years since its release. Have the experiences held up to the initial goals and designs?
It seems to be a way to arrange your source code in a monorepo? Is there a core API? Are there servers?
Nobody "just" refactors their monolithic code into a new architecture.
Any sufficiently advanced organization with a microservices architecture has a platform team helping to standardize applications and build out shared tooling that's already being used across multiple services.
It seems like there's plenty of room for an architecture like this, but that maybe it's closer to what already exists in practice at the places where it will work, and doesn't exist at organizations where it won't work for good reason.
It doesn't _really_ solve python dependency/import issues. Instead, it helps to you keep your project in discrete chunks and well-organized. It also makes it easy to package up the separate projects as artifacts.
I've run into some issues with versioning separate projects but I suspect that is a matter of bandwidth rather than an actual, insoluble issue.
I'd use it again at a startup or on project where you need to ship a bunch of artifacts but don't have a lot of bandwidth.
Related
Show HN: Triplit – Open-source syncing database that runs on server and client
The GitHub URL provides details on `@changesets/cli`, a tool for versioning and publishing code in multi-package and single-package repositories. Full documentation and common questions are accessible in their repository.
Igneous Linearizer: semi-structured source code
The Igneous Linearizer project enhances source code in Obsidian Markdown format, enabling features like links and transclusion. It sacrifices AST correctness for compatibility with text editors and Git, benefiting literate programming. Users must follow specific input file formats for optimal use.