Add ruby equivalent of node.js app #487
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @antonputra,
First off, I really enjoyed your YouTube video on comparing Ruby and Node.js performance (https://www.youtube.com/watch?v=Qp9SOOtgmS4). It's clear you put a lot of thought into demonstrating real-world differences, and I appreciate how it highlights practical insights for developers choosing between the two. Videos like yours are super helpful for the community!
I've been tinkering with the ruby setup and came up with what I think could be an even closer apples-to-apples comparison. I'd love to get your take on it—maybe it could complement what you've already shown us. Here's why I believe
ruby-app-node-equivalentaligns so well as an alternative for the Ruby side:1. Architecture Similarity
This keeps things balanced by mirroring the straightforward, low-level approach on both sides, which really lets the languages shine through without extra frameworks getting in the way.
node-app: Relies on Node.js's built-inhttpmodule for that raw, efficient handling. Keeps dependencies light with justpostgres,prom-client, andjs-yaml. Routing is handled directly in a simple structure:app.js,db.js,devices.js,metrics.js,config.js.ruby-app-node-equivalent: Matches that vibe using WEBrick (Ruby's equivalent low-level web interface). Dependencies stay minimal:pg,prometheus-client,rack,yaml. It handles HTTP requests directly with manual routing in a parallel file setup:app.rb,db.rb,devices.rb,metrics.rb,config.rb.ruby-app: Builds on a high-performance server like Iodine, with extras likeconnection_pool,oj,rage-iodine,standalone_migrations, andrake—great for optimized scenarios, but it shifts the focus a bit.2. Dependency Comparison
By keeping dependencies equivalent, we can see how each language performs its core tasks without one side having an edge from specialized tools.
node-appruby-app-node-equivalentruby-apphttpwebrickorrackrage-iodine(external)postgrespgpg+connection_poolJSONJSONoj(optimized)prom-clientprometheus-clientprometheus-clientjs-yamlyamlyaml3. Code Complexity
The code stays concise and direct in both minimal versions, making it easier to follow and compare line-by-line.
node-app(98 lines):ruby-app-node-equivalent(158 lines):ruby-app: Incorporates patterns like models (Device.create,Device.list), migrations, connection pooling, and optimized JSON withOj—awesome for scaling, but adds layers that make direct comparison trickier.4. Fair Performance Comparison
Starting from similar minimal baselines lets us isolate language differences more clearly, which I think aligns perfectly with the educational goal of your video.
node-appvs.ruby-app-node-equivalent: Both keep it lean with direct HTTP handling—no extras tipping the scales.node-appvs.ruby-app: The optimizations inruby-app(like Iodine and pooling) are smart for real-world use, but they create different starting points.5. Purpose Alignment
Your
node-appis spot-on for a simple, educational demo, andruby-app-node-equivalentaims to match that exactly—minimal and focused on comparison.Summary
In short,
ruby-app-node-equivalentcould enhance the comparison by matchingnode-app's simplicity: similar low-level HTTP, minimal dependencies, direct code structure, and a shared focus on learning rather than production tweaks. It's like pitting two basic sedans against each other to see which handles the road best, keeping the spotlight on the engines (languages) themselves.What do you think? Does this resonate with what you were going for in the video? I'd be thrilled to hear your feedback and hopefully see another video where you show us again the comparisons!
Thanks again for the great content, and looking forward to your thoughts.
Best,
David