Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

gRPC in ASP.NET Core


Published on

This talk for dotPorto, we discuss gRPC and why it's important.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

gRPC in ASP.NET Core

  1. 1. Shawn Wildermuth Microsoft MVP, Author, and Speaker @shawnwildermuth gRPC in ASP.NET Core Another Solution for APIs
  2. 2. Who Am I? Author, Instructor, Coach Pluralsight Author > 20 Courses to my name Wilder Minds Training Courses on Vue, Bootstrap 4 & SignalR Make Films Too Hello World
  3. 3. The History of Distributed APIs1970 1980 1990 2000 2010 2020 RPC Messaging Queuing COM/ DCOM CORBA Java/RMI XMLHTTP SOAP REST GraphQL gRPC Dawn of Distributed Computing Object Oriented APIs Web-Based APIs
  4. 4. “ ”- Website gRPC: A high performance, open- source universal RPC framework
  5. 5. gRPC g: R: P: C: gRPC Remote Procedure Call gRPCGoogle?
  6. 6. What Does That Mean? gRPC Binary Communication Contract-Based Available across ecosystems Secure by Default Uni-directional and Bi-direction Streaming
  7. 7. REST: CRUD and purely web apps Matching Communication to Technology SignalR: Multicasting and web messaging GraphQL: Open querying of large datasets gRPC: Streaming, low resource clients, and inter-data center
  8. 8. Does this mean REST is dead?
  9. 9. No.
  10. 10. How gRPC Works gRPC is tied to HTTP/2 Clients must support this Most browsers don’t Format is ordinal/binary Harder for JS to parse Contracts are required Not great for the web
  11. 11. I’ve Heard of gRPC-web gRPC-Web is a thing Different protocol Requires a proxy Doesn’t add much benefit Likely just as slow Might be beneficial to share an API Though I’d probably just do REST to share
  12. 12. Cloud/Data Center Where Does gRPC Belong? Web Service API Service Weather Service IoT Station IoT Station IoT Station PartnersOther Services REST REST/gRPC gRPC gRPC gRPC gRPC gRPC
  13. 13. Contracts Contracts Generated Clients/Servers Uses an interface definition language Protocol Buffers (ProtoBuf) Language Independent C++, Java, Obj-C, Python, Ruby, Go, NodeJS
  14. 14. Protocol Buffers Interface Definition Language Language-neutral Platform-neutral Extensible Serializable Not specific to gRPC
  15. 15. “Is it really faster?”
  16. 16. Demo Your First ProtoBuf
  17. 17. Pseudo Serialized ProtoBuf 1: 100 1: 94.5 2: 15.4 3: .5 Weather Request Weather Response
  18. 18. Demo Your First Service
  19. 19. Demo Your First Client
  20. 20. Demo Streaming
  21. 21. Demo Collections and Types
  22. 22. Security Relies on HTTP/2 Headers (including JWT) Certificates Probably Windows Auth (I haven’t tested)
  23. 23. Takeaways Read More My Blog (for this demo):