Is Workerman appropriate for database queries? #1045
-
Hello there, At ChesslaBlab, we have on the one hand an asynchronous PHP Chess Server for chess commands that are intended to run very quickly in real-time. On the other, we have a PHP Chess API intended to run database queries that may take a few seconds to execute. Up until now we've made a distinction between real-time and non-real time operations. Real-time operations are implemented in an async chess server while non-real time operations are implemented in a chess api. The reasoning behind is, this way users who need to run operations in real-time won't be affected by those who need to run operations that may take some time to execute. However, now we're considering to remove the API and implement all operations in the form of chess commands. So, here's the question. How would users playing chess online be affected by those who are querying the database? Thanks for the help, and keep up with the great work you're doing! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Absolutely it is faster and with less latency to use database queries !! A simple query benchmark req/s : Example using Symfony app (with Adapterman) single query with full ORM: And if you only need to save to the database, you can make it after send the response. |
Beta Was this translation helpful? Give feedback.
Absolutely it is faster and with less latency to use database queries !!
A simple query benchmark req/s :
Workerman with postgresql
PHP raw with postgresql
Example using Symfony app (with Adapterman) single query with full ORM:
And if you only need to save to the database, you can make it after send the response.