Hacker News new | ask | show | jobs
by chebum 3419 days ago
@pbiggar Hi, Paul! Could you elaborate on poor scaling and concurrency bugs, please? From my understanding Closure's functional nature and immutability should minimize concurrency bugs.
1 comments

Suppose you have a background job you want to run. Clojure has good concurrency, so it's tempting to just run it in the background. OK, now it needs to retry: that's great, Clojure has STM so it'll keep retrying until it succeeds. So you have your process spin off a bunch of threads doing some background stuff. Easy.

Now, because you're using AWS, or a new deploy, or something else, the server dies. What happened all that stuff running in the background? Because it was built with clojure primitives, it never got saved anywhere, like it would if you had used a queue and workers.

The summary is: Clojure's awesome stuff encourages you to use it, but it's actually a bad pattern for horizontally scalable apps. Rails - lacking the cool concurrency stuff - forces you to have better habits, and makes them easy.