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 client proxy and proxy server example #11

Merged
merged 7 commits into from
Apr 19, 2019
Merged

add client proxy and proxy server example #11

merged 7 commits into from
Apr 19, 2019

Conversation

disksing
Copy link
Collaborator

No description provided.

Signed-off-by: disksing <[email protected]>
Signed-off-by: disksing <[email protected]>
Signed-off-by: disksing <[email protected]>
@disksing disksing requested review from siddontang and rleungx March 27, 2019 15:45
Signed-off-by: disksing <[email protected]>
@disksing disksing requested a review from rleungx March 28, 2019 03:47
Signed-off-by: disksing <[email protected]>
router := mux.NewRouter()
rawkv := rawkvHandler{p: proxy.NewRaw()}

router.HandleFunc("/rawkv/client/new", rawkv.handlerFunc(rawkv.New))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

em, I prefer using raw and txn directly

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

em, /txn/txn/{id}/get will be strange then, txnkv seems to still be the better option. @siddontang

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, why not providing a gRPC support instead of Restful. For Restful, we have to care how to manage transaction ID, if the client forgets to rollback the transaction, we have to rollback it soon.

But in gRPC, we can manage the transaction in a session, it is more simple.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite familiar with grpc session you mentioned. But I think HTTP is a better idea than gRPC because it is supported by almost all modern languages. In general the developer of the client can introduce it with less effort.

Signed-off-by: disksing <[email protected]>
@siddontang siddontang merged commit c1e45e6 into tikv:master Apr 19, 2019
@disksing disksing deleted the proxy branch April 19, 2019 07:08
daimashusheng pushed a commit to daimashusheng/client-go that referenced this pull request Sep 2, 2021
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

Successfully merging this pull request may close these issues.

3 participants