Skip to main content

15 posts tagged with "api"

api tag description

View All Tags

GRPC in Python Example

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

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.

GRPC on AWS: API Gateway Support, Lambda Integration, Streaming, and ALB Alternatives

· 10 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

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.

Linking Logs Across Python Microservices(Distributed Tracing)

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Distributed Tracing: Linking Logs Across Python Microservices​

In modern microservices architectures, a single user request might flow through an API Gateway, an authentication service, a business logic service, and several data services. While structured logging makes each service's log output clean, it doesn't automatically connect the dots.

Distributed Tracing is the operational practice of adding unique identifiers to every log and header related to a single request, allowing you to reconstruct the entire request path across all services.

Postman clear cache response

· 7 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

While Postman doesn't have a single "Clear Cache" button that directly affects API results (as it doesn't cache external API responses), the core issue often lies in two areas that mimic caching: DNS resolution and request state persistence.

Msgspec FastAPI Integration: High Performance, Validation, and OpenAPI Docs

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

msgspec is a Python library designed for high-performance serialization and validation, which makes it a powerful partner for FastAPI. It can be used as a drop-in replacement for FastAPI's default Pydantic models to handle data validation and schema generation, often leading to a significant speedup in API performance.

OpenAPI $ref reusable parameter

· 4 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Using $ref to reference a reusable parameter in an OpenAPI specification is a key practice for keeping your API definitions clean, consistent, and maintainable. This method centralizes common parameters, like Authorization headers or a userId path parameter, in a single location and allows you to reference them from any endpoint.

Create OpenAPI mock server

· 5 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Creating a mock server from a Swagger/OpenAPI file is a powerful way to decouple front-end and back-end development. It allows front-end developers to start building and testing their applications against a realistic API without waiting for the back-end to be completed.

Here's a step-by-step guide on how to set up a simple mock server using your OpenAPI specification file.

Correct way to declare a date in an OpenAPI

· 2 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

In OpenAPI, the correct way to declare a date is by using the string type along with a specific format. The format distinguishes a date from a regular string and provides a standard for validation and code generation.

Authorization bearer token in openapi and its usage

· 4 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

Using 'Authorization: Bearer <token>' in an OpenAPI (Swagger) specification requires defining a security scheme and then applying it to the relevant API endpoints. The method for doing this varies slightly between OpenAPI versions 2.0, 3.0, and 3.1.

Required in OpenAPI (or Swagger)

· 3 min read
Serhii Hrekov
Senior Software Engineer & System Architect specializing in Python, Web Systems, Cloud Infrastructure & Automation

The meaning of required in OpenAPI (or Swagger) is consistent across all major versions: it specifies that a property must be present in the data payload. However, how you use and apply the keyword has evolved between versions.