• The REPL: Issue 38 - September 2017

    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.

    Read on →

  • Bug-Driven Development

    The Bug

    Read on →

  • Ruby stdlib: Base64

    Base64 is a widely-used mechanism to represent binary data in an ASCII string format. There are a few different Base64 schemes that share most of the implementation. The encoding strategy consists of choosing 64 characters that are common to most other string encodings and are also printable. For example, MIME’s Base64 implementation uses A-Z, a-z, and 0-9 for the first 62 characters. Other variations share this property but differ in the characters chosen for the last two values and an extra one for padding. Each base64 digit represents exactly 6 bits of data.

    Read on →

  • The REPL: Issue 37 - August 2017

    The fallacies of web application performance

    Is performance only a production concern? Are threads enough for multi-core concurrency? Are there cost-free solutions to solve performance? José Valim answers these en some other questions in this post. José is the creator of Elixir’s Phoenix framework and was part of the Rails core team. I’ve found most of his writing to be worth my time. This is no exception.

    Developing with Kafka and Rails Applications

    Sam Goldman explains how Blue Apron uses Ruby on Rails to work with Apache Kafka. Part of the article touches on which gems they use to process Kafka streams. The other portion describes how to setup a local development environment. Docker is leveraged effectively to make a complicated setup something easy to spin up locally: The final product has 4 different services: Zookeper, a Kafka broker, A schema registry, and a REST proxy for Kafka.

    An Intro to Compilers

    Nicole Orchard writes an introductory post on how compilers work. Specifically those leveraging the LLVM toolchain – used by Swift, most Mac gcc compilers, Crystal and many more. It takes a simple “Hello, Compiler!” program through the 3 phases: Front-end, Optimizer and Back-end. Short and sweet.

    Read on →

  • Book Review: Understanding the Four Rules of Simple Design

    Understanding the Four Rules of Simple Design by Corey Haines is a book about how to approach software design from a perspective of his years of the authors involvement in Code Retreats. A Code Retreat is a day-long practice session for software developers where they can explore different ways of building software by practicing deliberately without the pressure of having to deliver production code. I’ve previously written about my experience in a code retreat.

    Read on →