Author: Aivars Kalvāns

Engineering

FastAPI and cooperative multi-threading

This post was first published in aivarsk.com Cal Paterson wrote a great article comparing and describing synchronous and asynchronous Python frameworks and explaining why asynchronous frameworks go a bit wobbly under load. This is a story of how we experienced wobbliness in a recent project. We are using FastAPI, Pydantic, and...

February 10, 2022
Engineering

Optimizing Kafka producers for latency

This post was first published in aivarsk.com The code I am working with uses Confluent Kafka Python library that calls librdkafka C++ library underneath. The code does synchronous messaging: it produces events one-by-one and ensures event is persisted in Kafka topic by waiting for acknowledgments from all replicas. This code is sensitive to latency...

January 28, 2022