Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for couchbase3 client #623

Open
laglangyue opened this issue Apr 21, 2024 · 6 comments
Open

Add support for couchbase3 client #623

laglangyue opened this issue Apr 21, 2024 · 6 comments
Milestone

Comments

@laglangyue
Copy link
Contributor

laglangyue commented Apr 21, 2024

I spent about 6 weekends (30 hours) trying to transitie Couchbase2 to Couchbase3 smoothly. In the end, I basically completed the code migration, but it became very ugly and difficult to use and test, so I closed that PR.
#400
#503
#504

I spent about 3 days rewriting the connector. Mainly referring to the mongo connector.
The new connector is similar to the Mongo connector, with only API packaging for the SDK. The couchbase-SDK is already very powerful.
Couchbase-sdk also provides APIs for mono and flux (based on the built-in Completufurture). I also design the API of pekko-connector-3 with the async api(Completufuture)

I just did two tests, and I will complete the rest and docs next week or Labor Day.

Source api

  • get
  • getAllReplicas
  • scan: batchGet
  • query : old is n1q1
  • analytics

Flow api

  • get
  • scan
  • getAllReplicas
  • insert
  • replace
  • upsert
  • remove
  • exists
  • mutateIn : batch mutation in sdk
  • touch: Updates the expiry of the document
  • append: for binary Document, Array[Byte]
  • prepend: for binary Document, Array[Byte]
  • increment: old is counter
  • decrement

Sink api

  • insert
  • upsert
  • replace
  • remove
@laglangyue
Copy link
Contributor Author

Community members can take a look at the PR first. Although it is a draft, the API part has been completed. Next, the main tasks are to complete the annotations, documentation, testing, and testing framework.

Most APIs are based on collection. In Couchbase3, cluster (Connection) ->bucket ->scope ->collection

So I made the collection an implicit

The old couchbase has a SessionKey (setting, bucket) connection pool, which we no longer need. I haven't implemented it yet. The connection is not based on buckets, but on clusters.

I will temporarily put aside the implementation of pekko-couchbase-discovery.

@laglangyue
Copy link
Contributor Author

@pjfanning @mdedetrich @He-Pin
Although the PR has not been completed yet, I hope to receive some of your suggestions. I will improve the implementation based on your suggestions.

@He-Pin
Copy link
Member

He-Pin commented Apr 21, 2024

Thanks for putting a lot into this, I will check this after work.

@laglangyue
Copy link
Contributor Author

I have basically completed the work on adding couchbase3, but not doc.
We can keep the code for couchbase2, but drop the documentation for couchbase2. Write documents based on CouchBase3, adn we declare that we no longer support Couchbase2 in docs, but will continue to release several versions. I separated their modules and it will be easy to remove couchbase2 in the future.

@pjfanning
Copy link
Contributor

I've merged the implementation PR but left this open because we'll need at least some doc changes to reflect the new cloudbase3 connector.

@pjfanning pjfanning added this to the 1.1.0 milestone May 6, 2024
@pjfanning pjfanning changed the title Drop couchbase2 and support couchbase3 Add support for couchbase3 client May 6, 2024
@laglangyue
Copy link
Contributor Author

laglangyue commented May 7, 2024

I've merged the implementation PR but left this open because we'll need at least some doc changes to reflect the new cloudbase3 connector.

Yeah, I just finished my vacation, but I'm about to go on a business trip and will be doing this PR on this Sunday

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants