Hacker News new | ask | show | jobs
by tptacek 4074 days ago
I've had nothing but bad experiences trying to do things I'd ordinarily do in Rails in Golang instead (and I really like Golang). Writing "Rails apps" in Golang feels a like like writing them in Sinatra used to feel: good at first, but halfway through you realize you're just wasting time reimplementing a buggier version of half of Rails.

On the other hand, I've had very good experiences factoring subsets of Rails apps out into trivial HTTP/JSON services, and frontending them with Rails. That's how Microcorruption.com works, for instance.

4 comments

I've taken a similar path as you - trying "Go for all", and ending up front-ending them with Rails,Node, etc. I felt sort of dirty doing it - but the Go ecosystem specifically around web projects is not nearly as far along for "basic things" as Rails. Heck, I saw last night that people were arguing on the right way to create basic web auth in Go!
Factoring out microservices into Go (I assume where you need better performance or concurrency) seems like a really interesting way to go rather than cutting over wholesale. Anything about it particularly difficult or interesting, or was it pretty straight forward?
Why use Rails as a frontend? One of the reasons I'm using Go for service decoupling is to get rid of Rails long startup times. I just route the requests using Nginx and skip Rails altogether.
Because it's much faster to build functionality in Rails than in Golang, and not every feature of an app has the same performance requirements.
I think jlhonora just means to proxy from nginx directly for the services that aren't powered by rails. Like 90% of the site served from rails and the high performance services are just different nginx backends.

Potentially what you're already doing.

Exactly
Yep.
This is what we've done. Start with Rails behind nginx, add varnish caching when needed, redis when needed, node (or golang or w/e) when necessary for the real time bits, etc.

Get's a bit messy with all these moving parts, but I think that's the just the nature of large projects. Elixir + Phoenix looks interesting though...

Same stack for Starfighter?
We are Rails, Golang, and Postgres, with most of our code in Golang.