frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Building Modular Rails Applications: A Deep Dive into Rails Engines

https://www.panasiti.me/blog/modular-rails-applications-rails-engines-active-storage-dashboard/
100•giovapanasiti•5h ago

Comments

henning•5h ago
This blog post just shows how libraries and frameworks often solve one problem but create another. This leads to the emission of ridiculous sentences like `One of the trickiest aspects of building engines is handling routing correctly` which would be a non-issue if you just wrote simple code to solve the problem in front of you instead of doing a bunch of "modular" "engine" framework-y compiler-y nonsense that adds boatloads of complexity just to accomplish one basic thing like handling file uploads.
adenta•4h ago
What problem was created?
pqdbr•2h ago
"one basic thing like handling file uploads" - say no more.

Actually, the article isn't even about handling file uploads - it's about deliberately creating a modular admin panel for dealing with file uploads.

It's not modularity for "framework-y" sake, but to easily deploy that admin panel in other applications with literally a one-liner.

giovapanasiti•2h ago
I couldn't have written this comment better myself. Thank you this is exactly the point
helle253•5h ago
I love Rails Engines, it's a very slick feature.

I recently migrated a featureset from one Rails project into another, as a mounted engine, and ensuring isolation (but not requiring it!) has been tremendously helpful.

hk1337•4h ago
I have been looking at using Rails Engines recently playing around with trying to get an idea off the ground.
GGO•3h ago
Rails engines are one of the most underrated features that everyone should be using more.
matltc•3h ago
Miss seeing rails in the wild
pqdbr•2h ago
Rails is not only alive and well, but actually booming.
Octoth0rpe•46m ago
> Rails is not only alive and well, but actually booming.

Do you have any references that validate this?

Rails 'booming' on a 3 year time scale wouldn't surprise me, but would on a 10 year scale.

capevace•3h ago
The 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.

mrinterweb•3h ago
One 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've seen microservices created for the purpose of modularity (not scaling concerns), and the complexity that has brought has really soured me on microservices.
giovapanasiti•2h ago
This is exactly my experience. Most of the time people go to microservices for the wrong reason and they will regret that for years
whstl•2h ago
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.

Github and others even allow specific subfolders to be "owned" by different teams.

What else is there? Even slowness of compilation and/or initialization can be alleviated, depending on the language or framework.

stronglikedan•1h ago
I think the point is that all of that adds complexity that is often unnecessary - a premature optimization if you will. It's like a hammer, and everything looks like a nail to a lot of people.
inopinatus•13m ago
GP isn’t oppositional, they listed runtime constructs that all run off a single monolith. The point being you don’t need so-called microservices for flexibility in the production environment.
leptons•1h ago
I've built numerous systems on AWS Lambda over the last 10 years, and have never once regretted it. YMMV.
ecshafer•53m ago
Ive regretted 99% of the services Ive built in AWS lambda over the years. Everytime it gets more complex than a couple hundred lines of code over a few lambas I start to think “if this were just one service, development, deployments, cicd, testing, storage would all be simpler”.
nurettin•2h ago
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.
zrail•2h ago
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) can be separated any number of ways. The important part is delineating and formalizing the boundaries between them. For example, a worker running in Puma might instantiate and call three or four or a dozen different service objects all within different engines to accomplish what it needs, but all of that runs in the same Sidekiq thread.

Inserting HTTP or gRPC requests between layers might enforce clean logical boundaries but often what you end up with is a distributed ball of mud that is harder to reason about than a single codebase.

mrinterweb•1h ago
For your example, rails apps handle this case by default with job queues that are managed by the deployment separately. There is a way to force the job queue to process in the same process as your web server, but that's not the way most should be running prod rails apps. There usually isn't anxiety associated with rails app deploys, in my experience.
rco8786•1h ago
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.
JohnBooty•16m ago
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.

malkosta•1h ago
Offset-based pagination will be a problem on big tables.

Anthropic signs a $200mm deal with the Department of Defense

https://www.anthropic.com/news/anthropic-and-the-department-of-defense-to-advance-responsible-ai-in-defense-operations
24•wavelander•19m ago•17 comments

LIGO Detects Most Massive Black Hole Merger to Date

https://www.caltech.edu/about/news/ligo-detects-most-massive-black-hole-merger-to-date
38•Eduard•51m ago•14 comments

Cognition (Devin AI) to Acquire Windsurf

https://cognition.ai/blog/windsurf
265•alazsengul•2h ago•192 comments

Kiro: A new agentic IDE

https://kiro.dev/blog/introducing-kiro/
538•QuinnyPig•6h ago•230 comments

NeuralOS: An Operating System Powered by Neural Networks

https://neural-os.com/
14•yuntian•1h ago•3 comments

Replicube: 3D shader puzzle game, online demo

https://replicube.xyz/staging/
37•inktype•3d ago•4 comments

Building Modular Rails Applications: A Deep Dive into Rails Engines

https://www.panasiti.me/blog/modular-rails-applications-rails-engines-active-storage-dashboard/
100•giovapanasiti•5h ago•24 comments

Embedding user-defined indexes in Apache Parquet

https://datafusion.apache.org/blog/2025/07/14/user-defined-parquet-indexes/
62•jasim•4h ago•6 comments

Cidco MailStation as a Z80 Development Platform (2019)

https://jcs.org/2019/05/03/mailstation
23•robin_reala•2h ago•1 comments

Strategies for Fast Lexers

https://xnacly.me/posts/2025/fast-lexer-strategies/
104•xnacly•6h ago•39 comments

Japanese grandparents create life-size Totoro with bus stop for grandkids (2020)

https://mymodernmet.com/totoro-sculpture-bus-stop/
180•NaOH•4h ago•42 comments

Lightning Detector Circuits

https://techlib.com/electronics/lightningnew.htm
47•nateb2022•5h ago•30 comments

SQLite async connection pool for high-performance

https://github.com/slaily/aiosqlitepool
10•slaily•3d ago•3 comments

Meticulous (YC S21) is hiring in UK to redefine software dev

https://tinyurl.com/join-meticulous
1•Gabriel_h•3h ago

Data brokers are selling flight information to CBP and ICE

https://www.eff.org/deeplinks/2025/07/data-brokers-are-selling-your-flight-information-cbp-and-ice
326•exiguus•4h ago•147 comments

Two guys hated using Comcast, so they built their own fiber ISP

https://arstechnica.com/tech-policy/2025/07/two-guys-hated-using-comcast-so-they-built-their-own-fiber-isp/
209•LorenDB•5h ago•130 comments

The Corset X-Rays of Dr Ludovic O'Followell (1908)

https://publicdomainreview.org/collection/the-corset-x-rays-of-dr-ludovic-o-followell-1908/
10•healsdata•3d ago•1 comments

Tandy Corporation, Part 3 Becoming IBM Compatible

https://www.abortretry.fail/p/tandy-corporation-part-3
40•klelatti•3d ago•11 comments

It took 45 years, but spreadsheet legend Mitch Kapor finally got his MIT degree

https://www.bostonglobe.com/2025/06/24/business/mitch-kapor-mit-degree-bill-aulet/
125•bookofjoe•3d ago•11 comments

Impacts of adding PV solar system to internal combustion engine vehicles

https://www.jstor.org/stable/26169128
90•red369•9h ago•201 comments

Show HN: Refine – A Local Alternative to Grammarly

https://refine.sh
356•runjuu•15h ago•181 comments

East Asian aerosol cleanup has likely contributed to global warming

https://www.nature.com/articles/s43247-025-02527-3
115•defrost•11h ago•124 comments

Lossless Float Image Compression

https://aras-p.info/blog/2025/07/08/Lossless-Float-Image-Compression/
78•ingve•4d ago•6 comments

M.2 SSD Can Self-Destruct by Giving Itself a Burst of Voltage

https://uk.pcmag.com/storage/159074/this-m2-ssd-can-self-destruct-by-giving-itself-a-burst-of-voltage
8•austinallegro•33m ago•1 comments

Show HN: Ten years of running every day, visualized

https://nodaysoff.run
834•friggeri•4d ago•420 comments

Six Game Devs Speak to Computer Games Mag (1984)

https://computeradsfromthepast.substack.com/p/six-game-devs-speak-to-computer-games
44•rbanffy•3d ago•11 comments

A Century of Quantum Mechanics

https://home.cern/news/news/physics/century-quantum-mechanics
86•bookofjoe•4d ago•75 comments

You Are in a Box

https://jyn.dev/you-are-in-a-box/
100•todsacerdoti•5h ago•100 comments

Why random selection is necessary to create stable meritocratic institutions

https://assemblingamerica.substack.com/p/there-is-no-meritocracy-without-lottocracy
157•namlem•5h ago•149 comments

Let's Learn x86-64 Assembly (2020)

https://gpfault.net/posts/asm-tut-0.txt.html
382•90s_dev•22h ago•97 comments