Web Development

Does node.js have a future? – JavaScript – SitePoint Forums


I’ve been toying with the idea of adding node to my arsenal of programming skills but unable to decide if the payoff is worth it in the long run.

Right now, PHP+Bootstrap suffices most of my needs when it comes to app development as a freelancer. As for JavaScript, I’ve always treated it as a language meant for client-side scripting and nothing more than that.

Now, as much as Node and npm narratives have become the biggest chatter of the day, I’m still not sure how much of that really translates into jobs or freelance projects or even real world industrial usage for that matter.

As far as I know, about 80% of the web is still powered by PHP and while JS certainly tops the TIOBE index, we don’t know how much of it can be attributed to Node.js and how much to frontend JS technologies like jquery and react?

There is no doubt that for many folks, npm has become a critical part of webdev toolchain today (though the actual utilitarianism of some popular libs like babel and webpack is questionable IMHO). But when I compare Node with the established “run of the mill” languages like PHP, Python or even Ruby, what Node really lacks is proven works and street cred. Where is the node’s equivalent of say sqlalchemy or rails or flask or laravel? Are there standard database drivers to access mysql or mssql or sqlite, for eg? Where are the open source folks in Node.js producing equivalents of WordPress and Magento and Drupal?

And what about the enterprise usage? The big ones are all obviously wedded to either Microsoft’s .NET or Oracle’s Java stacks. But among the smaller startups, how much mindshare do you see Node getting where it already has to compete with these other languages?

I understand that at a theoretical level, the event based async threading model of Node.js is truly innovative and since most typical CRUD apps spend most of their time waiting for an sql query to perform or network resource to be fetched, async should be the hot cake compared to synchronous programming. But that doesn’t work out in practice for some reason. If that really were the case, 80% of web apps would have been powered by Node instead of PHP today, right?

I cannot answer any of your other questions. Just make opinions that are based on zero knowledge. However I have some experience of CRUD. Whatever language chose, the waiting time for the SQL query is normally hundreds of seconds. And there are techniques that can reduce the “waiting time”.

  1. Load data in chunks (infinite scroll etc).
  2. Make database calls with as low latency as possible. (localhost if possible)
  3. Refresh only parts of the page (like SPA)
  4. Make your queries more effective. (Reduce the db calls using WITH and RETURN)
  5. Materialized views to load data that almost never changes.

The list could be longer, but the point is that find out WHERE the bottle necks are. They can be in the SQL part, network, browser etc. Do not always blame the SQL…

And generally speaking regarding choosing language, there is seldom any talk about economy and environment. The smaller footprint, the smaller servers and less expensive. And the faster, using less bandwidth means more environment friendly.



Source

Related Articles

Back to top button