# Modularizing Rails Monoliths One Bite at a Time

DevFeed: [Modularizing Rails Monoliths One Bite at a Time](<https://devfeed.tech/articles/modularizing-rails-monoliths-one-bite-at-a-time-20038.md>)

Original publisher: [Read original article](<https://technology.doximity.com/articles/modularizing-rails-monoliths-one-bite-at-a-time>)

Author: Doximity

Published: 2023-12-05T13:00:00Z

Content type: article

Language: en

Sources: [Doximity](<https://devfeed.tech/sources/doximity.md>)

Topics: [Ruby on Rails](<https://devfeed.tech/topics/ruby-on-rails.md>), [Refactoring](<https://devfeed.tech/topics/refactoring.md>), [modules](<https://devfeed.tech/topics/modules.md>), [Architecture & Design](<https://devfeed.tech/topics/architecture-design.md>), [Microservices](<https://devfeed.tech/topics/microservices.md>)

Tags: [microservices](<https://devfeed.tech/tags/microservices.md>), [modular-monolith](<https://devfeed.tech/tags/modular-monolith.md>), [modularization](<https://devfeed.tech/tags/modularization.md>), [modules](<https://devfeed.tech/tags/modules.md>), [rails](<https://devfeed.tech/tags/rails.md>), [refactoring](<https://devfeed.tech/tags/refactoring.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [ruby-on-rails](<https://devfeed.tech/tags/ruby-on-rails.md>)

## AI overview

The article describes using a phased refactoring approach and the packwerk gem to modularize growing Rails monoliths into modules with enforced boundaries. It presents the modular monolith as a lower-complexity alternative to adopting microservices and references Doximity's experience.

## Source excerpt

As Rails monoliths grow, coupling becomes increasingly difficult to manage. Developers often reach for microservices to help simplify things, but instead find higher complexity. The Modular Monolith approach is a proven, lightweight alternative that offers the benefits of enforced boundaries without being cumbersome. I spoke at the 2023 Rocky Mountain Ruby conference on how teams can use a phased approach to refactoring toward this style using the packwerk gem. At Doximity, we've used this gem and a phased approach to break some of our most critical rails applications into modules that are easier for our teams to work with. In November, 2023, I also chatted with Elise Shaffer on The Ruby on Rails Podcast about our experience with application modularization at Doximity. Be sure to follow @doximity_tech if you'd like to be notified about new blog posts.