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.
©2016 Apigee Corp. All Rights Reserved.
©2016 Apigee Corp. All Rights Reserved. 
Slideshare
slideshare.com/apigee
Apigee Community
https://community.apigee.com
Yo...
gRPC: Microservices at Square
Manik Surtani
Senior Infrastructure Engineer, Square
@maniksurtani
We <3 JSON/HTTP
We also <3 monoliths*
(*) Not really. http://squ.re/spot
We preferred microservices
Java
Go
Ruby
Java
Go
Ruby
x 500
Stubby and
Sake
● JSON/HTTP for mobile & web client comms
● Replace server comms with Sake
● Stubby DNA
● Implements proto...
Sake
Often better warm
● Java
○ Asynchronous comms, blocking
APIs
○ Deadline propagation
○ ACLs
○ Integrates with service ...
Modernizing
Sake
● Move networking to Netty
● Open source Sake!
● Move to HTTP/2
○ Streaming!
● Native Ruby implementation...
ARCWire
● A Google effort
● A proto service based RPC
framework
● Stubby DNA
● HTTP/2
● Open Source
gRPC
Features
● Request/response as well as bidirectional streams
● Synchronous and asynchronous
● Backed by non-blocking ...
Supported
Platforms
Java (inc. Android) Python
Go PHP
C Ruby
C++ Node.js
Objective-C C#
Message
format
● Built for protocol buffers *
● Pluggable
● Other serialization formats could be used
instead
○ Avro, Thri...
Protocol
buffers
● Language-neutral, platform-neutral
● Extensible
● Binary, very compact
● Strongly typed
● Versioned
● E...
Protocol
Buffers
Protocol
Buffer
Services
Protocol
Buffers
gRPC
Server
gRPC
Server
gRPC
Client
Adding gRPC
to your stack
● Protobuf version control
● Service discovery
● Load balancing
● Security
● Logging
● Metrics
gRPC
performance
● Measured by etcd *
● 120µs round trips, compared to 1.6ms
roundtrips for JSON/HTTP
● 3 orders of magnit...
©2016 Apigee Corp. All Rights Reserved. 
Slideshare
slideshare.com/apigee
Apigee Community
https://community.apigee.com
Yo...
Thank you
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
gRPC: The Story of Microservices at Square
Upcoming SlideShare
Loading in …5
×

gRPC: The Story of Microservices at Square

14,246 views

Published on

Back in 2015, Square and Google collaborated to launch gRPC, an open source RPC framework backed by protocol buffers and HTTP/2, based on real-world experiences operating microservices at scale. If you build microservices, you will be interested in gRPC.

This webcast covers:

- a technical overview of gRPC
- use cases and applicability in your stack
- a deep dive into the practicalities of operationalizing gRPC

Published in: Technology

gRPC: The Story of Microservices at Square

  1. 1. ©2016 Apigee Corp. All Rights Reserved.
  2. 2. ©2016 Apigee Corp. All Rights Reserved. Slideshare slideshare.com/apigee Apigee Community https://community.apigee.com YouTube" youtube.com/apigee
  3. 3. gRPC: Microservices at Square Manik Surtani Senior Infrastructure Engineer, Square @maniksurtani
  4. 4. We <3 JSON/HTTP
  5. 5. We also <3 monoliths* (*) Not really. http://squ.re/spot
  6. 6. We preferred microservices
  7. 7. Java Go Ruby
  8. 8. Java Go Ruby x 500
  9. 9. Stubby and Sake ● JSON/HTTP for mobile & web client comms ● Replace server comms with Sake ● Stubby DNA ● Implements protobuf services ○ proto2
  10. 10. Sake Often better warm ● Java ○ Asynchronous comms, blocking APIs ○ Deadline propagation ○ ACLs ○ Integrates with service discovery ○ Distributed tracing ○ Retry logic ● Ported to Go ● Ruby support via a sidecar ○ Based on the Java impl
  11. 11. Modernizing Sake ● Move networking to Netty ● Open source Sake! ● Move to HTTP/2 ○ Streaming! ● Native Ruby implementations ○ No more sidecars
  12. 12. ARCWire ● A Google effort ● A proto service based RPC framework ● Stubby DNA ● HTTP/2 ● Open Source
  13. 13. gRPC Features ● Request/response as well as bidirectional streams ● Synchronous and asynchronous ● Backed by non-blocking IO ● Header compression ● Multiplexing requests over a single connection ● Built with mobile clients in mind ○ Better battery life, data usage than JSON/HTTP
  14. 14. Supported Platforms Java (inc. Android) Python Go PHP C Ruby C++ Node.js Objective-C C#
  15. 15. Message format ● Built for protocol buffers * ● Pluggable ● Other serialization formats could be used instead ○ Avro, Thrift, Cap’n Proto, etc. * http://developers.google.com/protocol-buffers
  16. 16. Protocol buffers ● Language-neutral, platform-neutral ● Extensible ● Binary, very compact ● Strongly typed ● Versioned ● Easily transformed to JSON for debugging
  17. 17. Protocol Buffers
  18. 18. Protocol Buffer Services
  19. 19. Protocol Buffers
  20. 20. gRPC Server
  21. 21. gRPC Server
  22. 22. gRPC Client
  23. 23. Adding gRPC to your stack ● Protobuf version control ● Service discovery ● Load balancing ● Security ● Logging ● Metrics
  24. 24. gRPC performance ● Measured by etcd * ● 120µs round trips, compared to 1.6ms roundtrips for JSON/HTTP ● 3 orders of magnitude?! * http://bit.ly/etcd_grpc
  25. 25. ©2016 Apigee Corp. All Rights Reserved. Slideshare slideshare.com/apigee Apigee Community https://community.apigee.com YouTube" youtube.com/apigee
  26. 26. Thank you

×