Skip to main content

Full gRPC Streaming on AWS

· 4 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Full gRPC Streaming on AWS: ALB to ECS Architecture

This architecture pattern is the definitive solution for running full-featured, high-performance gRPC services on AWS, leveraging dedicated container services (ECS/EKS) and the Application Load Balancer (ALB) for robust HTTP/2 transport.

Does AWS API Gateway Support gRPC?

· 9 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

The question of whether AWS API Gateway supports gRPC is crucial for architects planning microservices deployments on AWS. The answer, which has evolved, is a nuanced Yes, but primarily through the HTTP API and only for unary calls, while traditional gRPC streaming requires alternative AWS services.

Integrating gRPC with AWS Lambda

· 7 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

Integrating gRPC with AWS Lambda: Challenges and Solutions

While gRPC is the gold standard for high-performance microservices, integrating it directly with AWS Lambda—a serverless, ephemeral computing service—presents fundamental architectural mismatches. Lambda is designed for short, stateless execution, whereas gRPC is optimized for persistent, long-lived connections over HTTP/2.

This article details the challenges of this integration and the primary methods developers use to make gRPC work in a serverless environment.

AWS Alternatives to gRPC

· 7 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

AWS Alternatives to gRPC: Serverless Communication Patterns

When building an application on AWS, especially using Lambda and other serverless components, the landscape for inter-service communication shifts dramatically compared to traditional VM-based or containerized microservices where gRPC shines.

While gRPC is possible to use with AWS Lambda (via HTTP/2 support in API Gateway or Application Load Balancer), the complexity of managing the gRPC framework within the Lambda execution environment often makes it non-ideal.

The fundamental shift in AWS is moving from synchronous RPC (Remote Procedure Call) patterns to more flexible Asynchronous Event-Driven and Managed API patterns.

gRPC in Python Example

· 7 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

gRPC in Python: A Practical Example and When to Choose It

gRPC (gRPC Remote Procedure Calls) is a modern, high-performance, open-source framework developed by Google that enables communication between services. It relies on Protocol Buffers (protobuf) for its Interface Definition Language (IDL) and uses HTTP/2 for transport.

It has become the standard choice for communication in microservices and polyglot (multi-language) environments where performance, efficiency, and strong typing are critical.

When to Use Multiple try-except Blocks in Python

· 7 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

🚧 When to Use Multiple try...except Blocks in Python

While it is possible to wrap an entire function in a single try...except block, experienced Python developers know that strategically using multiple, smaller try...except blocks is often superior. This approach enhances clarity, improves error granularity, and aids recovery.

This article details the specific scenarios where breaking down your code into multiple guarded sections is the recommended best practice.

Catching Multiple Exception Types in Python

· 6 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

🎣 Catching Multiple Exception Types in Python

In robust Python development, it is often necessary to catch and handle several different types of exceptions that might arise from a single block of code. Python provides flexible and concise syntax to manage multiple exceptions in a single try...except structure.

This article details the three primary methods for catching multiple exceptions, focusing on efficiency and best practice.

The Right Way to Print Stack Traces in Python

· 8 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

🖨️ The Right Way to Print Stack Traces in Python

In Python, displaying the stack trace (or traceback) is essential for debugging. It provides a historical record of all function calls leading up to the point where an exception occurred. However, simply using print() within an except block is insufficient and incorrect.

This article details the correct methods for capturing, formatting, and logging the stack trace, emphasizing the difference between developer debugging and production logging.

Custom Classes for Python Exceptions: Extending the Error Toolkit

· 7 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

✨ Custom Classes for Python Exceptions: Extending the Error Toolkit

Defining custom exception classes is a hallmark of professional-grade Python code. Instead of relying on generic built-in exceptions (like ValueError or TypeError) for every application-specific failure, custom exceptions provide clear, unambiguous signals about why an operation failed.

This article details the necessity, structure, and best practices for creating and utilizing your own exception hierarchy.

Understanding the Python Exception Hierarchy

· 7 min read
Serhii Hrekov
software engineer, creator, artist, programmer, projects founder

🌳 Understanding the Python Exception Hierarchy

In Python, all exceptions are organized into a strict, single-rooted hierarchy of classes. Understanding this hierarchy is not just academic; it is fundamental to writing reliable exception handlers. When you catch an exception, you are actually catching that specific class and all classes that inherit from it.

This article breaks down the core structure of the Python exception hierarchy and demonstrates how inheritance dictates the behavior of your except blocks.

Looking for more content?
Hrekov Blog contains 240 articles. Browse the blog archive or Explore the full timeline.