7 ms·
Node.js is good for solving problems I don’t have
- jat850 15y agoI guess I don't understand - is this meant to be an object lesson or warning to people against using the wrong tool for a given application? The author self-identifies their problem as: "The problem I have is processing a lot of data quickly" Clearly, then, don't use node. But why write a blog post about not using something? A post involving a lesson learned ("I tried using node for processing a lot of data quickly, and it was terrible!") would have been more valuable. I fully offer up the idea that I may have missed the point.
- dsafasdf 15y agothe blog post is just retarded, you are right
- shtylman 15y agoTroll. Post made no sense and came to no conclusion. "The content server should not need to do hardly any IO. Why would an HTML content server need to write to the filesystem?" This just shows a blatant lack of knowledge about what constitues IO. FYI, network is IO, writing to console is IO, logging is IO. The point of an evented system like node (and others based around the 'select' or 'epoll' type calls is that you can use one thread to do other things when you are waiting for the kernel to tell you your socket is ready. Yes, I too get frustrated when 'front-end' people think they are systems engineers or super server coders, but that doesn't mean I am going to write a blog post that goes nowhere about it and completely misses the point of an evented system like this.
- shuzchen 15y agoPost also shows a blatant lack of knowledge about what an event loop is. Node and Tornado (two event-loop based servers) are by design single-threaded. This is because for certain setups, having a separate thread for each connected client (the norm for something like Apache) can destroy your server. IMO the main problem that event loop systems were designed to solve was the "I have a ton of people connected concurrently but the majority of the time these connections are idle". Think if you were building a chat application. Your users are connected to your service constantly (they want to get messages as soon as they arrive), but most of the time they AREN'T receiving or sending data. If you had a thread for every connected client your server would melt due to the ram overhead, even though most threads aren't doing any work 99% of the time. In an event-loop based system, you don't have this issue because everything gets handled by one thread.
- MostAwesomeDude 15y agoYes and no. The problem solved by event loops is the problem solved by select(): You never want to wait for a single person to do something; you want to wait for anybody to do anything.
- nakkiel 15y agoYou certainly mean "the problem solved by select() alternatives such as kqueue(), epoll(), etc..". :)
- edtechre 15y agoNot a troll. The post's point was that for your average web app, NodeJS doesn't solve any problems. If you were building some kind of real time app like the Facebook social stream, then yes, it may make sense. But for your run of the mill web app that still treats HTTP as a fire & forget stateless protocol, then NodeJS isn't going to give you any advantage. In fact, its single threaded design will prove to be far more disadvantageous than going with a setup of nginx and PHP/Ruby/Python.
- geuis 15y agoExactly, node is useful for solving problems that you don't have. So you wouldn't use node for them, then. The answer to your own question is your own statement. Node makes it possible to do completely new things that would be difficult to do otherwise. I take exception to this statement: "Node enthusiasts are front-end coders not wanting to do server coding." The number of engineers who only do server-side programming these days are few and far between. I haven't worked a job in the last 4 years where no one touched the frontend at some point or vice-versa. Sure, we usually have niches where we do the majority of our work, either front or backend. But at no point are they exclusive. Node has been a blessing for me, as a frontend engineer, because I can finally code servers in the same mindset as I write client-side javascript. We (frontend folks) live in an asynchronous world. We eat parallel requests, xhr, and async callbacks all day. It turns out that when you apply those same concepts to the server, it opens up a whole new world of possibilities.
- dextorious 15y ago"""Exactly, node is useful for solving problems that you don't have. So you wouldn't use node for them, then. The answer to your own question is your own statement.""" You'd be surprised how many people take the wrong answer, then. I've seen tons of posts touting Node from people with needs and problems that would be better served by other technologies. """Node makes it possible to do completely new things that would be difficult to do otherwise.""" Really? Like what? Besides running server side js (something that Netscape did back in the mid-nineties), Node offers nothing that one of the tons of evented servers/libs around could not previously handle. . I personally like the Mongrel2 approach --combined with some non-blocking framework you got all the Node goodness, plus traditional server goodness, plus messaging, plus language agnosticity.
- zzzeek 15y ago"Node has been a blessing for me, as a frontend engineer, because I can finally code servers in the same mindset as I write client-side javascript. " That was precisely the author's point. You'd rather stick with what you know then bother to deal with traditional server side techniques.
- 15y ago
- viscanti 15y agoHis biggest problem seems to be the "community". There's certainly some people doing projects in node who would probably benefit from doing it with something else. But to judge the framework by some "community" is silly. The node community seems friendly and helpful and have created a large library to help do things node is good at.
- MostAwesomeDude 15y agoIf Twisted, Event Machine, Rails, libevent, httpd, nginx, and Mongrel are all judged by their communities, then why does Node get a free pass?
- ksetyadi 15y agoIf the community is the problem, I think he should focus on the community itself rather than discussing on what Nodejs is incapable of.
- spyder 15y agoIf you don't need node than don't use it, and yes it's not for serving static pages, but more for interactive real-time web applications. And the part where he says that focusing on serving the HTML is less important because it's just 3% of the content seems flawed, because if serving html is slow then the other contents too will be loaded later (the HTML is what requesting them).
- wicknicks 15y ago"The problem I have is processing a lot of data quickly" It seems that the author needs something like super performant Hadoop++. Node doesn't address these problems. "Node enthusiasts are front-end coders not wanting to do server coding" I think he missed the point there. Using Javascript as a server side language, node has bridged a gap so many web programmers have been crossing. With node and mongodb, JSON is a language native to the entire webstack -- which is a very powerful idea. We are able to sync datastructures across server and client now. This rant sounds very similar to "NoSQL DBs will never reach the competence and performance of the RDBMS".
- mikescar 15y ago> With node and mongodb, JSON is a language native to the entire webstack -- which is a very powerful idea. We are able to sync datastructures across server and client now. Honest question here -- outside of not calling input and output transforms to or from JSON and native array/list/whatever, what is the new ability and the powerful idea? Aren't the two transforms pretty insignificant in practice?
- nakkiel 15y agoAgreed. But even "not calling input and output transforms" is incorrect. JSON, just like XML or the next thing we will come up with, has to be parsed to be any use. This may happen under the hood but this is still happening. I guess what mikescar finds attractive is the illusion that things are "integrated" and talking to each other in a format that doesn't look like one (it seems to be part of the programming language).
- MostAwesomeDude 15y agoYou have solved a problem that didn't exist -- XML and HTML were both reasonable linguafrancas prior to JSON's invention. JavaScript as a server-side langauge is not a good thing; JavaScript is not a good systems language. We've already had an era of a poor systems language (PHP) being predominant in the web application space, and the conclusion was that there are better languages which can more effectively represent both general systems tasks, and specialized web tasks. NoSQL databases will never be relational DBs because they explicitly eschew the relational algebra that powers the latter. Similarly, Node isn't a serious server-side solution explicitly because of its reliance on JavaScript. Finally, I should point out that JSON isn't a subset of JavaScript. This means that you can't exec it as JavaScript in all cases, and even if you could, exec/eval is massively dangerous and should be avoided. This means that you're parsing JSON, which means that you no longer have an advantage over other languages -- Perl, Python, and Ruby all have very strong JSON support. (Python even has it in its standard library now.)
- nakkiel 15y agoI was about to extract a few quotes showing a blatant lack of understanding whatsoever. In the end it got too lengthy. Looks like a Ninja stepped on the wrong land today. All the references to threads are probably the most difficult to understand for me. Node is single threaded and one can't spawn a new one. The author seem to be using it as some sort of magical artefact.. it's beyond comprehension.
- nakkiel 15y agoThe whole website is a PR/FUD base for Mark Logic. Check their Wikipedia page too. http://en.wikipedia.org/wiki/MarkLogic http://en.wikipedia.org/wiki/MarkLogic I guess they're tyring "to fully utilize the potential of the internet".
- dextorious 15y agoActually they mention Mark Logic in the article a couple of times, but what they say totally stands (at least as an argument) on its own. I could care less about Mark Logic. I do care about what the article says, and I agree with it.
- dmpk2k 15y agoHaving skimmed the article I found it relatively unenlightened. What do you agree with?
- deleted 15y ago[deleted]
- jphackworth 15y agoNode was created to provide an event-based web server programming model This is not true, and it's probably why the author seems confused. Node was not primarily designed to be a web server, nor is it particularly good at that. It is much better as a server that keeps sockets open, like for a chat application.
- schleyfox 15y agoSomeone should tell the Nginx guys that blocking IO is not a problem that web servers actually have. I'm sure they will be thrilled to not have to do complicated event programming anymore.
- deleted 15y ago[deleted]
- stateless 15y agoI think the author was dead on despite some confused points - the number of problems that node is the best solution for is a fraction of what its currently being used for. It seems obvious that it's popularity is tied to server side javascript.
- vph 15y agoYour friend might not be nodejs, but it might be .... Javascript. One way to speed up data processing on the server is to avoid processing it as much as possible and delegate such processing to the client side. Hence, Javascript is your friend there.
- InclinedPlane 15y ago"I don't like brussel sprouts." Then don't eat them.