TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How We Moved Our API From Ruby to Go

151 pointsby spimmyalmost 10 years ago

17 comments

aikahalmost 10 years ago
Go is a good target to move something to when one knows one&#x27;s business domain and performance issues.<p>But I wouldn&#x27;t recommend it to beginners trying to build a secure web application, because they will have to roll their own code when it comes user registration, authentication, authorization management, and i&#x27;m not even talking about writing thread safe libraries where one has to deal with mutexes and shared memory access.<p>If you need something highly concurrent and you know what you&#x27;re doing, by all means. But Go is definitely not RAD for classic website development, and it&#x27;s easy to shoot oneself in the foot with Go. It&#x27;s by no mean a silver bullet.<p>I&#x27;m surprises Parse is coded in Rails,I assumed to was built on Nodejs, since it uses JS for cloud code.
评论 #9694149 未加载
mattknoxalmost 10 years ago
Twitter never used Jruby in any significant capacity. Note that the article she cited ( <a href="http:&#x2F;&#x2F;www.infoq.com&#x2F;articles&#x2F;twitter-java-use" rel="nofollow">http:&#x2F;&#x2F;www.infoq.com&#x2F;articles&#x2F;twitter-java-use</a> ) said we were evaluating jruby, but chose not to use it because the tooling around MRI was much better (in substantial part due to the efforts of twitter&#x27;s backend team at the time).<p>We probably could have made a great jruby memcached&#x2F;MySQL&#x2F;thrift client, but it wasn&#x27;t clear that doing so would have much performance win, as jruby itself wasn&#x27;t dramatically faster than MRI. It would have, however, made it really easy for us to offload intense bits of code to java code, which probably would have been a faster upgrade path than rewriting in scala as we did.
评论 #9694463 未加载
评论 #9694020 未加载
waterside81almost 10 years ago
I&#x27;ll add another data point. We&#x27;re in the process of moving our entire API stack to Go from Python. First it was in Django, then Falcon, now more &amp; more pieces are in pure Go, with a little cgo sprinkled for good measure. Apart from being a language that&#x27;s easy to pick up if you&#x27;re familiar with Python, Go is obviously a heckuva lot faster and way easier to deploy.<p>We cut down our EC2 instance usage by 2&#x2F;3 with more improvements yet to come. One machine alone can handle 1000 API calls &#x2F; second - and our API calls are performing complex calculations, not just disk I&#x2F;O.<p>It also allows us to deploy our API within customer&#x27;s networks if they choose, which we previously accomplished using Virtual Machines - which sucked.
bsaulalmost 10 years ago
Afaik, the jvm is often praised for being the gold standard in terms of vm, both performance wise and in terms of tools available to instrument it. I&#x27;m curious as to why the parse engineers were not looking forward to using it. I&#x27;ve always thought using it was a good point for a language...
评论 #9695148 未加载
xacaxulualmost 10 years ago
Between this and Pivotal moving Cloud Foundry CLI tools to Go, I keep seeing more reasons to add Go to my CV. Ruby will always be fun, but I&#x27;m guessing there will be some serious $$ &amp; interest in Go projects in the coming years (even more than currently).
评论 #9694570 未加载
评论 #9693974 未加载
julien_calmost 10 years ago
“The MongoDB Go driver is probably the best MongoDB driver in existence, and complex interaction with MongoDB is core to Parse.”<p>It&#x27;s also the only one that&#x27;s not maintained by MongoDB Inc. Coincidental? :)<p>PS: And yes, `mgo` by Gustavo Niemeyer is pretty incredible.
评论 #9694673 未加载
评论 #9694713 未加载
HugoDiasalmost 10 years ago
I would love to know about Parse&#x27;s stack&#x27;s, please, consider sharing with us :) (<a href="http:&#x2F;&#x2F;stackshare.io&#x2F;trending&#x2F;tools" rel="nofollow">http:&#x2F;&#x2F;stackshare.io&#x2F;trending&#x2F;tools</a>)
jbbarthalmost 10 years ago
The article makes some very good points, and I&#x27;m surprised you don&#x27;t talk more about the deploy advantages for instance. But I was a bit annoyed by little things that I think are inexact:<p>- the &quot;one-process-per-request&quot; meme along the post applies only to some ruby app servers (there are event loop and threaded models too, think thin, puma, passenger in some modes) and I guess reading between the lines that it&#x27;s mostly a problem of thread-safety and async support, because of the gems Parse used to have, right? I&#x27;m sure that limits options at some point anyway, but the statement is misleading and not really explained, I&#x27;d love to hear more details<p>- I don&#x27;t understand how the comments in the little Go file snippet applies in any way to &quot;ruby&quot; ; it may be rails caching mechanisms, or a specific gem, but I have a hard time mapping those very specific details to something intristic to ruby, it seems more like grumpy ruby bashing, like you&#x27;d have done php bashing 5 years ago<p>As all rewrite stories, I think there&#x27;s a part of envy&#x2F;excitement over the new cool tech you want to use (and that&#x27;s fair! pleasure give you huge productivity boosts), and also a part of success related to the fact you <i>know</i> the kind of things you failed in the first version, so you won&#x27;t make the same mistakes the 2nd time.<p>I&#x27;d love to hear finer details on those points! Great article overall anyway
评论 #9695272 未加载
headiusalmost 10 years ago
It&#x27;s a decent article but the justification for rewriting is totally discredited by not even having tried JRuby. Many apps drop right in and get true concurrency, better GC, and faster performance for free. It sounds like JRuby wasn&#x27;t even given a chance, and I know they never contacted the JRuby team to talk about it.
rdwalmost 10 years ago
This bit jumped out at me: &quot;200 API servers ... to serve 3000 requests per second&quot;. That&#x27;s only 15 RPS per server. Is that normal for Rails?
评论 #9694018 未加载
评论 #9694307 未加载
评论 #9693930 未加载
评论 #9695754 未加载
AKiferalmost 10 years ago
Starting a business with rails makes sense and still do. And later moving to another technology that scales better makes sense too. After all, you will probably be a millionnaire at the time you need to scale your product so why worry ?
评论 #9694269 未加载
mordocaialmost 10 years ago
Rails does not require a process per a request model. It is great that you had success moving to Go, but you could have moved to a different model with rails and likely solved your problem.
评论 #9695861 未加载
baroslalmost 10 years ago
&gt; Stuff like doubly encoded URLs<p>Could you elaborate on this? It sounds a bit scary. Does this mean that Rails tries to decode a URL several times until it can&#x27;t be decoded? If so, isn&#x27;t this problematic if some (arguably crazy) person tries to send &quot;%2F&quot; literally, not &quot;&#x2F;&quot;? I&#x27;m half sure I&#x27;m misinterpreting, so here to ask.
vruizalmost 10 years ago
I wonder if had Microsoft open sourced C# earlier the choice would have been different. Seems like it.
评论 #9694437 未加载
crimsonalucardalmost 10 years ago
Didn&#x27;t even look at Haskell. Does any expert know how Haskell would fare in this situation?
评论 #9695415 未加载
culoalmost 10 years ago
What tools are you using to do API management on top? Have you seen the Open-Source KONG? <a href="http:&#x2F;&#x2F;github.com&#x2F;mashape&#x2F;kong" rel="nofollow">http:&#x2F;&#x2F;github.com&#x2F;mashape&#x2F;kong</a>
dirkgadsdenalmost 10 years ago
&quot;How We Moved Our API From Ruby to Go and Saved Our Sanity&quot;... Right, so using Go will alleviate severe mental illness? Why isn&#x27;t Golang all the buzz in professional psychologist and psychiatrist circles?
评论 #9693935 未加载