Live data from Hacker News

Moving my serverless project to Ruby on Rails

frantic.im

51–60 of 189 posts

Re: Moving my serverless project to Ruby on Rails

#51

I have no strong opinion on serverless but I’ve used Rails for 13 years now (in massive $multi-million SaaS products as well as hobby projects) and it still makes me happy. I keep thinking about learning Node and React but I just can’t be bothered because Rails lets me get things done so quickly while also being a joy to write Ruby and Rspec. Regarding hosting, I think this is actually a great time to host Rails apps…

I’m also a big fan of rails, but I’ve experienced a lot of problems scaling it. A lot of the problems ultimately came down to the simple fact that Ruby is really, really slow. At a certain scale you end up forced to develop infrastructure on a different stack to keep up with the CPU load. I never ran into that so quickly when building similar systems with java, go, and C#.

I wanna say something nice about rails too so I’ll say I have never seen a team so quickly deliver high quality web app features than a well oiled rails team. It’s something to behold.

Re: Moving my serverless project to Ruby on Rails

#52
post #37

Earlier quoted context omitted.

Thete are multiple solutions to that problem. 1. API Gateway and AppSync integrate directly with many other AWS services, no Lambdas needed, and thus no cold-starts. 2. Lambda has provisioned capacity. 3. Other cloud providers like Cloudflare offer FaaS without cold-starts.

> 2. Lambda has provisioned capacity. I know little about lambda. Provisioned capacity, as in an instance running 24/7? Like a server?

I think so, that's why I usually try to avoid it.

But I guess it's the last resort if you absolutely have to use a Lambda without cold-start

Re: Moving my serverless project to Ruby on Rails

#53
post #7

> A lambda publishes a message to SNS, another one picks it up and writes something to DynamoDB, the third one takes that new record and sends an email… Or, you know, just do related functionality in the same AWS Lambda function. While I would probably do the sending of an e-mail asynchronously as well (as AWS Lambda function triggered by a DynamoDB stream), the indirection over SNS to write something to DynamoDB see…

The impossible to replicate the production environment I think was referred to impossible to replicate locally, on your machine. At my job I use AWS serverless services and I get a lot of frustration not being able to test and debug code offline. Having each time to upload some code to debug it is time consuming. Also you have to rely only on logs to debug, you obviously cannot use a debugger, and thus the solution i…

Ugh, I rewrote my serverless service for exactly these reasons. It felt magical the first time where you can deploy a service without spinning up a server so I put up with all these annoyances. But then docker gains popularity and suddenly there is no practical advantage in using serverless anymore, at least for me. I rewrote the service in django, packaged it as a docker image, then run it on any platform that can run docker.

On the other hand, I use cloudflare worker on a bunch of my projects. Unlike aws serverless, cloudflare worker is actually useful because it can do many things that can't be done by traditional backend, such as running and intercepting requests on the edge servers that sit between your server and your visitors.

Re: Moving my serverless project to Ruby on Rails

#54

I have no strong opinion on serverless but I’ve used Rails for 13 years now (in massive $multi-million SaaS products as well as hobby projects) and it still makes me happy. I keep thinking about learning Node and React but I just can’t be bothered because Rails lets me get things done so quickly while also being a joy to write Ruby and Rspec. Regarding hosting, I think this is actually a great time to host Rails apps…

I’m also a big fan of rails, but I’ve experienced a lot of problems scaling it. A lot of the problems ultimately came down to the simple fact that Ruby is really, really slow. At a certain scale you end up forced to develop infrastructure on a different stack to keep up with the CPU load. I never ran into that so quickly when building similar systems with java, go, and C#. I wanna say something nice about rails too s…

Curious what part of Rails you didn’t find scalable? Our Rails frontend servers run on cheap VMs that are easily scaled horizontally.

Re: Moving my serverless project to Ruby on Rails

#55
Having worked with AWS serverless for a couple of years, I think the architecture is not well suited for replacing a monolithic application. If horizontal scaling is an issue, I think containers are better suited. Serverless seems to be a better fit for ETL/Data Transformation workflows.

Re: Moving my serverless project to Ruby on Rails

#56

I have no strong opinion on serverless but I’ve used Rails for 13 years now (in massive $multi-million SaaS products as well as hobby projects) and it still makes me happy. I keep thinking about learning Node and React but I just can’t be bothered because Rails lets me get things done so quickly while also being a joy to write Ruby and Rspec. Regarding hosting, I think this is actually a great time to host Rails apps…

Elixir (with Phoenix) really is the sweet-spot for a productive framework that's fast, scalable and easy to pick up for a Rails developer:

https://medium.com/coryodaniel/from-erverless-to-elixir-4875...

Re: Moving my serverless project to Ruby on Rails

#57

Earlier quoted context omitted.

I’m also a big fan of rails, but I’ve experienced a lot of problems scaling it. A lot of the problems ultimately came down to the simple fact that Ruby is really, really slow. At a certain scale you end up forced to develop infrastructure on a different stack to keep up with the CPU load. I never ran into that so quickly when building similar systems with java, go, and C#. I wanna say something nice about rails too s…

Curious what part of Rails you didn’t find scalable? Our Rails frontend servers run on cheap VMs that are easily scaled horizontally.

Scaling horizontally is not cheap. A faster language needs fewer replicas.

Re: Moving my serverless project to Ruby on Rails

#58

I have no strong opinion on serverless but I’ve used Rails for 13 years now (in massive $multi-million SaaS products as well as hobby projects) and it still makes me happy. I keep thinking about learning Node and React but I just can’t be bothered because Rails lets me get things done so quickly while also being a joy to write Ruby and Rspec. Regarding hosting, I think this is actually a great time to host Rails apps…

I am not a good programmer. Every time I try to learn a language I end up down rabbit holes and always end up yak shaving.

Whenever I take the plunge I am always reassured; Ruby and Rails does make me happy.

Re: Moving my serverless project to Ruby on Rails

#59
post #37

Earlier quoted context omitted.

Thete are multiple solutions to that problem. 1. API Gateway and AppSync integrate directly with many other AWS services, no Lambdas needed, and thus no cold-starts. 2. Lambda has provisioned capacity. 3. Other cloud providers like Cloudflare offer FaaS without cold-starts.

> 2. Lambda has provisioned capacity. I know little about lambda. Provisioned capacity, as in an instance running 24/7? Like a server?

It’s more like you have one Lambda instance that is always running (sure think of it like one server) that can serve the first page instantly while the other ten thousands Lambdas take half a second to warm up. That first Lambda responds instantly so it hides the half second response for the rest of the application.

It really makes sense if you have traffic that spikes at certain times per day (think like fantasy football). There’s going to be times when no one is using your application but when they do, there are going to be dozens or hundreds of people suddenly using it. So the first person that logs on hits the provisioned Lambda instantly and then AWS warms up the rest of the Lambdas as more traffic comes in.

Re: Moving my serverless project to Ruby on Rails

#60
post #39

Earlier quoted context omitted.

All you need is one weekend to really learn a useful amount of Node and React. You can’t spare it?

Why bother? I work on a very UI-heavy interactive app (it's a gantt chart) for work and therefore have been doing react daily for 1.5 years. React is probably making life a little easier here, and I don't hate it, but I don't love it either. If I didn't love my team so much I would be looking for a job working on a more classic web app in Rails. And when I profess my appreciation for Rails, I could just as easily be…

I know some Rails shops that are switching to Stimulus Reflex for some UI-heavy things, it works like Phoenix LiveViews, you can briefly see how CodeFund uses it for their interfaces here (40 seconds in): https://www.youtube.com/watch?v=F5hA79vKE_E&feature=youtu.be...
Post reply on HN