I want to develop a complex game with possibly thousands of functions and database calls.
I am wondering if it’s really necessary to do my database queries in async. Its a pain to code, and all of my functions will need to use callbacks instead of the clean return method. Is this a normal approach?
Are coding these calls in async really that much faster, considering a MySQL database processes a single query at a time?
Unless something changed drastically in Node.JS recently, you’re pretty much forced to use async database access to scale well since all your user requests will execute on one single thread and synchronously waiting for the database will really drop your performance. If one user does a slow operation, all other users will have to wait until it’s done.
Node.JS is really built for an async event driven flow, you’ll get much better performance working with it than working around it.