Earlier quoted context omitted.
This is exactly my experience. Most of the time people go to microservices for the wrong reason and they will regret that for years
Different sections of an app can use different databases, if the bottleneck is in the database. Different routes can be served by different servers, if the bottleneck is in CPU usage. Different async tasks can run on different task runner services, if the problem is tasks competing with each other. Different test suites can run for different sections of the app, if the problem is with tests taking too long to run. Gi…
Building Modular Rails Applications: A Deep Dive into Rails Engines
41–50 of 51 posts
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#42One of the reasons microservice architecture originally became popular was to break apart monolithic applications. In many cases, I bet a big driver was a lack of separation of concerns, and a more modular design was desired. There are many ways to put up walls in software to help make software more modular and self-contained. Rails engines are a good way to make more a rails app more modular. The number of times I'v…
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#43The Filament package for Laravel lets you build similarly encapsulated „plugins“, that are basically mini Laravel apps, that can be easily added to existing apps. The plugins can rely on all of the Laravelisms (auth, storage etc) and Filament allows them to easily draw app/admin UI.
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#44Earlier quoted context omitted.
I use multiple services for resilience. Example: With multiple services that have clear separation of concerns, you can debug and fix your processing layer without stopping the collection layer. You can update a distributor while workers wait and vice versa. This way I never have downtime anxiety. No regrets.
Separation of services is orthogonal to separation of concerns. There's nothing stopping you from having multiple entry points into the same monolith. I.e. web servers run `puma` and workers run `sidekiq` but both are running the same codebase. This is, in fact, the way that every production Rails app that I've worked with is structured in terms of services. Concerns (in the broad sense, not ActiveSupport::Concern) c…
I would also never connect services without a queue unless the message can be discarded (then I can use a pub sub). Using http is one of the most amateurish ways I can imagine to connect two services that I wrote. Even the thought is cringe. Is this common?
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#45Earlier quoted context omitted.
I use multiple services for resilience. Example: With multiple services that have clear separation of concerns, you can debug and fix your processing layer without stopping the collection layer. You can update a distributor while workers wait and vice versa. This way I never have downtime anxiety. No regrets.
What can you not do in a monolith? You can still have async queues and different event processors that stop and start independently within a monolithic deployment.
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#46Earlier quoted context omitted.
What can you not do in a monolith? You can still have async queues and different event processors that stop and start independently within a monolithic deployment.
If by monolith you mean multiple processes that you can control separately, each with their own memory state, you can do anything you want with it. That's essentially multiple services.
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#47Earlier quoted context omitted.
What can you not do in a monolith? You can still have async queues and different event processors that stop and start independently within a monolithic deployment.
Speaking as a monolith fan, IMO/IME the main drawback is RAM usage per instance. You can have a "big, beautiful" Rails monolith codebase used by both Puma and Sidekiq queues etc, and that works well from most standpoints. But RAM usage will be pretty high and limit horizontal scaling.
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#48Earlier quoted context omitted.
If by monolith you mean multiple processes that you can control separately, each with their own memory state, you can do anything you want with it. That's essentially multiple services.
Monolith architectures are not constrained to running as a single process or on a single machine at all.
Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#49Re: Building Modular Rails Applications: A Deep Dive into Rails Engines
#50Earlier quoted context omitted.
Speaking as a monolith fan, IMO/IME the main drawback is RAM usage per instance. You can have a "big, beautiful" Rails monolith codebase used by both Puma and Sidekiq queues etc, and that works well from most standpoints. But RAM usage will be pretty high and limit horizontal scaling.
Does it? RAM is not particularly expensive
Think about it from another angle. RAM is expensive when you're talking about cloud infrastructure at scale.
Or, think about it this way.
For a given compute budget, I can run X instances of Rails, or X times Y instances of a framework that uses less RAM. 100 instances of Rails versus 300 instances of Express or whatever.
Now, it still might be worth it to run Rails, because developer time is more expensive than cloud infrastructure. Or maybe you don't really need to scale. Or you could skip the cloud infrastructure and go bare metal, which is what Basecamp does last I checked.