-
Notifications
You must be signed in to change notification settings - Fork 380
Conversation
This is not meant to be very long, just pretty. I've had these in my TODO tab list for some time, and I wan to get them out. |
_posts/2018-11-30-grpc-stacks.md
Outdated
<!--more--> | ||
|
||
|
||
There are three main stacks in gRPC: C-core, Go, and Java. Most of the languages are thin wrappers on top of the [C-based](https://github.com/grpc/grpc/tree/v1.16.1/src/core) gRPC core library: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link to master branch as 1.16.1 will be old soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had picked a tag because links tend to break over time (re-orging code). Done, though.
_posts/2018-11-30-grpc-stacks.md
Outdated
|
||
<p><img src="https://grpc.io/img/grpc-core-stack.svg" alt="gRPC Core Stack" style="max-width: 800px" /></p> | ||
|
||
For example, a Python application calls into the generated Python stubs. These call pass through interceptors, and into the wrapping library where the call is translated into C calls. The gRPC C-core will encode the RPC as HTTP/2, optionally encrypt the data with TLS, and then pass write it to the network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These calls ...
...where the calls are ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then pass write
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
_posts/2018-11-30-grpc-stacks.md
Outdated
|
||
<p><img src="https://grpc.io/img/grpc-java-stack.svg" alt="gRPC Java Stack" style="max-width: 800px" /></p> | ||
|
||
Again, the structure is a little different. Java supports HTTP/2, QUIC, and In Process like the C-core. Unlike the C-Core though, applications commonly can bypass the generated stubs and interceptors, and speak directly to the Java Core library. Each structure is slightly different based on the needs of each language implementation of gRPC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is QUIC supported directly or is it via Cronet? If Cronet then the diagram needs to change a include TCP under Cronet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From talking to @ncteisen I thought there was built in support not from Cronet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vjpai as far as I am aware we do not have a non cronet QUIC transport.. IIUC We do not have server side support of quic either, but rely on a translating proxy in between...
@srini100 PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noted one small nit. Diagrams look good.
LGTM.
_posts/2018-11-30-grpc-stacks.md
Outdated
|
||
<p><img src="https://grpc.io/img/grpc-core-stack.svg" alt="gRPC Core Stack" style="max-width: 800px" /></p> | ||
|
||
For example, a Python application calls into the generated Python stubs. These calls pass through interceptors, and into the wrapping library where the call is translated into C calls. The gRPC C-core will encode the RPC as HTTP/2, optionally encrypt the data with TLS, and then write it to the network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
..where the calls are translated...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added blurbs about the HTTP/2 components based on our discussion.
_posts/2018-11-30-grpc-stacks.md
Outdated
|
||
<p><img src="https://grpc.io/img/grpc-core-stack.svg" alt="gRPC Core Stack" style="max-width: 800px" /></p> | ||
|
||
For example, a Python application calls into the generated Python stubs. These calls pass through interceptors, and into the wrapping library where the call is translated into C calls. The gRPC C-core will encode the RPC as HTTP/2, optionally encrypt the data with TLS, and then write it to the network. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor nits, but I do not want to block the approval on them..
_posts/2018-11-30-grpc-stacks.md
Outdated
<!--more--> | ||
|
||
|
||
There are three main stacks in gRPC: C-core, Go, and Java. Most of the languages are thin wrappers on top of the [C-based](https://github.com/grpc/grpc/tree/master/src/core) gRPC core library: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
C++ based? but a restricted subset of C++? How do we want to word this? @vjpai any suggestions here?
_posts/2018-11-30-grpc-stacks.md
Outdated
|
||
<p><img src="https://grpc.io/img/grpc-java-stack.svg" alt="gRPC Java Stack" style="max-width: 800px" /></p> | ||
|
||
Again, the structure is a little different. Java supports HTTP/2, QUIC, and In Process like the C-core. Unlike the C-Core though, applications commonly can bypass the generated stubs and interceptors, and speak directly to the Java Core library. Each structure is slightly different based on the needs of each language implementation of gRPC. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vjpai as far as I am aware we do not have a non cronet QUIC transport.. IIUC We do not have server side support of quic either, but rely on a translating proxy in between...
|
||
For example, a Python application calls into the generated Python stubs. These calls pass through interceptors, and into the wrapping library where the calls are translated into C calls. The gRPC C-core will encode the RPC as HTTP/2, optionally encrypt the data with TLS, and then write it to the network. | ||
|
||
One of the cool things about gRPC is that you can swap these pieces out. For example, you could use C# instead, and use an In-Process transport. This would save you from having to go all the way down to the OS network layer. Another example is trying out the QUIC protocol, which allows you to open new connections quickly. Being able to run over a variety of transports based on the environment makes gRPC really flexible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will be good to provide a link/reference to In-process transport (grpc/grpc-java#518 or something better if there is one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly make "QUIC" hyperlinked (to https://www.chromium.org/quic or better)
|
||
One of the cool things about gRPC is that you can swap these pieces out. For example, you could use C# instead, and use an In-Process transport. This would save you from having to go all the way down to the OS network layer. Another example is trying out the QUIC protocol, which allows you to open new connections quickly. Being able to run over a variety of transports based on the environment makes gRPC really flexible. | ||
|
||
For each of the wrapped languages, the default HTTP/2 implementation is built into the C-core library, so there is no need to include an outside one. However, as you can see, it is possible to bring your own (such as with Cronet, the Chrome networking library). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make "Cronet" a link to https://developer.android.com/guide/topics/connectivity/cronet/ (or better?)
company-link: https://www.google.com | ||
--- | ||
|
||
Here is a high level overview of the gRPC Stacks. Each of the **10** default languages supported by gRPC has multiple layers, allowing you to customize what pieces you want in your application. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gRPC Stacks => gRPC Language Stacks
Looks good. In the next version it will be good to include a feature comparison matrix or table for the various language stacks so one can quickly see the Cronet and QUICK support is offered by core and Java but not by Go. |
@sanjaypujare Agree on the matrix, though these are somewhat time consuming to make. (and keep up to date). I sent a PR addressing your comments in #793 |
cc: @menghanl @ncteisen