Skip to content

Proposal of restructuring code (RFC) #570

Closed

Description

@zhicwu

As the project grows, in order to better manage the code, expectations and dependencies, I hope we can re-organize the repository by creating multiple modules. With that, we no longer have to put all ideas into one single lib, trying to make it both a JDBC driver and Java client for ClickHouse. Instead, we'll follow JDBC specification in clickhouse-jdbc module for standard update/delete operation, synchronous execution, and escape syntax like {d '2020-02-17'}(which is same as toDate('2021-02-17') by the way) etc. On the other hand, we'll stick with the "clickhouse-way" when implementing clickhouse-client module, so that it behaves like any other clickhouse clients.

  • optionally new package name(and maven groupId): ru.yandex.clickhouse -> tech.clickhouse
  • new directories(and maybe a separate repo like clickhouse-java later)
    |
    |-- clickhouse-client
    |-- clickhouse-http-client
    |-- clickhouse-grpc-client
    |-- clickhouse-native-client
    |-- clickhouse-jdbc
    |-- clickhouse-jdbc-ext (tentative)
    |-- clickhouse-gql (tentative)
    |-- clickhouse-r2dbc (tentative)
    |...
    
  • modules and API layers
    image
  • how to approach?
    I hope we can implement the new structure starting from 0.3.0, but it's primarily about moving code from src to clickhouse-jdbc/src and pile up code into other modules. This ensures we can produce binary compatible package in 0.3 series. And then, starting from 0.4.0, I hope we can optionally change package name and refactor clickhouse-jdbc module by leveraging code from clickhouse-client module etc., which will introduce different binary packages.

Please feel free to comment and I'll start to create PR if no concern.

Activity

  1. added this to the 0.3.0 release milestone on Feb 17, 2021
  2. den-crane commented on Feb 17, 2021

    @den-crane
    Contributor

    I am OK with all of this.

  3. alexey-milovidov commented on Feb 17, 2021

    @alexey-milovidov
    Member

    I am totally Ok with all the proposed changes.

  4. enqueue commented on Feb 17, 2021

    @enqueue
    Contributor

    While I do see a benefit in having clearer module structures, I think there is other stuff to do for 0.3.0 before trying to break things up this way, see Roadmap 2021 #537

  5. linked a pull request that will close this issueMulti modules #581on Feb 28, 2021
  6. zhicwu commented on Feb 28, 2021

    @zhicwu
    ContributorAuthor

    Update:

    • renamed clickhouse-native-client to clickhouse-tcp-client for two reasons: 1) naming consistency; and 2) native is a reserved keyword in module-info.java.
    • applied new group id tech.clickhouse in OSSRH-65794
    • applied new group id com.clickhouse in OSSRH-73453
    • will add clickhouse-graphql(instead of clickhouse-gql), clickhouse-r2dbc, and clickhouse-jdbc-ext 3 modules in the future when needed
  7. linked a pull request that will close this issueNew Java client and gRPC support #736on Oct 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions