We’ll go through the main approaches to implementing real-time rich text editors and try to assess their pros and cons.

Real-time experience becomes the new norm in building modern online tools.

Lots of collaboration tools implement real-time, including Almanac. This blog post is based on my research and experience building a rich doc editor that allows typing with other users in real-time, keeping docs’ history, forking docs, submitting changes, etc. Here is a list of all approaches we’re going to cover in this blog post:

0. Global Lock

1. Last Write Wins

2. Diff and Merge

3. Conflict-free Replicated Data…

We recently improved the performance of the Universe.com homepage by more than ten times. Let’s explore the techniques we used to achieve this result.

Here is a translated Chinese version of the blog post on InfoQ.

But first, let’s find out why website performance is important (there are links to the case studies at the end of the blog post):

  • User experience: poor performance leads to unresponsiveness, which may be frustrating for users from a UI and UX perspective.
  • Conversion and revenue: very often slow websites can lead to lost customers and have a negative impact on conversion rates and…

In the second part of our series we will take a look at more advanced concurrency models such as Actors, Communicating Sequential Processes, Software Transactional Memory and of course Guilds — a new concurrency model which may be implemented in Ruby 3.

If you haven’t read our first post in the series, I’d definitely recommend reading it first. There I described Processes, Threads, GIL, EventMachine and Fibers which I’ll be referring to in this post.


Actors are concurrency primitives which can send messages to each other, create new Actors and determine how to respond to the next received message. They…

In this first post, I would like to describe the differences between Processes, Threads, what the GIL is, EventMachine and Fibers in Ruby. When to use which of the models, which open-source projects use them, what the pros and cons are.

What is concurrency?


Running multiple processes is not actually about concurrency, it’s about parallelism. Although parallelism and concurrency are often confused, they are different things. I like this simple analogy:

  • Concurrency: having a person juggle many balls with only 1 hand. Regardless of how it seems, the person is only catching / throwing one ball at a time.
  • Parallelism: is having multiple…

In this post, I’m going to tell you about batching as a technique to help avoid N+1 queries, existing battle-tested tools like Haskell Haxl and JavaScript DataLoader, and how similar approaches can be used in any Ruby program.

Here is a translated Japanese version of the blog post.

What are N+1 queries?

First, let’s find out what N+1 queries are and why they are called that. Imagine, we have 2 SQL tables: users and posts. If we run the following code by using ActiveRecord models:

posts = Post.where(id: [1, 2, 3])
# SELECT * FROM posts WHERE id IN (1, 2, 3)
users =…

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store