Live data from Hacker News

Ask HN: Is NodeJS stable enough to build the next Twitter?

news.ycombinator.com

1–10 of 60 posts

Ask HN: Is NodeJS stable enough to build the next Twitter?

#1
I've already written all of my APIs and the entire backend using NodeJs and Postgres. My biggest fear is what happens if it breaks down, as my start up is something akin to say twitter(not really, but thought that's a better example when it comes to stability and a good API), I'm worried if node is good enough to build the next twitter.

I'm well versed in Python, and if things go balls up, I can rewrite the entire backend in a weekend in Python. But having used Python before in many other projects and been rather pissed with its overhead of realtime operations, I picked Node as the way to go.

But am I right? If things have gone wrong for people here using NodeJs, where does it happen? Which parts should I be most careful in during the architecture of the project?

EDIT:

Thanks for the answers till now. To clarify, no, I'm not building the next twitter. I took it as an example to explain a worst case scenario(or best case scenario, the way you look at it). Recently Jeff Atwood wrote about why he choose Ruby, and he made a valid point that isn't the cool language anymore. It has matured, stable and all of that. Considering that I wasn't using Node since it came into existence, I can't comment on its maturity.

Most examples in Node available on the web, try to clutter up everything in one file. So, I wanted to know the best practices when it comes building an architecture in node.

Re: Ask HN: Is NodeJS stable enough to build the next Twitter?

#2
If you have enough traction that this is a problem, you can get Ryan Dahl / Joyent / et al to help you.

Node's pretty well tested by now for heavy traffic. It's not my personal cup of tea but I imagine that the obvious bugs and performance degradations have all been squished.

Re: Ask HN: Is NodeJS stable enough to build the next Twitter?

#4
Mozilla uses node.js for several parts of their architecture: https://hacks.mozilla.org/category/a-node-js-holiday-season/ (recommended read).

It should be stable enough for building a large scale application but maybe not easily for an app as big as Twitter (we are talking about a shit-ton of requests per second). You are not there yet though, are you? :)

Re: Ask HN: Is NodeJS stable enough to build the next Twitter?

#5
If you are not handling every possible error correctly, then you might end up with errors taking down your app with no idea how they were initially caused, so your app can suffer significant downtime without you knowing where to start in terms of fixing it.

If things go wrong in python, you'll probably have an easier time identifying it and fixing it due to actual helpful stack traces.

You should be very very careful when architecting your project and make sure you understand error handing to a T.

Re: Ask HN: Is NodeJS stable enough to build the next Twitter?

#6
Premature optimisation is the root of all evil. If you're building something that will be as big as Twitter, the programming language will be the least of your problems. Figuring out how to scale all of the connected system horizontally, independently, will be more important than whether you chose Node or C# or Java or Python.

Re: Ask HN: Is NodeJS stable enough to build the next Twitter?

#7
Whatever you write now would never scale to be Twitter as it is now, there's no point even considering that as you aren't thinking on anything like that scale conceptually. I doubt most developers can. But then writing something that could scale to Twitter scale when you don't have a business or users or revenue would be pointless.

Specifically to answer you question, no. Node could work as a thin publishing veneer on a much larger stack but you just don't get what you need from Node.js end-to-end.

Re: Ask HN: Is NodeJS stable enough to build the next Twitter?

#9
I'm not sure how you're defining 'stable' here, but I'll comment on another aspect of your concern.

Twitter started with Rails, and at some point decided it was more efficient to do an incremental rewrite on the JVM.

    I can rewrite the entire backend in a weekend in Python.
I'd bet it took Twitter a bit longer to replace their infrastructure, and they survived just fine.

Build in whatever is rapid, for you. At this very moment. Using your resources.

Keep things service-oriented, decoupled. It'll be easy to replace things one component at a time, if needed.

in summary..

I think it's a perfectly cromulent platform to build on in terms of speed and scalability. But, in case you and I are wrong, follow my advice about staying decoupled and it won't hurt as much.

Re: Ask HN: Is NodeJS stable enough to build the next Twitter?

#10
I think that most people that have lots of experience using Node would say that it is stable enough for the most part (that's what I tend to read anyway, big grain of salt with that). Cross-platform compatibility is much, much better than it was in the distant past. It will be the idea and not the technology you choose that will determine whether or not it becomes the 'next Twitter', as long as it is developed soundly. It shouldn't really matter. If you did end up scaling up before the final kinks are worked out of Node.JS and commonly used libraries, then like you say: Just write it in Python over the weekend and see if you can do better.
Post reply on HN