Coming soon - Get a detailed view of why an account is flagged as spam!
view details

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.

2
Is there a way to transmit numerical results between the MySQL server and a network client as binary values?
Post Body

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

Author
Account Strength
100%
Account Age
18 years
Verified Email
Yes
Verified Flair
No
Total Karma
17,089
Link Karma
4,351
Comment Karma
12,440
Profile updated: 4 days ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
9 years ago