mysql icon indicating copy to clipboard operation
mysql copied to clipboard

Add XAPI support

Open rykr opened this issue 7 years ago • 19 comments

Hey guys

Any interest in adding xapi support to your Go driver to support the new protocol and APIs that we have introduced with 5.7? If so please reach out to me as we would love to help.

rykr avatar Sep 06 '16 14:09 rykr

I am. Is it stable now?

methane avatar Sep 06 '16 14:09 methane

@rykr Do you mean https://dev.mysql.com/doc/internals/en/x-protocol.html ?

dgryski avatar Sep 06 '16 14:09 dgryski

@methane @dgryski Yes that is the one. The protocol is documented although new features are still being added but what has been documented and released is certainly stable enough to work against. The API is not publicly documented as a standard but our released connectors show the pattern we are using. Certainly driver developers can use whatever API they choose but we feel it would be better to follow a similar pattern.

rykr avatar Sep 06 '16 15:09 rykr

We will be setting up a page highlighting externally maintained drivers. When that page is ready would be ok to list this provider there?

rykr avatar Sep 06 '16 15:09 rykr

@rykr While I'm interested in X Protocol, I don't know this project should use it. This project doesn't provide APIs to users directly. It works behind "database/sql" standard library. So providing X Dev API is out of scope.

One possibility is use X Protocol only for standard SQL. I'll try it and benchmark it. If it's significant faster than current MySQL protocol, I'll create RFC issue here.

methane avatar Sep 07 '16 05:09 methane

@sjmudd has been working on implementing a Go driver for the X Protocol, and will be speaking about it at Oracle OpenWorld 2016 in SF. He probably has something useful to contribute to this discussion.

dgryski avatar Sep 07 '16 08:09 dgryski

Great. Will that be a different project here on GitHub?

On Sep 7, 2016 3:27 AM, "Damian Gryski" [email protected] wrote:

@sjmudd https://github.com/sjmudd has been working on implementing a Go driver for the X Protocol, and will be speaking about it at Oracle OpenWorld 2016 in SF. He probably has something useful to contribute to this discussion.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/go-sql-driver/mysql/issues/478#issuecomment-245210969, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGpXLp18iXv6n57afOWyGWAVsqIB5sQks5qnnVWgaJpZM4J15XK .

rykr avatar Sep 07 '16 11:09 rykr

It will be yes. It's still at an early stage and I can talk to you directly if you're interested.

sjmudd avatar Sep 08 '16 05:09 sjmudd

There seem to be several different issues here:

  • Support for the new API (document store) which might work through the existing MySQL protocol. I would not expect that database/sql would be able to support that as it only supports a "SQL interface"
  • Support for the X protocol, announced in the MySQL 5.7.12 server, in database/sql. This as I've seen has some issues as use of the X protocol potentially provides more flexibility to the user. However the user will be unlikely to be able to make use of these features as database/sql does not provide any hooks into lower level drivers which might be relevant here.
  • To make use of all the planned features in the X protocol perhaps a full driver is needed and this has all the inconvenience of starting from scratch.
  • See also: https://github.com/golang/go/issues/16673 which is relevant.
  • Also note that for other languages MySQL exposes the protocol for "Document store" access using the XDEV API: https://dev.mysql.com/doc/x-devapi-userguide/en/. This does not use SQL at all and it may be that some Go users might want to have a similar interface as offered in other currently supported languages.

sjmudd avatar Sep 08 '16 08:09 sjmudd

Hi, what kind of help are you looking for ? Our MySQL connectors engineer will be please to answer all your questions and provide you directions to include MySQL X Protocol to the Go SQL Driver. Please join #connectors in MySQL Community Slack (https://lefred.be/mysql-community-on-slack/)

lefred avatar Mar 29 '19 11:03 lefred

@lefred Does Oracle have any plans for contributing an XAPI driver for Go?

dgryski avatar Mar 29 '19 19:03 dgryski

@dgryski we don't have plan to take over any MySQL Go driver, we think you are doing a good job and we don't see any need to deliver one ourselves. However we would like to encourage the support of the X protocol and therefor help you to integrate it. Any questions, tip requests are welcome.

lefred avatar Mar 31 '19 08:03 lefred

https://dev.mysql.com/doc/dev/mysql-server/latest//mysqlx_protocol.html

lefred avatar Mar 31 '19 08:03 lefred

is there an estimation when go-mysqlx becomes available?

laoshaw avatar Jul 05 '19 21:07 laoshaw

@laoshaw Any specific reason why you want this?

dveeden avatar Jul 06 '19 18:07 dveeden

Want to switch a django/python-mysqlx-connector project to go/mysql8 as I need both RDBS and JSON in the same database, it seems not many are taking this approach? I'm checking TiDB, still if there is good mysqlx/go connector driver I would prefer MySQL.

laoshaw avatar Jul 06 '19 18:07 laoshaw

Sounds like you want "Document Store" support, not just "X Protocol". One is built on top of the other. I don't think anyone is working on this for Go.

Note that you can use JSON columns and functions over the classic protocol, just not the "X DevAPI" syntax.

Best to use MySQL 8.0 for this

Transporting SQL over X Protocol would allow one to use pipelining and some other features not present in the classic protocol. So I expect a first version for Go to add support for X Protocol transport for performance reasons without new syntax

dveeden avatar Jul 08 '19 07:07 dveeden

Yes I will use the classic protocol for json-column with mysql for now. After trying TiDB I realize I have to stick with MySQL as my workload is more OLTP where MySQL is good at.

I just found some alpha work for mysqlx: https://github.com/AlekSi/mysqlx

laoshaw avatar Jul 08 '19 14:07 laoshaw

Apologies to bump an old thread, is there any work going on?

aleyrizvi avatar Apr 17 '20 15:04 aleyrizvi