PoC: Isolate ApplicationSettings using modular monolith techniques
Problem
As part of Cells initiative we would like to understand what techniques we could leverage to isolate parts of the codebase (e.g. authentication, settings, users, etc.) within the monolith. Eventually some of these isolated modules could be extracted into services.
Context
We believe that the extraction of services would eventually need to go through a modularization within the monolith first, in order to better iterate on the module interface, responsibilities and dependencies. Operating within the monolith gives us the flexibility of making changes easily to the module. Once a module is extracted into a separate service it becomes much harder to make changes.
We should extract separate services when we are confident that the interface, responsibility and dependencies are clear.
Goal
We would like to PoC how hard it would be to isolate ApplicationSettings
Active Record model. We want to:
- Prevent the use of
ApplicationSettings
model directly in the codebase since it allows read/write. Referencing this and related constants is forbidden. - Allow developers to query for application settings through a safe read only abstraction.
- Allow admins to edit application settings through an authorized abstraction.
- Leverage Packwerk and other gradual modularization techniques to create a module/package that exposes public abstractions while hiding private concepts.