What made you choose NodeJS?
Around the time we were looking into NodeJS, PayPal did a pilot program where two teams were tasked with implementing the same functionality, one using Java and the other using NodeJS. Even though the team working in NodeJS started 2 months behind the Java team with fewer devs using unfamiliar technology within about 2 months they had caught up. Not only that but they had done so with less written code and fewer files. Finally the NodeJS application could handle twice as many requests per second with a third less latency.
Sadly we were not able to do such an apples to apples comparison but what we can tell you is that we were able to display very high performance and great efficiency.
What are you using NodeJS for?
We are using NodeJS for a critical system which acts as a hub between our retail terminals and our internal systems. As I’m sure you can imagine this hub needs to be be incredibly fast as well as infinitely scalable since our retail customers have very stringent performance criteria. Luckily by sticking rigidly to the principles of shared nothing and using Redis for persistence and what little shared state we did have, we were able to deliver great performance while using system resources in a very efficient manner.
You mentioned Redis, for those unfamiliar with Redis could you tell us a bit about it and why you decided to use it?
Redis is described as an in-memory data structure store. That means that rather than being a simple key-value store, Redis offers data structures such as strings, hashes and lists. It even supports more exotic data structures such as hyperloglogs and geospatial indexes.
It wasn’t the hyperloglogs that attracted us to Redis however, it was the ease of administration, ease of use and pure performance that made it a perfect fit for us.
Redis is fast, so very, very fast. It’s single threaded, non-blocking and operations are fully atomic. It also has robust clustering support as well as very good monitoring and failover. It was therefore a perfect fit for a system such as ours where throughput, low latency and as near 100% uptime as possible are paramount.
If you had a chance to do it all over again what would you change?
As far as choices of tech stack are concerned, probably nothing to tell you the truth. Of course there are certain choices as far as libraries and such that didn’t always work out great but the choice of NodeJS and Redis were definitely not ones we regretted.