Friday 27 January 2017

Scaling node.js REST API server code to production level

I'm building a simple android/ios app that interfaces with a REST api running on my server. This is a financial application and processes credit card info etc.. I chose to write this in node because it's easy to handle, but now that it is nearing completion I notice that each call from the app to the server is taking about 4 seconds on an average and even longer for some others. Assuming that I want to support millions of concurrent users, with this kind of performance already, it would definitely be a horrible experience with even 100 users I presume.The stack is basically a node API running on an nginx webserver that a website is pointing to and the API functions are accessed through this website.So my questions are :Is there an alternative language (Java/Scala) that would offer me better performance? I ask this because node.js is single threaded and maybe using sockets and multiple threads with another language might help me scale better (?)Big companies are using node.js (Paypal/Netflix), how are they able to provide such seamless interaction with incredible response times?Any basic/fundamental principles that I might be missing that is causing this severe drop in performance?In general, if you were building a large mobile based financial application that basically communicates in a regular client-server fashion, what would your technology stack be, to ensure the best possible experience?Any help is appreciated, thanks in advance!

Submitted January 27, 2017 at 06:34PM by zingerburg

No comments:

Post a Comment