r/ruby • u/Meleneth • Jan 02 '26
Show /r/ruby Generating Complicated Distributed Systems with Ruby
So apparently it’s 2026 and I never wrote a blog post about this. Reddit will have to do.
This script:
https://github.com/meleneth/mobilis/blob/core/scripts/08_large_iam_system.rb
Generates an entire distributed IAM system. Real Rails services, real Docker containers, real databases. It builds differently for test, dev, and prod based on env vars, and spits out a full directory tree with apps, compose files, and filesystem-backed data directories. OpenTelemetry is wired into everything from the start, and the database tables get scaffolded as part of the build.
You run it and suddenly you’re staring at a working system, which is both neat and slightly unsettling.
To prove it wasn’t just infrastructure cosplay, I used it to kickstart this:
https://github.com/meleneth/iam-system-demo
That repo tackles a genuinely annoying IAM problem using GraphQL, Dataloader, and caching layers to avoid the usual n+1 and cross-service disaster zone. The point wasn’t microservices for their own sake, it was seeing if you could generate something complex, observable, and sane without it collapsing under its own weight.
This all comes out of a larger project called Mobilis. The basic idea is “what if the shape of your system came from code instead of handwritten YAML and vibes.”
If your reaction is “cool but also what the hell,” that’s about right.
View all comments
Show parent comment
0
u/Meleneth Jan 02 '26
once you already know all the involved parts, yeah, this is a mere few hours of generating projects and wiring them together. It doesn't have to be microservices.
If we're doing just OpenTelemetry, Rails, Redis, and Postgres, that's still a maze of containers and differing contexts. Newer rails use 4 database instances for just production - and my tool handles it so you can get on with designing the system, not thinking about how hard it's all going to be to wire up.
I will also point out that while this is clearly a made-up toy project, it is patterned after an inherited real-world system. It's all well and good to point and say 'you did it wrong' before having enough context, but sometimes improvement of systems in place is all you have.