Live data from Hacker News

Writing a MySQL storage engine from scratch (2016)

codeproject.com

1–10 of 26 posts

Re: Writing a MySQL storage engine from scratch (2016)

#2
Great article, makes it very clear what parts of the database are- and are not- provided by the storage engine. I wrote a C wrapper for BoltDB recently, i wonder how MySQL would perform linked to that?

I have some memories of looking at VB6 code on codeproject.com over a decade ago, interesting to see that the site is still around and useful.

Re: Writing a MySQL storage engine from scratch (2016)

#4
Somewhat related, I recently started trying to reverse-engineer the MySQL wire protocol. My idea is that if this is better documented then it will be easier for people to make databases that interoperate with MySQL clients but aren't MySQL that much easier (personally I want a custom Shard-Query-ish thing).

This is obstinately documented (http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC...), but I can't find a nice cheat-sheet saying "to send a query, you send this packet and you receive these packets" etc. I've taken to looking at e.g. the pure-Python PyMySQL package source-code https://github.com/PyMySQL/PyMySQL/blob/master/pymysql/conne...

Here's my progress so far: https://gist.github.com/williame/ebf003dd85d5949f551a72331ae...

Anyone know what commands you can send, and what the expected responses are?

Re: Writing a MySQL storage engine from scratch (2016)

#6

Somewhat related, I recently started trying to reverse-engineer the MySQL wire protocol. My idea is that if this is better documented then it will be easier for people to make databases that interoperate with MySQL clients but aren't MySQL that much easier (personally I want a custom Shard-Query-ish thing). This is obstinately documented ( http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC... ), but I can't…

Take a closer look at the MySQL documentation. You dont have to reverse engineer anything - it's all there and documented (source: wrote a client impl based on the docs)

http://imysql.com/mysql-internal-manual/client-server-protoc...

http://imysql.com/mysql-internal-manual/connection-phase.htm...

http://imysql.com/mysql-internal-manual/com-query.html

etc

Re: Writing a MySQL storage engine from scratch (2016)

#7
post #6

Somewhat related, I recently started trying to reverse-engineer the MySQL wire protocol. My idea is that if this is better documented then it will be easier for people to make databases that interoperate with MySQL clients but aren't MySQL that much easier (personally I want a custom Shard-Query-ish thing). This is obstinately documented ( http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC... ), but I can't…

Take a closer look at the MySQL documentation. You dont have to reverse engineer anything - it's all there and documented (source: wrote a client impl based on the docs) http://imysql.com/mysql-internal-manual/client-server-protoc... http://imysql.com/mysql-internal-manual/connection-phase.htm... http://imysql.com/mysql-internal-manual/com-query.html etc

Crikey, thx.

There's a lot of dead links, e.g. http://imysql.com/mysql-internal-manual/com-query.html doesn't describe the response? Got any idea what a query response consists of?

Re: Writing a MySQL storage engine from scratch (2016)

#8

Somewhat related, I recently started trying to reverse-engineer the MySQL wire protocol. My idea is that if this is better documented then it will be easier for people to make databases that interoperate with MySQL clients but aren't MySQL that much easier (personally I want a custom Shard-Query-ish thing). This is obstinately documented ( http://dev.mysql.com/doc/dev/mysql-server/latest/PAGE_PROTOC... ), but I can't…

You might also want to look at the Wireshark module for MySQL: https://github.com/wireshark/wireshark/blob/master/epan/diss...

It does all the work of figuring out what's a request/response and parsing / dumping out various parts of the protocol.

Post reply on HN