Friday, 16 November 2018

How's this architecture for scalability?

So, I have 2 Node processes: A and B running as Linux services.Process A is a web server that is to be targeted with ~1000 requests per second (peak). 98% of these requests will be "orders".Process B is the order processing engine for A.Both A and B are connected to the same MySQL db, and use InnoDB's row locking mechanism (+ transactions) to avoid simultaneous access by A and B.A is tethered to B via a socket connection. So when A receives a request, it dumps the payload in the db and emits a notification to B. B then queries the db and compares orders, matches whichever buy and sell entries have the same price, writes back to the db, then notifies A (also via socket) whenever a match/trade occurs, so A can in turn notify whoever's watching orderbook for changes on the web.Currently, this architecture give me 2 threads, right? So do I need to spawn child processes in process B, or is simply separating it from the web server good enough to handle that much requests?

Submitted November 16, 2018 at 07:07PM by r3dh4r7

No comments:

Post a Comment