Download our latest report - Protecting & growing your payments business -
here Opens in a new window
Elizabeth Sargeant
April 03, 2025
This guide provides a comprehensive introduction to implementing gRPC on AWS, focusing on practical strategies for integrating this powerful protocol with serverless technologies.
Paul Flowers
As organisations move towards microservices architectures, gRPC has emerged as a powerful protocol for service-to-service communication. When implementing on AWS, developers face several decisions and tradeoffs. This post explores the implementation patterns in AWS, focusing on serverless options.
gRPC is a high-performance RPC framework that uses HTTP/2 as its transport protocol and Protocol Buffers for serialisation. While this brings numerous advantages like streaming capabilities and efficient binary serialisation, it also presents unique challenges in the AWS ecosystem.
Application Load Balancers have supported gRPC workloads since late 2020, marking a significant milestone for AWS users.
Here are the key aspects to consider:
ALBs require that gRPC traffic is encrypted using TLS, and clients must establish secure connections. However, the ALB terminates the TLS connection and forwards the decrypted traffic to your services. This means that your server is unaware it is secure and should not be configured with a certificate itself.
This poses an additional challenge in development where local testing requires an insecure connection, but once deployed to AWS a secure connection should be established.
Feature flags or an environment variable must be created to make the gRPC client aware of its operating environment and select the appropriate communication channel.
ALBs support gRPC-specific health checks through the `/aws.grpc.health.v1.Health/Check` endpoint. Your services should implement this health check protocol to ensure proper load balancing. The health check response must include a status field indicating whether the service is serving.
ALBs typically apply a round robin approach to balancing services. Typically, gRPC establishes a persistent channel which is reused for multiple requests. However, this can lead to us creating “hot” nodes in our scaling group.
Each request therefore creates a new channel ensuring even distribution of traffic. This does incur additional overhead and may not be suitable for your specific use case.
Service discovery tools, such as Cloudmap, should be leveraged where this is a consideration.
ECS provides a natural home for gRPC services due to its container-based architecture. Key advantages include:
1. Container Configuration:
2. Service Discovery:
While Lambda has some limitations with gRPC, it can be viable for certain use cases:
Advantages:
Limitations:
Unary Calls: Use lambda functions as a gRPC client in a single request/response pattern
Implementing gRPC on AWS requires careful consideration of various factors, from compute platform selection to operational concerns. While ECS provides the most flexible and feature-complete platform for gRPC services, Lambda can be suitable for simpler use cases. Understanding the tradeoffs and implementing proper patterns for your specific use case is crucial for success.
Remember to regularly review and update your implementation as AWS continues to enhance its gRPC support and introduce new features. The ecosystem is rapidly evolving, and staying current with best practices will ensure your services remain efficient and maintainable.
Sign up to receive Industry news, events and insights delivered straight to your inbox.