Live data from Hacker News

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

news.ycombinator.com

21–30 of 60 posts

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

#21

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.

Exactly. Your biggest challenge today is getting some users. Build a product that allows you to do that, and then worry about whether it scales.

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

#23
Yes, it is stable enough. BUT, that assumes you know how to write code that will work under various conditions that can and do arise.

The main thing that can cause shit to hit the fan is not properly handling errors. I highly suggest using domains, and that when an error occurs, if you can, that you gracefully exit. If not, then all other requests will just abort and that isn't very user friendly.

You will also want a way to be notified of errors, so you can stay on top of them and fix them right away. I use winston and have the error level set to email me.

If you want to talk in more detail, contact me... address is on my profile.

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

#24
The same practices apply everywhere, not just for any one particular stack.

On a side note, if you've already written your entire backend, I'd recommend user testing, then releasing your product (so that you actually have a chance of becoming the `twitter' you so desire) instead of focusing on your particular (seemingly already-decided-upon) tech stack.

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

#26
It works for us, but it comes with a lot of issues, some of which are pretty major, although this holds more true in the ecosystem, not always in core. Problem is see is that no one seems to know how to solve them (it's a callback, no it's node, no it's v8), takes so much time or just plain don't care (socket.io, I'm looking at you), so you're on your own if you encounter something critical.

Either case start getting traction, don't over optimize at the start and watch out for memory leaks: there are tiny bits of best practices that you must follow (always consume the response? check. close the request appropriately? check. don't crash the whole node process? check.), some of which not really well documented, that can ruin your day should you get some important press and are not implemented correctly.

Take a look at the issue tracker of the libraries you are going to use, check if there's something that can affect you and perhaps contribute back!

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

#27
post #17

I run http://jsonip.com . It's a single node process running on a VPS. It supports more than 10 million requests a day and barely stresses the system. Granted that its a relatively simple app, but it's raw node.js. I can easily scale it in a few simple ways like adding a caching layer and/or load balance a few extra servers. Haven't needed to yet.

I doubt there's a language out there that couldn't do 100qps of this complexity on a single modern core. It doesn't really say anything positive about Node

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

#28
Node is sitting at the core of the new Viki platform. It's been a pretty flawless part of the stack. We do zero-downtime deploys thanks to the cluster module, which also keeps workers running (I haven't seen an unhandled error take down a worker in a while, but as with most any stack you need to be pretty vigilant about your error handling). At over 3K api requests per second to a single box, we hover at around 0.05 load (our machines range from e3-1230 to dual 2620s, so it's hard to get an exact number). When asked to handle more request, the impact on load is pretty linear.

We're also dealing with servers in 4 different locations and some requests need to be proxied to a central location. With a ~300ms round trip from Singapore to Washington, Node's asynchronous nature has been a win when it comes to handling concurrency in the face of backend latency.

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

#29

I can't really speak for twitter but we use node.js happily at Soundkeep. It works greate for our use case of streaming audio processing. It has come a long way since it started. Obviously it isn't as mature at Ruby/RoR or Python/Django but not nearly as bloated either. The comparison is weak though since it isn't a framework but more of an environment. A lot of people like to think of it in comparison to the big fra…

I'm in the streaming field too; how can you say it's working great if you haven't launched yet to the public?

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

#30

Yes, it is stable enough. BUT, that assumes you know how to write code that will work under various conditions that can and do arise. The main thing that can cause shit to hit the fan is not properly handling errors. I highly suggest using domains, and that when an error occurs, if you can, that you gracefully exit. If not, then all other requests will just abort and that isn't very user friendly. You will also want…

Domains are 0.10 specific I believe, and 0.10 is still bugged in few areas. I'd stay on 0.8.23 for quite some time since we are talking about stability.
Post reply on HN