Polylith
Search…
⌃K

Polylith

Polylith is a software architecture that applies functional thinking at the system scale. It helps us build simple, maintainable, testable, and scalable backend systems.

Introduction

Polylith is a software architechture that decouples the backend code into reusable ”LEGO bricks” that can be reused and shared (mainly) across services while we can still work with all our code as if it was a single codebase.
It allows us to postpone decisions on how to execute the code in production, and easily change how to run it, e.g. by increasing the number of services, without affecting existing bricks.
Each deployable artifact is just a config file that specifies the set of bricks we want to include.

Learn Polylith

There are several ways of learning Polylith:

Try it out yourself

To learn how to build your first Polylith system, head over to the poly tool documentation where you can install it and create a workspace and follow the examples using the powerful language Clojure. If you prefer Python, you can find an early version of that tool here.

How it's used in production

Watch when Sean Corfield explains how he uses Polylith and the poly tool at World Singles Network.

Look at working code

Go and have a look at these systems:

Watch a video

Get a high level introduction to Polylith with these two videos:
10-minute overview, by James Trunk
A 39 minutes overview of the Polylith architecture, by Joakim Tengstrand and Furkan Bayraktar

Listen to a podcast

Jacek Schae interviews the Polylith team in the ClojureScript podcast:
  • S4 E21 - Polylith with Joakim, James and Furkan (Part 1)
  • S4 E22 - Polylith with Joakim, James and Furkan (Part 2)

Slack

Come and chat with us and other Polylith users in Slack.

Read a blog post

Production systems

Enter the Matrix and have a look at different production systems.

Read the documentation

If you prefer reading documentation, then you’re already in exactly the right place!
Note that Polylith documentation is split into two parts:
  1. 1.
    This high-level documentation, which describes how Polylith works and the problems it solves. It tries to remain language agnostic, but does use Clojure in the code examples.
  2. 2.
    The poly tool documentation, which describes how to work with a Polylith codebase in Clojure.
Content:
  • Polylith - what is Polylith?
  • Polylith in a nutshell - walkthrough of the building blocks of Polylith.
  • Workspace - were we put everything.
  • Component - our composable building block (brick).
  • Base - building block (brick) that exposes a public API
  • Project - deployable artifact made of a set of bricks
  • Development project - the place where we work with all our bricks
  • Bring it all together - a short example
  • Simplicity - how Polylith simplifies the design
  • poly tool - overview of the poly tool
  • Current architectures - a walk through of common architectures
  • Advantages of Polylith - how Polylith differ from other architectures
  • Transitioning to Polylith - step by step guide on how to transition to Polylith
  • Production systems - list of companies using Polylith in production
  • Why the name "Polylith"?
  • Videos
  • FAQ - Frequently Asked Questions
  • Who made this?

What is Polylith?

Polylith is a software architecture that solves some of the fundamental challenges in building backend systems. Those challenges are:
  • It's difficult to share our code across teams and services
  • We lack a shared language for communicating architectural concepts
  • As our codebases grow, they tend to become a complex mess that is hard to change and test
  • We try to mimic our complex production environments in our development environment
  • Our systems take too long to test, build, and deploy
Polylith addresses these challenges by introducing simple, composable, LEGO-like bricks, which can easily be shared across teams and services. The choice of bricks determines what each artifact does and how it's exposed.
To make the development experience even more delightful, we've also built a tool which gives instant creation of the various building blocks, incremental tests (only test the code that's impacted by the last changes), and project visualization.

What isn't Polylith?

  • Polylith isn't a framework and does not come with ready to use functionality.
  • Polylith isn't a library.
  • Polylith isn't a tool (but has tooling support for Clojure).

What programming languages are Polylith for?

Polylith is language agnostic, and it should be possible to use it in almost any programming language. We in the Polylith team have only used it with the functional language Clojure so far, but there is nothing stopping someone from using it in a procedural language like C, or an object oriented language like Java. Even without tooling support, you will get most of the benefits.