Jump to content


Photo

What are you working on? - node.js


  • Please log in to reply
15 replies to this topic

#1 teodora

teodora

    Drama Queen

  • Moderators
  • PipPipPipPipPip
  • 3,217 posts
  • Gender:Female
  • Location:The Beach
  • Experience:Advanced
  • Area of Expertise:Designer

Posted 25 April 2015 - 08:19 PM

Why not have a thread where we can post what we're doing with node? It will be interesting to see what others are working on :)



#2 D4Y0

D4Y0

    Privileged

  • Privileged
  • PipPipPipPip
  • 926 posts
  • Gender:Male
  • Location:St Neots, England
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 27 April 2015 - 11:23 AM

We have a few hundred Linux servers connecting to our main server via ssh tunnels. Our reverse proxy is currently written in PHP, gonna be re-writing it in node.js.


#3 NOCK

NOCK

    Chief Troll Hunter

  • Privileged
  • PipPipPipPipPip
  • 1,492 posts
  • Gender:Male
  • Location:Eastbourne, East Sussex
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 27 April 2015 - 12:15 PM

We have a few hundred Linux servers connecting to our main server via ssh tunnels. Our reverse proxy is currently written in PHP, gonna be re-writing it in node.js.

 

Why? Are there performance advantages to doing this or something? Not a dig, just interested :)



#4 D4Y0

D4Y0

    Privileged

  • Privileged
  • PipPipPipPip
  • 926 posts
  • Gender:Male
  • Location:St Neots, England
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 27 April 2015 - 01:49 PM

Well our PHP proxy is very slow due to limitations on how our old product was coded, so we had to do two curl requests per page load rather then just the one.

We could re-code it in PHP and there would not be much difference speed wise, but as we will be moving most of our web development over to node in the future so we can start using sockets we thought it be bets to start using it sooner rather then later.

I could make it in PHP and run a few benchmark tests and compare the results but as it is just bacicly a curl request i cant see there being much diffrence


#5 NOCK

NOCK

    Chief Troll Hunter

  • Privileged
  • PipPipPipPipPip
  • 1,492 posts
  • Gender:Male
  • Location:Eastbourne, East Sussex
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 27 April 2015 - 02:34 PM

Well our PHP proxy is very slow due to limitations on how our old product was coded, so we had to do two curl requests per page load rather then just the one.

We could re-code it in PHP and there would not be much difference speed wise, but as we will be moving most of our web development over to node in the future so we can start using sockets we thought it be bets to start using it sooner rather then later.

I could make it in PHP and run a few benchmark tests and compare the results but as it is just bacicly a curl request i cant see there being much diffrence

 

I feel an experiment coming on? ;)



#6 teodora

teodora

    Drama Queen

  • Moderators
  • PipPipPipPipPip
  • 3,217 posts
  • Gender:Female
  • Location:The Beach
  • Experience:Advanced
  • Area of Expertise:Designer

Posted 28 April 2015 - 04:07 PM

The main reason I started learning node.js was speed. There's a php app I made, which I re-coded in js and node, using socket.io and the speed is amazing! The node app outperforms php big time - approx. 5-6 time faster.



#7 D4Y0

D4Y0

    Privileged

  • Privileged
  • PipPipPipPip
  • 926 posts
  • Gender:Male
  • Location:St Neots, England
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 28 April 2015 - 07:05 PM

Oh yea ATM our software polls php scripts up to 3 times a second (this is the worst case) we have plans to move any ajax polling over to sockets as its just alot more quicker, plus when you want to turn a light on or turn your boilers on there is not a slight 1 second lag.

 

One thing about speed when we bench marked selecting data from both MsSQL/MySQL databases (1k, 25k, 100k, 500k, 1m records at a time) node.js was alot slower almost 2 times slower then php. But this was using an ARM chipset not intel (im told by a colleague that it makes a diffrence).



#8 rbrtsmith

rbrtsmith

    Web Guru

  • Privileged
  • PipPipPipPipPip
  • 3,638 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 03 May 2015 - 08:23 AM

The main reason I started learning node.js was speed. There's a php app I made, which I re-coded in js and node, using socket.io and the speed is amazing! The node app outperforms php big time - approx. 5-6 time faster.

 

What's your app? I've been doing some work playing around with Node, Socket.io, and the REDIS db, also been toying with the idea of using localStorage API for data as kind of a cookie replacement, to further improve speed of persistant data.

I ask because my main issue now is thinking of a fun idea for an app that is different to the typical chat servers & to do list systems...


Edited by rbrtsmith, 03 May 2015 - 08:24 AM.


#9 teodora

teodora

    Drama Queen

  • Moderators
  • PipPipPipPipPip
  • 3,217 posts
  • Gender:Female
  • Location:The Beach
  • Experience:Advanced
  • Area of Expertise:Designer

Posted 03 May 2015 - 08:28 AM

 

What's your app? I've been doing some work playing around with Node, Socket.io, and the REDIS db, also been toying with the idea of using localStorage API for data as kind of a cookie replacement, to further improve speed of persistant data.

I ask because my main issue now is thinking of a fun idea for an app that is different to the typical chat servers & to do list systems...

 

I'll PM you :)



#10 rbrtsmith

rbrtsmith

    Web Guru

  • Privileged
  • PipPipPipPipPip
  • 3,638 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 03 May 2015 - 08:34 AM

I should also add that I've noticed with a lot of things related to Node - many are not supported on windows.  This backs up my statement that windows is not the best option for developers on this thread: http://www.webdesign...ows#entry491911

 

Here's the DB I was just about to install on my windows machine.  Look like it's gonna take some extra leg-work.  http://redis.io/download



#11 teodora

teodora

    Drama Queen

  • Moderators
  • PipPipPipPipPip
  • 3,217 posts
  • Gender:Female
  • Location:The Beach
  • Experience:Advanced
  • Area of Expertise:Designer

Posted 03 May 2015 - 08:43 AM

I haven't got to working with DB & node yet, but I gather Mongo DB is quite popular? I also came accross Redis a lot.



#12 rbrtsmith

rbrtsmith

    Web Guru

  • Privileged
  • PipPipPipPipPip
  • 3,638 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 03 May 2015 - 04:03 PM

I haven't got to working with DB & node yet, but I gather Mongo DB is quite popular? I also came accross Redis a lot.

 

From what I've read mogoDB is easier on beginners and those who need to build an app fast, Redis is more about high performance, but requires more time and planning to set up.  I've read Redis can be 2-3+ times faster than mongo DB.  But don't forget we have LocalStorage and SQL built into modern browsers so it's worth looking into storing some data there for lightning fast performance.  I don't know enough about it all to know what should be stored where and in which circumstances, that I plan to learn :)



#13 teodora

teodora

    Drama Queen

  • Moderators
  • PipPipPipPipPip
  • 3,217 posts
  • Gender:Female
  • Location:The Beach
  • Experience:Advanced
  • Area of Expertise:Designer

Posted 03 May 2015 - 06:28 PM

LocalStorage and SQL sound interesting, I should read about those :) There was a nice tutorial on how to setup app with MongoDB which looked easy enough, I haven't had a look in detail at anything Redis related yet.

 

Look what I found on node and MySQL - http://codeforgeek.c...mysql-tutorial/ looks useful if your setup requires MySQL.

 

Stupid question #1 -  does this mean you can setup node and php to use the same database?



#14 rbrtsmith

rbrtsmith

    Web Guru

  • Privileged
  • PipPipPipPipPip
  • 3,638 posts
  • Gender:Male
  • Location:Manchester, UK
  • Experience:Nothing
  • Area of Expertise:Web Developer

Posted 04 May 2015 - 05:59 AM

I'm not sure.  But I prefer the look of NoSql right now, primarilly because it's very similar to JSON which is a great data format.  I haven't read enough into things to see the full pro's and cons.  I'm not sure how the two compare for speed but NoSql databases seem to be getting plenty of attention from the Node community.

 

LocalStorage is really easy, there's just get and set commands for key:value pairs, very similar to JavaScript objects.  You can see them if you open your Chrome Dev tools and open the resources tab, you will see these in the list on the left:

Web SQL

IndexedDB ??

LocalStorage

SessionStorage

etc..

 

Local and Session storage are the same apart from the data is lost from session storage when a user leaves the application.  LocalStorage is saved until a user removes their browser history (and possibly a hard refresh, not 100% sure on that).

Bearing these things in mind I wouldn't store anything substatial here, but we can see that certain things can be sped up by these rather than using the database.. OR:

Check if the key is found in local storage -> return the value.  else -> look it up in the database.


Edited by rbrtsmith, 04 May 2015 - 06:05 AM.


#15 NOCK

NOCK

    Chief Troll Hunter

  • Privileged
  • PipPipPipPipPip
  • 1,492 posts
  • Gender:Male
  • Location:Eastbourne, East Sussex
  • Experience:Intermediate
  • Area of Expertise:Web Developer

Posted 04 May 2015 - 08:02 AM

I'm not sure whether this adds anything or not, but I recently created an iOS App that I built with HTML, CSS, JS and phonegap. I used PouchDB to keep a couchdb database on a server in sync with the device's built in nosql database. Was a bit of a learning curve for a phonegap, couchdb and pouchdb newbie but it turned out okay :)


Edited by NOCK, 04 May 2015 - 08:02 AM.


#16 D4Y0

D4Y0

    Privileged

  • Privileged
  • PipPipPipPip
  • 926 posts
  • Gender:Male
  • Location:St Neots, England
  • Experience:Advanced
  • Area of Expertise:Web Developer

Posted 05 May 2015 - 06:34 PM

Started work on replacing my LAMPP server with a node server got all of the domains working, now i just have to port a few projects over (luckily noting major 95% of it is HTML/CSS).

 

I have a few mates that have small businesses, so i may help them out with a website just so i can speed up the learning process :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users