As part of my app flow, I'm generating an array of 32 bytes exactly and I need to store it in MySQL
for later use. I understand I can save it directly to a column of type BLOB, which is intended for saving binary large objects and they are treated as binary strings (byte string) but I'm concerned about overall performance, being that I'm actually saving just 32 bytes. I know that there's also a TINYBLOB type, but still, don't know if using it for a 32-byte string would be too much somehow.
My other alternative is to first encode my array of bytes to a string and then saving that string as VARCHAR. But I feel adding the encoding/decoding part could lead to errors like the encoder failing to encode one-byte string for some reason. Or even developer errors like someone forgetting to decode the string before using it or using the wrong type of encoder.
Observations
I'm using Go 1.12 and MySQL 5.7.23 if that makes any difference.