Live data from Hacker News

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

news.ycombinator.com

51–60 of 60 posts

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

#51
post #50

Earlier quoted context omitted.

Premature optimization doesn't mean anything of the kind. The difference is it doesn't take much more to write something with Node than it does Python or anything else, and thinking about good architecture (particularly database architecture) is prudent. I said it before, but it's worth repeating: today's code become's tomorrow's legacy code, and certain early architectural decisions can make a hell of a difference l…

> Your argument is like saying you're going to build a house but don't know if anyone will want to live in it The first houses in a complex are usually sold before being built, on the basis of a prototype - be it blueprints, 3D walkthrough, or a show-home. If they can't sell those houses, they don't build the rest. It's the cheapest way of establishing whether there's a market for the properties they intend to sell,…

Houses are sometimes built like that, but I've seen indie builders just build the house, rent it out, and then sell it. There are multiple ways to build and sell a house.

Writing code that's maintainable, secure, and performs well isn't all that difficult, and it's certainly not some horrible burden that will eat up all your time at the expensive of customer acquisition. There's no excuse for sloppy work, and yes, customers can jump ship if they think your product is substandard and response time adds to that feel.

You're also not going to be less busy in the future and having a codebase that's difficult to maintain is going to put excessive pressure on you or your team. Sloppy code is harder and more expensive to debug than well written code in all respects. You're also more likely to have major problems (performance, security, grim bugs) that could have been avoided simply by thinking a little up front. It's not all that much more expensive to write decent code. It's also not appreciably more time consuming to write a decent NodeJS app than it is to write a Rails or Django app.

I strongly suspect you're conflating over-engineering with making wise decisions that don't require a huge time burden and make life easier in the long run.

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

#52
post #45
post #35

Node.js itself is fine. The real problem with node.js is the libraries. Just don't use them. A huge portion of existing libraries is full of hidden bugs, shortcomings, race conditions, edge cases, security issues, unscalable, or unmaintainable (and unmaintained). This is exacerbated by the fact that npm makes it really easy to publish a library. Many small buggy libraries. Core modules are too low level (e.g. http),…

It isn't hard to find out which libraries are maintained and which ones aren't. Maintained libraries are of fairly good quality. This isn't very different from other languages, except that there is significantly more activity around node. Promises not being in core is a good thing. Eventually many of those use cases will switch to using ES6 generators. If you want to scale node, you would use multiple processes. Your…

> Your DNS example is a corner case

One of the many corner cases that will kill your application or open it to DoS (malicious or not).

I.e. you can DoS any nodejs application if

    * you can trigger it in making 4 DNS queries
    * and it does disk i/o (or uses any other core module using the thread pool)
> There are discussions around it

I've seen tickets opened since more than a year on this, without anything showing a willingness to improve that. Version 0.9 even removed the possibility to increase the number of thread (which they re-added in 0.10).

> such issues impact all frameworks

When you start using node, you don't expect that your bottleneck is a thread pool.

In non async frameworks you know you'll have this kind of problems, you can design around it, and a DNS query in some module can't block I/Os for the whole application.

> If you want to scale node, you would use multiple processes.

By "unscalable" I meant libraries using O(n) or O(n^2) algos, with 'n' the number of users or the size of your data, where it would have been easy to do it in O(log) or O(1).

> Promises not being in core is a good thing

Why ?

> Eventually many of those use cases will switch to using ES6 generators

It hope it will improve, but we are discussing the current state of nodejs

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

#53
We're a full node stack at http://geeklist.com One thing not being mentioned that I'd like to share is the extremely supportive and extraordinarily brilliant community of node.js enthusiasts. This has an intrinsic value that we could never replicate with any other code base. Around the world thousands upon thousands are excited to learn and hack in node. Guys like @mikeal @izs @indutny @dscape @dshaw @substack and so many other great developers in the node community jump in to help everyone else all the time. (Just try reaching out to any of them on twitter and you'll be amazed by the support. Yes we did finally just move up to 0.8.2.3 but running 0.10 caused some hiccups we just dont have the bandwidth to attend to right now so we're waiting just a tad longer. In sum node is great and you'll find developers absolutely love hacking in it which means they are enjoying working on your project/business... Which is priceless.

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

#54

We've built the control plane to Rackspace Cloud Monitoring in Node.js, and overall the experience has been positive. A few things to look out for: 1. Error handling. In node you can't just wrap your code in a try/catch. And even if you register a listener for uncaught exceptions, you almost certainly have state shared between requests (for example, a database connection pool), which makes trying to handle such excep…

It's been great at http://geekli.st and we run a full node stack. It is true error handling is an issue sometimes, but that's over shadowed by the quality of engineers looking to hack in node. Most common reason I hear for someone leaving a company... "I wanted the opportunity to hack in node at work" - not once, twice but dozens of times. In an age where finding top notch teams to build your stack is really hard, what code base you use is really important to attracting top talent.

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

#55

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?

Our beta is actually coming this weekend, our alpha is live currently though. http://alpha.soundkeep.com. It works great for us because we can keep server memory low since we can process and transcode audio as it passes through our server without having to buffer the entire file at once.

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

#56
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.

Ha, I love how /about is also represented as JSON. Also, good call adding the 'Pro' field. Are you getting any traction there?

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

#58
post #36
post #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 ve…

> cromulent I had to look that word up on urbandictionary, wiktionary, and tvtropes (apparently a Simpsons reference). From what I gather, if that's the word you meant, then it doesn't seem that you believe Node.js is a viable platform. By default, of course, I'll assume the expression was just beyond me!

I think by 'cromulent' he means acceptable

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

#59
post #36
post #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 ve…

> cromulent I had to look that word up on urbandictionary, wiktionary, and tvtropes (apparently a Simpsons reference). From what I gather, if that's the word you meant, then it doesn't seem that you believe Node.js is a viable platform. By default, of course, I'll assume the expression was just beyond me!

(o/t)

sorry, I didn't intend it to be obscure. :)

it started from a Simpsons reference long ago (17 years, wow) but over time has fallen into (infrequent) usage to mean[1] acceptable. :)

[1]: http://dictionary.reference.com/browse/cromulent

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

#60

Why'd anyone want to build something like Twitter again?

He said "the next Twitter", to say the next big thing with possibly tons of req's per sec. It could not necessarily behave like Twitter or share any features with it.

Why does everybody here seems to stick to words in such a "nerdy" way? :) Use common sense sometime guys.

Post reply on HN