This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
I'm benchmarking my application, we use MySQL as a data store for a distributed computing environment. All our records are numerical values, mostly integers. We have tuned the application to the point where we are currently bound by network speed.
I noticed that our MySQL results are being transmitted across the network as ASCII characters, ie the number 2147483647 (4 bytes) is transmitted across the network from the MySQL server as the string "2147483647" (10 bytes). There seems to be a binary to ASCII conversion going on at the server, and an ASCII to binary conversion happening in the client library.
I'd like to be able to transmit the numbers as binary values to 1) minimise network traffic and 2) remove the need to do the (unnecessary?) binary to ASCII and ASCII to binary conversions.
I came across this thread on Stack Overflow where numerous people suggested enabling compression in the connection.
http://stackoverflow.com/questions/16430514/can-i-force-mysql-to-transmit-numerical-values-as-binary
Presumably with compression enabled the process would be: read the binary numerical values from disk -> convert to ASCII on the server -> compress the ASCII on the server -> transmit the data as compressed ASCII -> decompress the ASCII results in the client app. -> convert from ASCII to binary in the client app.
My preferred solution would be to just transmit the query results as binary numerical values with no conversions in order to minimise CPU usage at both ends. is this possible?
so, to sum up.
As the data passes: MySQL server -> network -> client application
I currently have: binary numerical values on disk -> ASCII characters on the network -> binary numerical characters in my application
Others have suggested: binary numerical values on disk -> compressed ASCII characters on the network -> binary numerical values in my application
I want: Binary numerical values on disk -> binary numerical values across network -> binary numerical values in my application
Post Details
- Posted
- 9 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/mysql/comme...