Ghmattimysql : MySQL Implementation for FiveM


Ghmattimysql is A mysql middleware for fivem.

First, there was MySQL-async (which I am maintaining now too), written in C#. Due to the current mono-limitations, several issues arise:

  • Everything was executed on the main server thread pool, meaning that the server might start to hitch on long-running queries that were not async.
  • Async continuation after awaiting was only possible at the next server tick, leading to slow reads.
  • Which became even slower because the buffer used was affected by the underlying mono issue.


To download the latest version, follow the link to the releases 

This lead to me creating GHMattiMySQL in C#, which executed queries in synchronous mode on different threads from the server thread pool, which in turn tackle these issues as properly as possible. And it worked.

But then node.js picked up on FiveM, and the MySQL protocol middleware for the node was suffering none of these issues. So I decided to move both projects: MySQL-async and ghmattimysql to node.js.

If you are looking for the old C# version to see how it tackled the problem then look below (or if you are using vRP):

Why are still two implementations needed? Well since MySQL-async targets more towards a large number of people using it and needs to be fully backward compatible, this cripples the syntax of the mysql.js implementation and many of its functions and is solely thought for the usage in Lua.

ghmattimysql instead still aims to be mostly backward compatible but will include some breaking changes every now and then to aim for easier use, better performance.

Post a Comment