Jump to content



Photo

Node.js and MongoDb


  • Please log in to reply
4 replies to this topic

#1 BritishDeveloper

BritishDeveloper

    Member

  • Members
  • PipPip
  • 14 posts

Posted 06 August 2014 - 07:37 PM

Hey All

 

I have just started developing in Node.js. I hear its a new alternative to php and maybe one day will take over from it. I have had very little experience with php so cant really comment on this. Node.js uses something called node package manager (npm) where you find, use and even add packages that are useful tools for you program. For example if you use SVN as you repo there is a package for managing that or there is a package to help you easily add email dispatching to you program. The main package most people use is called expressjs and that gives you a api that makes it easy to create get and post routes for managing you web pages.

 

Along with node.js you have the option of using mongodb as your database. I have to say this has to be the best DB I have ever used. Its very easy to add tables and drop them with out the hassle of doing things in a certain order, and there is no tables setting up. You just push to a collection name and it does the rest for you.

 

Has anyone else used these technology's. How would you review them and do you think there is a future in them?

 

Look forward to hearing you responses

 

Aaron Morley


  • Conner, Pityon, BritishDeveloper and 1 other like this

#2 Conner

Conner

    Haphost Support Staff

  • Moderators
  • 140 posts
  • LocationSouthport, UK

Posted 06 August 2014 - 11:43 PM

Hi Aaron,

 

After having both experience with PHP and Node,js preferable I like Node for its simple integration with MongoDB and its ability to have packages, which is something that i have not (or rarely) seen in such a robust language.

 

However Node can be slow and take time when you are working with Big data, thats why for data use I love HackLang, its produced and endorsed by Facebook (so you know its good), back to the point , I would love to see more of Node.js crop up in future projects, but it may take time to develop into the way that PHP has become, many developers are sceptical of new languages due to potential security or lack of features when used in production application, but I do honestly think that Node.js has a great future!

 

Also, unfortunately I don't think that it will outgrow PHP due to its popularity, over 240 million websites (domains) use it! , but there is still time as PHP is an old language (1995) so one day we may see all content is server by a node.js http interpreter !

 

Oh and Thanks for the first topic post in the Geeky Corner :) have a like.

 

Edit: Have you looked at MariaDB ? little less interpretable for Node but worth a shot! if you like how mySQL handles things. (https://mariadb.org/)

 

Kind Regards,

ConnerT


  • Pityon and Bonar like this

logo.png

PRCTBpj.pngjkrTvsD.pngCxmhW0x.pngmu8GezS.png

jwY2Lj6.png aywcg7Z.png sIQJdfx.png 1y1jJaf.png CD6em6I.png


#3 BritishDeveloper

BritishDeveloper

    Member

  • Members
  • PipPip
  • 14 posts

Posted 07 August 2014 - 08:23 AM

Thanks for response Conner

 

I haven't heard of of mariaDB before. But will defiantly check it out. I think you are right about php. Its has so many followers it would take something drastic for someone to take over form them. For myself I am in my last semester of my computer science education so have decided that I am going to specialise in Javascript and Node.js but I think its going to be wise to pick up php too.  Currently I am in a 3 month intern ship and I have been tasked with rewriting a company system from php to node. Apart from the obvious differences overall they have a lot of similarity.

 

One key difference is the is the way the script is read. In php it takes on one task at a time. In node if a callback has a big load time it will still execute code following that callback. This is great as it stops blocking but can sometimes become a pain as information might not be there when you need it. But node has thought of this and you can add sync commands to make sure it does finish a callback before it moves on. 

 

Hope more people contribute here soon :)

 

Aaron Morley


  • Pityon likes this

#4 ecelis

ecelis

    Newbie

  • Members
  • Pip
  • 7 posts

Posted 13 August 2014 - 01:58 PM

Hey All

 

I have just started developing in Node.js. I hear its a new alternative to php and maybe one day will take over from it.

 

Along with node.js you have the option of using mongodb as your database. I have to say this has to be the best DB I have ever used. Its very easy to add tables and drop them with out the hassle of doing things in a certain order, and there is no tables setting up. You just push to a collection name and it does the rest for you.

 

Has anyone else used these technology's. How would you review them and do you think there is a future in them?

 

I don t see node as alternative to php nor for any other programming language, they just have different purpose, even if you can do similar thing with both languages. Php was designed for dynamic web sites, node for nonblocking and scalable applications, be it servers of some kind or dynamic web sites by using express or any other node package for web development.

 

You can use assorted database engines with node, besides mongo I've used node with postgres and mysql also. Mongo is nice, I agree, but not the "best" for everything, there are times when a relational DB (mysql/postgres et all) fits better and times when a document oriented DB as mongo is better, you might be in situations when a mix of both kinds of DB engines will do a better job than one or other only.

 

Definitively, there is a future for both node and mongo



#5 BritishDeveloper

BritishDeveloper

    Member

  • Members
  • PipPip
  • 14 posts

Posted 13 August 2014 - 02:17 PM

I don t see node as alternative to php nor for any other programming language, they just have different purpose

 

I defiantly agree with this statement. The more I use it I can see how different they are. But I agree there is a big future for node.js. Also I can understand that the use of different DB's will be a factor. So far I haven't needed a relational DB so mongo has been fine but I am sure in time I will need to.

 

I have been having a fun problem the last 3 days where I wanted to run sh scripts from node. node has a lovely tool called child_process that does this but after nearly two days i discovered windows wont allow me to use it it with sh files.  So today I started to develop in linux and  it works. :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users