gravitino icon indicating copy to clipboard operation
gravitino copied to clipboard

[FEATURE] Support OceanBase JDBC Catalog

Open yuanoOo opened this issue 1 year ago • 6 comments

Describe the feature

Support OceanBase as a type of data source.

Motivation

OceanBase is an enterprise-ready open source distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards. We should consider supporting OceanBase as a data source, including features for managing databases, tables etc.

Describe the solution

No response

Additional context

No response

yuanoOo avatar Aug 05 '24 02:08 yuanoOo

@yuanoOo A good point, the community is open to adding more catalogs and integrating them with Gravitino, would like to work on this?

yuqi1129 avatar Aug 05 '24 02:08 yuqi1129

@yuqi1129 Yes, I would like to work on this!

yuanoOo avatar Aug 05 '24 03:08 yuanoOo

@yuqi1129 Yes, I would like to work on this!

Okay, I will assign this to you.

yuqi1129 avatar Aug 05 '24 03:08 yuqi1129

Thanks @yuanoOo for your issue, my concern is that if OB's license is compatible with the Apache V2 license, we should be cautious when we plan to do this.

jerryshao avatar Aug 07 '24 06:08 jerryshao

If I'm looking in the right place, OB's license doesn't seem to be compatible with the Apache License [1]. However, it would be possible to implement support and distribute it in an ASF release if it is an optional feature and this would only apply if no GPL licensed code was needed in the ASF release.

  1. https://github.com/oceanbase/obconnector-j/blob/master/LICENSE

justinmclean avatar Aug 07 '24 06:08 justinmclean

See https://www.apache.org/legal/resolved.html#prohibited and https://www.apache.org/legal/resolved.html#optional for details.

justinmclean avatar Aug 07 '24 06:08 justinmclean

@jerryshao @justinmclean Thanks for your reminder. OceanBase Community Edition is fully compatible with MySQL protocol, which means we can use MySQL JDBC driver to connect to OceanBase. So we can do it like MySQL without providing driver directly. Additional note: OceanBase Enterprise Edition has an additional oracle mode. In oracle mode, we can only connect through OceanBase's own JDBC driver. see https://en.oceanbase.com/docs/common-oceanbase-database-10000000001375341 We can only support OceanBase Community Edition first.

yuanoOo avatar Aug 21 '24 02:08 yuanoOo

You will need to take care there as well, as some versions of Oracle's MySQL JDBC driver are not licensed under a license compatible with the Apache license. e.g. "MySQL Connector/J 9.0.0 Community is brought to you by the MySQL team at Oracle. This software is released under version 2 of the GNU General Public License (GPLv2)."

justinmclean avatar Aug 21 '24 02:08 justinmclean

I see a PR has been made. Are you sure this is compatible with the ALv2 and ASF distribution and licensing policies?

justinmclean avatar Aug 22 '24 23:08 justinmclean

To clarify, we would need answers to:

  1. What software does a user need to connect Gravitino to OceanBase and how is it licensed?
  2. Is that software truly optional?
  3. Is that software installed automatically without notifying the user?
  4. Is that software part of the binary distribution?

justinmclean avatar Aug 23 '24 01:08 justinmclean

I see a PR has been made. Are you sure this is compatible with the ALv2 and ASF distribution and licensing policies?

@justinmclean I am not too clear about the compatibility rules between licenses. I have seen other MySQL protocol compatible databases in the code, such as Apache Doris. OceanBase is similar to them to some extent.

yuanoOo avatar Aug 23 '24 01:08 yuanoOo

To clarify, we would need answers to:

  1. What software does a user need to connect Gravitino to OceanBase and how is it licensed?
  2. Is that software truly optional?
  3. Is that software installed automatically without notifying the user?
  4. Is that software part of the binary distribution?

@justinmclean Thanks for your reminder.

  1. mysql connector/java Or OceanBase Client for Java
  2. Yes
  3. No
  4. No

yuanoOo avatar Aug 23 '24 01:08 yuanoOo

The MySQL connector and the Oceanbase client for Java are licensed under the GPL/LGPL license. This is not compatible with the ALv2.

justinmclean avatar Aug 23 '24 01:08 justinmclean

The MySQL connector and the Oceanbase client for Jave are licensed under the GPL/LGPL license. This is not compatible with the ALv2.

As far as I know, the mysql connector/java driver binary is not directly provided in the distribution package, like other Apache open source projects. As above, will there still be compatibility issues with ALv2 licenses?

yuanoOo avatar Aug 23 '24 01:08 yuanoOo

Possibly as GPL is not compatible with ALv2 see https://www.apache.org/licenses/GPL-compatibility.html. Note that merely linking to it (i.e. having it as a dependency) is an issue, not just its distribution. I'd need to look at the final artifacts to be sure.

justinmclean avatar Aug 23 '24 02:08 justinmclean

Possibly as GPL is not compatible with ALv2 see https://www.apache.org/licenses/GPL-compatibility.html. Note that merely linking to it (i.e. having it as a dependency) is an issue, not just its distribution. I'd need to look at the final artifacts to be sure.

Justin, MySQL's license is also not compatible with ALv2 I think, but Gravitino supports it. I think OB is the same case.

shaofengshi avatar Aug 23 '24 02:08 shaofengshi

It may or may not be, just because they have the same or similar licenses is not enough to go on. By default, anything with a Category X license (which includes GPL-style licenses) can't be included in a release or be depended upon.

justinmclean avatar Aug 23 '24 02:08 justinmclean

@yuanoOo thanks a lot for your contribution. May I ask what is your email address or wechat id, I think we can have a talk first 😄 .

jerryshao avatar Aug 23 '24 02:08 jerryshao

I've taken a look at the distribution artifact and it looks good to me. Due to the Category X license, this would not normally be OK, but it is in this case it is OK, due to https://www.apache.org/legal/resolved.html#optional and https://www.apache.org/legal/resolved.html#prohibited.

justinmclean avatar Aug 23 '24 03:08 justinmclean

As there are several OceanBase editions (community, enterprise, cloud, etc), to avoid confusing, I recommend this to use a more specific name like "OceanBase community edition" or OceanBase CE to differenciate. What do you think? @yuanoOo

shaofengshi avatar Sep 02 '24 03:09 shaofengshi

As there are several OceanBase editions (community, enterprise, cloud, etc), to avoid confusing, I recommend this to use a more specific name like "OceanBase community edition" or OceanBase CE to differenciate. What do you think? @yuanoOo

Agree, I think this is a good suggestion.

yuanoOo avatar Sep 02 '24 05:09 yuanoOo

@yuanoOo Thanks for your idea and work!

I think creating a complete OB catalog is a long-term project. I have seen your design document, which is a good start. While refining the document, we may also need to further break down the implementation plan, which may require several PRs to complete.

So could you create an epic issue to track all related matters of the upcoming OB catalog? Thank you! Feel free to ping me if you have any questions!

mchades avatar Sep 02 '24 12:09 mchades

@mchades Thank you for your suggestion. I have just created a corresponding EPIC issue: https://github.com/apache/gravitino/issues/4848

yuanoOo avatar Sep 04 '24 02:09 yuanoOo

close this since it is duplicated with #4848

mchades avatar Sep 24 '24 06:09 mchades