Dungeons, Dragons & Composable Architecture
2 months agoTable Top Role Playing Games and Software Architecture might sound like two very different things, but in this instance they do share some similarities. But first, let me explain what Dungeons & Dragons and Composable Architecuture mean.
What is Dungeons & Dragons?
Dungeons & Dragons is the most popular TTRPG (Table Top RolePlaying Game) in the world. This game is played by at least two players: one Dungeon Master who takes the role of storyteller and rules arbitrer, and one ore more players. The Dungeon Masters sets the stage for the players to live out a fantasy adventure.
The game has a core set of rules, which are actually open source, in the Systems Reference Document (SRD) and a lot of supplemental rules which build on top of this. The supplemental rules can be divided into four categories:
Core Rules: a more detailed and expanded version of the System Reference Document
Expanded Rules: Additional content, both by Wizards of the Coast themselves as well as content 'endorsed' by them
3rd party Content: The most common: extra classes, creatures, spells or items, but also complete adventures written by anybody
Homebrew Content: Content made for a specific campaign and not intended to be published publicly
What is Composable Architecture?
Composable Architecture is a software design philosophy focussed on adaptability and using the best tools for a given task (best of breed). Traditional software is often a so called 'Monolith', where all logic is a part of the same application. While in composable software you'd use different applications or services for different tasks or responsibilities within the bigger landscape.
You'd, for example, use different services for the main content (CMS) of your application and the Blog. In the case of this website I'm using Storyblok as my CMS and Wisp as my blog. Though this is overkill for a website as simple as this, if it weren't I could have different content editors and blog writers, or I could publish my blog on different channels besides this website.
How is this comparable?
Both Dungeons & Dragons and Composable Architecture have a framework on which to build, for Dungeons & Dragons it's the SRD and for Composable Architecture it can be the chosen tech stack. But this framework is just the basis on which you build further. A common tech stack for composable project can be a headless with an REST API as backend, this would be our framework.
Core Rules / Tech Stack
Though maybe our tech stack, like the SRD, is a bit bare. So on a company level we can define our 'Core Rules', or a more detailed and expanded version of our tech stack. For example we'll use NextJS as our frontend framework, Tailwind for styling and we use OpenAPI for contracts between our frontend and backend. From here on we can add to this framework to create whatever we desire.
Expanded Rules / Integrations
Based on your tech stack and which services you want to integrate, there could already be easy solutions to do this. For example Algolia offers the InstantSearch libraries with which you can easily implement Algolia on a Website, or Storyblok has a TypeScript SDK which you can use.
Similar to Dungeons & Dragons, if you want a horror themed adventure you can add the content from Curse of Strahd, or if you're a big turtle fan you can add the rules from The Tortle Package.
3rd party content / Open Source Packages
While there not always are integrations made by the service themselves, or these integrations lack specific requirement, there are often open source alternatives which can do what you want. Also outside of integrations, in software development we often rely on 3rd party packages for small things like date formatting, or icon libraries.
In Dungeons & Dragons there is a treasure trove (pun intended) of 3rd party content, both free and paid, you can use to add to your game. From specific classes to entire game worlds.
Homebrew content / Business Logic
Lastly there is homebrew content, this would be your custom code and business logic. Things you can't find in other services and need to be custom made for your application or game. For a web application this can be as big as an implementation with a propriatory CRM or as small as an unique ay to display some images.
For Dungeons & Dragons it can also range from large, the entire world the game takes place in, to small, like a single mouse like creature.
In summary
Software architecture and roleplaying games are two very different things, with very different goals. Both do focus on the ability to adapt and customize to your wishes. As long as you have a strong foundation you can create anything you set your mind to! Whether it's an application or a adventure to save the world. This of course isn't a perfect analogy, it's two very different things with very different goals. But what is similar, a strong foundation with a focus on adding to it, is the core appeal of both of them.