11 ms·
I couldn't agree more. Recently I switched back to Rails after 10 years. I can't say I enjoy the whole asset pipeline business but I yearn for a simpler time a
by haarts 5y ago
I couldn't agree more.
Recently I switched back to Rails after 10 years. I can't say I enjoy the whole asset pipeline business but I yearn for a simpler time and Rails gives that (to a degree).
My only wish it was simpler to host. I don't necessary want to buy into render.com or heroku.
- jfabre 5y agoYou should try phoenix and elixir, only been playing with them for less than a week and as a long time rails/ruby developer this is what it feels like again.
- Toutouxc 5y agoI'm also a Rails dev, currently doing Advent of Code in Elixir, I haven't tried Phoenix yet, but writing Elixir feels a lot like writing Ruby for the first time. It's the same kind of sexy, of-course-you-can-do-that feeling.
- dnautics 5y agoThat's really funny, my perception of Elixir is generally the sentiment "of course you can't do that". (that's a good thing).
- Toutouxc 5y agoFunny, you're also right. Of course you can't do that weird hacky thing you could totally do in Ruby but maybe shouldn't. I meant something more like "of course there's a function for that with the name you'd expect".
- AlchemistCamp 5y agoFor me Elixir didn't feel too much like Ruby, but Phoenix sure felt a lot like Rails. YMMV since Phoenix has gradually become more and more of its own thing than it felt like in 2016 when I learned it. There's really nothing I miss about Ruby for web dev and Elixir feels like a complete win to me these days. Ruby is still far nicer for unix-y scripting, though.
- bgroat 5y agoIn terms of ease of hosting? I'm considering migrating to Phoenix and my biggest concern is ease of deployment
- SkyPuncher 5y agoI've deployed Rails at a few different companies. I wouldn't quantify it has hard by any means, there's just a lot of configurations to read through and verify every time. Realistically, the defaults are complete sane and could be deployed as is without much change.
- cutler 5y agoAgreed. Immutable functional Elixir is the very opposite programming model of mutable state Ruby OOP.
- dnautics 5y agoI hear fly.io is good.
- jfabre 5y agoI've just tried heroku so far and took me about 30 min to deploy my prototype, but I read there are limitations. Go take a look at fly.io and I think there's also another one that specialize in elixir hosting. Once I understand elixir/erlang better, I will probably want to host there.
- lostcolony 5y agohttps://www.gigalixir.com/ https://www.gigalixir.com/ is likely what you're referencing. Since they're focused on Elixir first it supports a buncha the nice things the BEAM supports, such as native clustering, hot upgrades, and opening a REPL to a running cluster.
- dqv 5y agoIt really is a nice experience. The BEAM family of languages was the first for me where doing multiple things at once came natural. It doesn’t require pulling in a library or adding redis or having to worry about shared state. You just add a process to a supervisor.
- machiaweliczny 5y agoYeah and then how do you deploy new version? In practice you still need Redis for most stuff. Also if anyway you have to deploy containers then value of BEAM is dimnished and provably better go with Go.
- sph 5y agoYou don't need Redis if you learn the BEAM and OTP. Elixir runs on top of a distributed VM with builtin clustering. Use it. And I see nothing wrong with having the BEAM run in Docker or K8s. There's some overlap in concepts, but they work at totally different layers. Using the BEAM is like having resilient microservices _inside_ your app with none of the downsides.
- innocentoldguy 5y agoCould you be more specific about the issue you're having with deployments? I've never used Redis in any of my Elixir/Phoenix apps. In cases where I might need something like Redis to store state, I'd reach for a GenServer or maybe Mnesia instead. I've never had an issue with deployments using this strategy. Also, K8s and BEAM work together just fine using libcluster. I'm not a fan of K8s or Docker and don't use either one, but you easily can. The benefit of BEAM is that it can surgically handle a vast array of failures without restarting the node. K8s, on the other hand, will take the pod down and restart it. In many cases, solving a problem with BEAM is like using tweezers to remove a splinter whereas K8s is more like using a sledgehammer.
- cultofmetatron 5y agoas someone on his 3rd year on a startup built on elixir, you're making the right choice. Our system is faster than an equivalent node setup while building features is almost as productive as rails. In some ways better. Plus, if you're goal is realtime or anything heavily websocket based, its going to easily outperform node or rails.
- proxyon 5y agoI simply cannot understand why people care about "fast" anymore with cheap containerization, CI/CD infra and no more dedicated servers. Who cares if its fast? Just add another box. I have this suspicion that anyone who still cares about backend speeds is stuck in the vertical scaling mindset where they need to keep adding cores and processes to a single machine
- coldtea 5y ago>I simply cannot understand why people care about "fast" anymore with cheap containerization, CI/CD infra and no more dedicated servers. Who cares if its fast? People who pay for those extra boxes? Not everybody has your budget (especially when they're building things themselves, on the side, so they aren't even paid).
- montblanc 5y agoGetting to that scale on the side is a nice problem to have. Maybe it shouldn't be on the side anymore.
- proxyon 5y agoA cheap micro container is $5 a month. A cheap dedicated server can be had for $20 a month. Budget is not the issue here.
- true_religion 5y agoAn expensive dedicated server can also be had for $1300 a month. Scaling vertically can take you a long long way before you actually have to start separating services.
- jspash 5y agoI bounced from Rails to Phoenix and couldn't be happier. I've done lots of functional programming before my Ruby days but never saw it coordinated in such a way that made sense to me. And since I only do web dev it was a perfect fit. That said, I'm _really_ excited to get into all the goodness that Rails 7 has to offer. I really thought they lost their way with the whole webpacker debacle. I recently installed a fresh Rails 7 app and the word webpack doesn't even exist anymore! It's like a breath of fresh air to be done with that. Those were some dark days. (I'm exaggerating only a little)
- aantix 5y agoCurrently using Jumpstart Rails ( https://jumpstartrails.com/ https://jumpstartrails.com/ ) with esbuild for a personal project and it's so fast..
- montblanc 5y agoElixir and Ruby have nothing in common as languages and ecosystems, I really don't get why the 2 keep being brought up together. Oh I do get it - whenever someone mentions Ruby some Elixir user will say - hey have u tried Elixir?
- regularfry 5y agoRuby and Elixir do have surface syntax in common, and Rails and Phoenix are clearly from the same conceptual direction. They're more similar than, say, Rails and Spring Boot. This is not surprising: the Elixir folks were fairly high-visibility in the Ruby community before they did Elixir and Phoenix.
- montblanc 5y agoI'll give you surface syntax in common, other than that not much. I think a Rails dev would have a much easier time picking up Django or Laravel than Phoenix. How hard is the switch from Rails to Django? Probably trivial. But Ruby to Elixir is a mind shift.
- deleted 5y ago[deleted]
- eropple 5y agoRuby to Elixir is a mind shift. Rails to Phoenix...I don't think so. But most Rails programmers write Rails, not Ruby, and it's important to differentiate them. Ruby is a big playground. Rails is...not, by design. (This is why I do not like Rails, personally--if I am choosing to write code in Ruby, it's because I expect to need to get weird with it.) Rails->Phoenix omits a lot of the stuff that makes Elixir cool, both in itself and in OTP, but that's not a bad thing and I do think the transfer isn't too onerous for somebody coming purely from Rails.
- montblanc 5y ago> But most Rails programmers write Rails, not Ruby You're really exaggerating.
- danjac 5y agoWhat's Phoenix/Elixir like for deploying these days? When I last seriously played with it a few years ago the development was a lot of fun (and Elixir has influenced how I write and architecture on other platforms) but I remember deployment to production being a pain.
- ch4s3 5y agoIt's pretty easy if you use something like fly or render, anything dockerized really.
- OkayPhysicist 5y ago"mix release" makes it pretty much a breeze. I find myself spending more time setting up a Postgres server than mucking about launching my backend.
- 1_player 5y agoIt's not harder to Dockerise than any other language.
- jhgb 5y agoSee, emteycz? Popularity is not the same thing as satisfaction. ;)
- mawise 5y agoYou're welcome to adapt the AWS deployment scripts I setup for Haven[1]. I tend to adapt them when deploying other personal projects like the sites I've built for my family tree or privately hosting/sharing old family home movies. [1]: https://github.com/havenweb/haven/tree/master/deploymentscripts https://github.com/havenweb/haven/tree/master/deploymentscri...
- Toutouxc 5y agoWhy do you think it isn't simple to host? If you yearn for the simple times, no one is stopping you from just spinning up a VPS with Ruby, Passenger, Nginx and your favorite database. Of course the larger your project is, the more hassle, but that's not specific to Rails.
- berkes 5y agoI have been doing this for upwards of 10 Ruby projects for over a decade. It is not simple. Python or Node.Js suffer the same issues, though. Compared to dropping a go-binary or rust build somewhere and firing that up, Rails/Ruby (Rack, Sintra, Rails etc) are a mess. In no particular order, the issues I had to deal with in the last three months: * asset pipelines crashed randomly; turned out the ~2GB build VPS had too little memory to run the asset pipeline. * puma and unicorn and phusion cannot be ran and configgured easily on one server. * rbenv builds are hard to manage. * getting the correct gems on your server is a mess. There is bundler, rbenv, vendored, rubygems.org, gem, Gemfile, Gemfile.lock, ruby-version in gemfile, ruby version .ruby-version, all of which can -and will- conflict at some point. Add to that, that a typical Rails app requires at least redis, postgresql/mysql, quite some lib-x headers to build native gems, and imagemagick etc, and you have a very complex setup. This isn't more complex than your typical Django, Laravel or ExpressJs setup. But it is far more complex than deploying a go, rust, or Java bundle.
- jaredcwhite 5y agoThis hasn't been my experience at all. Deploying Ruby-based projects in recent years is streamlined and repeatable. The term soup you're throwing out there makes me wonder why you're either overthinking this or not streamlining your own processes.
- berkes 5y agoOne cause of the problems is that the servers are handling multiple ruby deamons amongst which some Rails apps. I know things get simpler when you keep "one app/thread - one server". But price-wise that doesn't make sense, especially since many common Rails apps hardly run on a the cheapest VPS (a throttled dual-core 500MB server). If you run ten tiny services, ten servers add up quickly. I also host some larger apps on their own server, some loadbalanced over multiple servers. But throwing 10+ ruby services on a VPS is hard. Especially if you don't want to, or cannot constrain their ruby-versions, app-server, etc. It is hard for the exact same reason why setting up a local env may be hard. I recently had to help a co-worker on an old MacOS machine who broke her entire mac-desktop because she installed RVM because somehow that was in the tutorial for getting the app locally. Anything with a runtime is harder than anything without that runtime. This is too obvious, but does warrant some highlighting. Ruby's runtime is one of the hardest of all runtimes because it comes with so many moving parts. Python is a close second, and on Ubuntu (my main driver) probably worse than Ruby, because fing up Node is fine, but fing up Python can render your machine unusable, unrecoverable so without good understanding of all python things.
- jamiequint 5y agoIt’s been a long time, but I used to use convox for this back in the day, may still be worth checking out: https://docs.convox.com/example-apps/rails/ https://docs.convox.com/example-apps/rails/
- 1337shadow 5y agoDid you try uwsgi? I have been hosting everything with this thing for over a decade and I still love it: https://uwsgi-docs.readthedocs.io/en/latest/Ruby.html https://uwsgi-docs.readthedocs.io/en/latest/Ruby.html
- pkz 5y agoAgree on the hosting part. I would like an official docker compose for production that had everything tied together nicely.
- anurag 5y ago(Render founder; genuinely curious) what about Render makes you not want to use it?
- danjac 5y agoPython/Django developer here, but I've found Digital Ocean+Dokku to be a pretty decent cheap alternative with more flexibility than Heroku, especially for an early-stage side project where a single server is enough for your needs.
- rronalddas 5y agoI used to use Dokku a lot for hosting Flask APIs, am now using Caprover , the added GUI is great
- kovacs 5y agoTake a look at Cloud66. Been using it for every project over the last 10 years or so... It's like Heroku except you can control a lot more and not get locked into "enterprise" pricing when you need to scale or simply don't want to expose your database to the open internet (imagine that).
- adriand 5y agoCheck out https://www.hatchbox.io/ https://www.hatchbox.io/, it lets you easily host stuff on various hosting platforms (using your own account) with similar ease to Heroku. Which also means it's WAY cheaper. Heroku's pricing has always seemed insane to me.
- strzibny 5y ago> My only wish it was simpler to host I think it can be simple if you keep it simple :). In my book Deployment from Scratch I show people how to run Rails on a cheap VPS with a couple hundreds lines of Bash. Just Ruby + chruby + Puma + systemd (and optional systemd socket activation). I include a scripted demo (so you don't have to do it yourself) which demonstrates all of the this: - Setting up a git-pust deployment for Ruby applications - Using chruby to automate installing requested Ruby versions - Configuring NGINX as a proxy using UNIX sockets - Setting up systemd socket activation for graceful restarts - Configuring NGINX to serve static assets - Configuring NGINX to proxy WebSockets connections for Action Cable - Automatic SSL/TLS certificates with Let's Encrypt - Redirecting HTTP traffic and subdomains to main domain over HTTPS - Running PostgreSQL and Redis on the same server - Building a custom SELinux module - Configuring firewall - Setting up automatic weekly system update - Setting up log rotation for NGINX and PostgreSQL logs and max limit for system log - Doing application backups and restores - Creating admin tasks Although it sounds like a lot, the demo is reasonably small and clean so you can go through all the files in 2 hours. I think people many times complicate what they don't need to complicate...
- Lukas_Skywalker 5y agoI have been using a software called dokku for about six years. It‘s like Heroku, but you self host. It even uses the same buildpacks. You just run the dokku installer and off you go.
- colbyhub 5y agoI've had good success on my side-business with Piku: https://piku.github.io https://piku.github.io It's essentially a lightweight PaaS that you can run on your own hardware (even ARM)
- mrinterweb 5y agoI think it used to be harder to host than it is now. I think the only thing that might be hard now is sifting through all the tools for hosting and the analysis paralysis that can come with that. Heroku can get pricey at scale, but heroku and others are options that make it dead simple. Then there are a ton of options for how you might want to self-host. There are plenty of guides for getting docker setup with it, opensource heroku-like alternatives (most using docker under the hood), and plenty of resources (maybe too much).
- daveungerer 5y agoIf you don't mind hosting on AWS, Elastic Beanstalk is a pretty streamlined way to host Rails apps, and it doesn't cost anything more than the AWS resources you consume.
- firecall 5y agoI'm using hatchbox.io on Linode! And it's great! Hatchbox takes the maintenance and setup out of DevOps for me! Using Hatchbox makes it easier to treat servers like cattle and less like pets!