Developing with Kafka and Rails Applications

In this article, Sam Goldman gives an overview of how Blue Apron uses the ruby-kafka gem to produce and consume Kafka topics from Ruby. In addition, he shows how to leverage docker and docker compose to create a local development environment, which would otherwise be relatively complex since it needs 4 different supporting services (zookeper, Kafka broker, a schema registry and a REST proxy).

Introduction to Concurrency Models with Ruby

This post (part 1) and it’s follow-up (part 2) explain the different ways to work with concurrency in Ruby. It covers Processes, Threads, the GIL, Fibers and more abstract models like Actors, Sequential Processes, Software Transactional Memory and the new proposal for concurrency in Ruby: Guilds.

Using Atomic Transactions to Power an Idempotent API

@brandur writes a detailed post on how to treat HTTP API requests as transactions and build them in a way that they are idempotent – they can be called multiple times, without affecting the result. The author does a great job of covering the database, MVC framework code and even how to work with background processes. The diagrams illustrate elegantly how race conditions can occur and how to mitigate them.