Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

The situation: We are about to roll out what is essentially a logging service. As we are rather PHP heavy, the current implementation use it.

We will have about 200 computers (most on the same network) that will each send, via HTTP POST, around 5000 requests/day. With each request containing about 300 bytes of data.

The receiving end is hosted at Amazon and is a very simple PHP form with some simple validation that puts everything in a database.

Now, I've recently been introduced to Node.js and I'm curious as to if it would be a good fit for the backend here.

Granted I could easily build something to test this. But since I haven't fully grasped the async-methology I would really like someone with experience to explain it to me.

share|improve this question
    
This is my first post on Programmers, so I'm not sure about the type of questions preferred. This might be "downvotable", but I'm taking the risk. –  danneth Aug 31 '12 at 8:39
2  
+1. The question seems fine for me: both constructive and not too localized. –  MainMa Aug 31 '12 at 8:43
10  
Why are you considering another platform, if your current one works? Curiosity is great, but given your setup and needs I don't think you should be experimenting on this just for science's sake. I don't know if PHP does everything you want it to, but if it does I don't see any point in switching platforms. Node.js is great, and familiarizing with it will be extremely valuable, but perhaps you should consider doing it on a smaller project? Something more appropriate for experimentation? –  Yannis Rizos Aug 31 '12 at 8:48
    
@YannisRizos Like you say I think the current set up will handle just fine, even if/when we grow. So in a way it's just for science and reference for future project. Likely I will not change anything, but rather toy with the idea to increase my understanding of Node. Basically - take a real world example and hope for some enlightening answers :) –  danneth Aug 31 '12 at 8:54
1  
@YannisRizos I always find that a quick and simple test is enough to tell me if something is worth pursuing or not, but to really see if its capable, I need a bigger project to work on - and there's nothing better than a rewrite (for test purposes) of an existing setup. The biggest benefit is you can see if it works exactly as before, and you can also use it to directly compare performance. –  gbjbaanb Aug 31 '12 at 12:32

5 Answers 5

up vote 11 down vote accepted

We will have about 200 computers (most on the same network) that will each send, via HTTP POST, around 5000 requests/day. With each request containing about 300 bytes of data.

That's about 10 req/s. So it's clear that you don't need to switch.

Real life benefits of switching (besides getting valuable experience)? Well, as you said, you're hosting on Amazon. With node.js you'll have less load, meaning you could even use a micro instance for that kind of load, saving you some money. Also, being an asynchronous framework, it can reduce latency, for example by sending the response before saving to the database.

share|improve this answer

If you and your team have good experience with PHP and it's simple enough to implement, I would stick with that. If the amount of traffic goes up and concurrency is an issue, then it might be worth getting to grips with node (plus it's always fun to learn a new language!!).

The other benefit of node is; it's fast.

But again in this scenario I can't imagine that some well written PHP would have any difficulties handling the load.

share|improve this answer
    
Load will probably not be an issue in this case, more so in a proposed upcoming project. What this experiment (as thought and potential development) is meant for is to get a grasp on how and when the concurrency will be beneficial –  danneth Aug 31 '12 at 9:00
    
Also, if you really need speed and scalability I would consider looking at vert.x –  K.. Aug 31 '12 at 9:49

I used node.js for my BSc thesis and it was a very nice experience. In addition to that, it was used together with a php application so I could compare both technologies.

If you have enough time on your hands(not too much if you are familiar with javascript), then you might as well try it out. That way, you will know whether to implement it in the upcoming project which may require more concurrency.

share|improve this answer

The best explanation of Node async is the Node Beginners book. Its free (but worth the $10). It'll explain how to write your node servers and is very well written.

share|improve this answer

For more benefits kindly check this http://shootout.alioth.debian.org/u32/which-programming-languages-are-fastest.php#about.

This will give you about the benefits of switching.But switch only if your benefits outweights the cost and efforts of switching.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.