I'm wondering if using Node.js (express.js) is the best option to go for a complete website. I've been using Rails + Node.js and am wondering if this is still the best option or if I should move completely to Node.js.
Are there websites built completely with node.js? I imagine it must lack many things Rails offers.
If you are looking for real-time web apps, then Node. js might be the best choice for Back-end development as it has all the above features which is very great in delivering excellent performance. It is built on a single-threaded, non-blocking event loop, Google V8 engine and low-level API.
Node. js made JavaScript a full-stack technology of choice for web application development. Due to its non-blocking architecture, Node. js works well for encoding and broadcasting video and audio, uploading multiple files, and data streaming.
js is a popular choice for writing back-end code. In this tutorial, you will learn how to build web servers using the http module that's included in Node. js. You will build web servers that can return JSON data, CSV files, and HTML web pages.
Node. js doesn't support multi-threaded programming yet. It is able to serve way more complicated applications than Ruby, but it's not suitable for performing long-running calculations. Heavy computations block the incoming requests, which can lead to decrease of performance .
I imagine it must lack many things Rails offers.
I gave a short list below but I would like to know what you could be missing and I think(almost certain) we can give you some alternatives on node.js.
node.js is getting pretty complete and I think you can run your entire site using only node.js using for example the following modules. I assume you know about npm
. If not I really advice you to google for it and learn that. To search npm you can use http://search.npmjs.org:
High performance, high class web development for Node.js
https://github.com/visionmedia/expressSocket.IO aims to make realtime apps possible in every browser and mobile device, blurring the differences between the different transport mechanisms. https://github.com/learnboost/socket.io-node
I believe with these two web-frameworks you can create a lot of sites. For example express is a very powerfull web framework and supports a lot of cool things like:
just to name a few.
Redis is an open source, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
https://github.com/mranney/node_redisMongoDB (from "humongous") is a scalable, high-performance, open source, document-oriented database. Mongoose is a MongoDB object modeling tool designed to work in an asychronous environment.
https://github.com/learnboost/mongoose/
With those two databases I think you should be able to accomplish most of your tasks. The nice thing is that Redis is extremely fast/simple advanced KV-store(dataset in memory/also supports VM) and supports replication while Mongodb is more completely(slower then redis) and also supports sharding.
- Authentication and authorization (password, facebook, & more) for your node.js Connect and Express apps.
https://github.com/bnoguchi/everyauth
Like I said previously you can get a long way with only these modules.
Express.js is more akin to Sinatra. They're simpler frameworks than rails.
Express's list of sites is fairly small http://expressjs.com/applications.html
So I think it's also good to look at Sinatra's list http://www.sinatrarb.com/wild.html
So to answer your questions in reverse order. Yes it lacks all the features of rails. Yes there are sites written completely in Express. And going to 100% Node.js might be the right decision for your site.
It depends on which features you'd miss and what performance you need.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With