-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Discussion] Future plans for dapr api #2817
Comments
Hey @nobodyiam thanks for bringing this up. Speaking for myself, I think it makes sense to make the (some?) Dapr APIs a standard as it'll enable interoperability between other technologies.
The proto files are not enough, and Dapr also has an HTTP 1.1 API that needs to be taken into consideration here. I agree that if we were to try and formulate a specification out of the Dapr APIs, we'd need more than proto/swagger descriptions. |
@nobodyiam - I agree with you that this is a direction to go and it will be interesting if there is a desire to separate out the APIs. It is certainly a direction to keep in mind as Dapr is further adopted. Would like to hear other people's thoughts here. |
There is an opportunity for Dapr API to mature and become a spec. I believe we will need at least another version of the Dapr API to feel more confident about extracting a spec out of it. |
On the flip side, iterating a spec might lead to some changes in the API. |
Thanks for your feedback! Considering the current adoption rate of http/2, I agree we still need to support the http/1.1 api.
Right, I also believe it may take some time or even introduce some breaking changes before we finalize the spec. However, I'm wondering is there anything we could do now to help us get closer to the final goal? Please feel free to share your thoughts or ideas, I'll try my best to help. |
I believe we need to have a schema for the Dapr API first. Right now it is in proto files and hard coded in the http handlers. |
I believe the proto files already make good candidates as API spec. The problem is to support HTTP/1.1 as well. I think we should give up HTTP/1.1 support so that the API can embrace modern features like streaming, multiplexing. |
I'm assuming when we say HTTP/1.1, we mean the REST API, and when we say HTTP/2, we mean the GRPC API? It may be worth clarifying that GRPC is tied to HTTP/2 while the REST API can operate with either protocol, but IIRC, Dapr doesn't support the REST API over HTTP/2. IMHO, I'm not sure giving up the REST API is a good idea. REST is especially useful when dealing with legacy systems and/or languages that aren't (yet) supported by GRPC.
FWIW, HTTP/1.1 allows streaming (via Edit: it's also worth pointing out that streams aren't very useful for a stateless/shared-nothing language and make the most sense in a language with a shared global state. |
I agree to give up http1.1/REST support and focus on http2/gRPC. The most important reason is that we have sdk for all most all langurage which our end user use to connect to dapr. If some languraage sdk is absent, the best way is to add it, not let the end user access to the dapr port directly. Then with sdk, why we don't use grpc but choose REST? |
We can have the spec to be independent of protocol. And then add sections for the recommended implementation in grpc, http1.1 and http2.
Similar to how CloudEvent has a spec and then describes how to implement the spec in JSON, Avro, etc.
— Artur Souza
…________________________________
From: skyao <notifications@github.com>
Sent: Tuesday, February 23, 2021 6:16:45 PM
To: dapr/dapr <dapr@noreply.github.com>
Cc: Artur Souza <artursouza.ms@outlook.com>; Comment <comment@noreply.github.com>
Subject: Re: [dapr/dapr] [Discussion] Future plans for dapr api (#2817)
I agree to give up http1.1/REST support and focus on http2/gRPC.
The most important reason is that we have sdk for all most all langurage which our end user use to connect to dapr. If some languraage sdk is absent, the best way is to add it, not let the end user access to the dapr port directly.
Then with sdk, why we don't use grpc but choose REST?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#2817 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAA77CUVKRWGVU2FZGA7SJTTAROQ3ANCNFSM4X2K3YVQ>.
|
I don't think we can give up on HTTP1.1/REST because:
As such, dropping HTTP1.1/REST support will undermine the language agnostic/developer inclusive goals of the project. But... As @artursouza alluded to, an implementation/SDK does not have to implement both gRPC/HTTP1.1 APIs to be a valid implementation. I'll even go as far as to say that an implementation of the API does not need to implement the entire API surface. For example: The GCP PubSub/Alicloud Message Queues managed offerings might decide to support Dapr's Pub/Sub API, while NoSQL managed offerings might support the Dapr State APIs. |
+1, but I'm not sure whether the spec can be independent of protocol. |
My point is that for each protocol, there would be a "child spec" (similar to how CloudEvent does). But I agree that the implementation should be complete and not partial. So, one sidecar might implement Dapr over HTTP 1.1 but not HTTP 2, for example. So, I think this is something that implementations should advertise, so applications know which ones would work for them. Additionally, the SDKs can make this transparent by "auto-detecting" which protocol is available. The Java SDK, for example, has implementation for both gRPC and HTTP 1.1 behind the scenes. |
If you're going to wrap the publish and subscribe building block, maybe you should look at AsyncAPI instead of OpenAPI. |
One possible implementation of an HTTP API spec: |
I highlighted this issue in the Dapr community call today: Summary: I demoed an OpenAPI spec for our state store API: https://raw.githubusercontent.com/wcs1only/dapr/openapi-spec/swagger/openapi.yaml Some use cases/questions that came up on the community call:
Q: What about AsyncAPI instead of OpenAPI
Nice to haves:
Assuming AsyncAPI does these things and does them as well/better than OpenAPI, we'll certainly consider it. (In subsequent conversations with @jrjenks-davinci, I think they had something a little different in mind when they asked this question. Namely: building Daperized applications from application specific AsyncAPI specs) |
AsyncAPI is heavily inspired by OpenAPI and as of March 31 also part of the Linux Foundation. According to AsyncAPI, they are compatible with the OpenAPI spec, with a few additions. Although there currently aren't as many frameworks or tools available for AsyncAPI, as there are for OpenAPI, it makes sense in my opinion to invest into AsyncAPI simply because OpenAPI does not support pub/sub patterns and AsyncAPI does. Then again, because of AsyncAPI being compatible with OpenAPI it might make sense, to start with OpenAPI support, with AsyncAPI support in mind for future releases. Currently, our workflow is to extract json-schema from the spec and validate the messages against it. For us, it would be of immense help, if dapr could read the spec and validate the messages in the sidecar. |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged (pinned, good first issue, help wanted or triaged/resolved) or other activity occurs. Thank you for your contributions. |
That's a good question, I'll do it, don't close it |
Hi team, I want to know... What is the current progress of the standard API definition? We explored similar ideas in #mosn/layotto#188 :
|
Hi guys ,I read an interesting interview with @yaron2 about making Dapr API a new standard :)
|
Hey @seeflood, this is still early days but at least what I'm envisioning is starting with the current Dapr API as the basis of the spec, which will be either extracted into a separate repository in the Since most of Dapr's APIs are 1.0, I imagine existing APIs will not change in the process, and any changes will be the basis of future versions of the existing APIs. |
@yaron2 Thanks for your reply! I am very interested in this Dapr SIG and willing to join it. Setting standards for the future is very cool. Another detailed question : I really want to know your opinions on it, because I'm considering letting the layotto project (a sidecar used in alipay) support dapr api(including the same package name and service name defined in |
Hi, as a community developer, I think the standards is cool. I mainly consider two characteristics:
If the community plans to define such an api, I am very interested in participating in it. At the same time, I will migrate the api of cloud-runtimes-jvm to the standard api. |
I agree that the API and Dapr should not be strongly bound in that the APIs can develop independently from the Go implementation of Dapr. Supporting custom APIs is also something I think would benefit the community a lot, and this needs some thought inside |
@seeflood and @kevinten10 I will bring this up to the Dapr steering committee on the next meeting and request to open a SIG for this. I'm including you both unless you tell me otherwise. |
@yaron2 Thanks! I'm in . |
@yaron2 Thanks! All right! |
@seeflood @kevinten10 the API spec SIG is now formally established with you both as co-chairs. Congrats :) We've created a dedicated repository (which you're both now maintainers of, look for a GitHub invite in your email) and a Discord Channel. All work, designs and discussions should now occur in that repository. |
Firstly, I'd like to congratulate dapr community on the 1.0.0 release, this is a remarkable milestone!
I understand the community was busy with the 1.0.0 release recently, but right now might be a good time to take a cup of coffee and think about the future.🙂
What I'm interested in and like to discuss here is our future plans for dapr api: Do we have the intention to make dapr api a standard so that other sidecars/proxies could implement?
I've been playing with the dapr demos recently, and one thing that I'm really fond of is its possibility to truly realize Write once, Run anywhere, as dapr defines a very good abstraction layer between application code and the backend services. If every application could be sided with a dapr process/sidecar, then this would easily happen.
However, considering the real world cases: where we have different cloud providers, different legacy components and many other factors I could not possibly list, it would be very hard to make dapr available in every situation.
So I'm thinking why not we take a step forward and make the abstraction layer a standard? So that other cloud providers could choose to offer hosted dapr solution or their own solutions with the same api, and legacy components could also bridge to the same api. Then as an end user, we could safely program our application against the standard api and ship it to different environments with no code change.
I guess someone might raise the hand and say this sounds good but it looks like we don't need to do anything as the apis are already defined in the proto files. But what I'm thinking is if we do have the intention to make dapr api a standard, then it would be better to send more obvious signals(e.g. move proto files to a separate repo) or state our intention more clearly so that other sidecars/proxies could implement the dapr apis without concern, e.g. concerns of breaking changes, etc.
Looking forward to your ideas/comments on this topic!
The text was updated successfully, but these errors were encountered: