yorkie
yorkie copied to clipboard
Add API for Retrieving All Documents
Description:
Proposing the addition of a REST API to retrieve the contents of Yorkie Documents, enabling developers using Yorkie to utilize the data.
Why:
During the operation of our service, the need for data analysis, such as inspecting accumulated data in Yorkie Documents, has arisen.
Currently, there is an GetDocumentSummary()
admin gRPC API for getting a snapshot of a document.
Are you suggesting an HTTP REST API in JSON format to get document snapshots?
Exactly. I think I need an HTTP REST API. The service data is needed more for data analysis rather than in real-time, and gRPC has significant technical overhead.
@krapie I remember connect-rpc also exposing the APIs in HTTP as well as gRPC. Am I right?
- https://connectrpc.com/
- https://github.com/yorkie-team/yorkie/issues/668
@hackerwins Yes, connect-rpc also exposes plain HTTP along with gRPC. I think we can also resolve this issue when we switch current server rpc to connect-rpc.
Great. We will soon be using Secret Key
for the Admin API too.
I have confirmed that we can use ConnectRPC to retrieve document with HTTP POST
Very excited to see this working :)
After migrating to Connect RPC, we can use REST API.
I think this issue could be solved by using the Private Key created in the Dashboard during the authentication step.
https://github.com/yorkie-team/yorkie/blob/258cb1e57bb1e6f2a3398ccd4459c96c60617838/server/rpc/auth/auth.go#L46-L61
Then, is it possible to provide API for other features? (Document Editing, ...)
Then, is it possible to provide API for other features? (Document Editing, ...)
It would be better to deal with this as a separate issue.