I want to scale separately some subparts of my rails app and avoid loading the whole codebase.
For the sake of example, let's consider an APIv1 vs an APIv2, but I'd also want to extend this any class/service in general
Is it possible to exclude a specific folder from the eager load (production) or autoload (in dev) ?
For example,
api-v1-production
environment should exclude
controllers/api/v[^1]/**/*.rb
api-v2-production
environment should exclude
controllers/api/v[^2]/**/*.rb
I am writing [^x] as a convenient notation for everything but x) for the sake of example
I know it is possible to add some autoload/eager load folders but what about excluding some instead ? (especially if they are inside app/
which is autoloaded/eager loaded by default)
I want to avoid loading in memory too many classes/services, etc. that I know won't be useful