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.
5
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.
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.
2
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.
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.