martosaur

martosaur

Creating a process that maintains a state and makes it available for other processes is one of the most common use cases for GenServer. And the very first optimization that is usually done here is using ETS to enable concurrent reads. In this post I show a simple Registry trick that makes it easier to do.

Showing Posts 1 to 5

krasenyp

krasenyp

Short and sweet. Piggy-backing on Registry as a KV store is something I came up on my own and was wondering if it’s well-known.

martosaur

martosaur OP

Yep, I love Registry! It was a little hard to grasp at first, but once it clicked… It’s weirdly powerful.

garrison

garrison

Concurrent readers on the ets table are fine for single-key reads, but if you want serializable multi-key reads you’ll either have to roll your own concurrency control or go back to the GenServer. Likewise if you’re only performing single-key writes you can allow concurrent writers on the ets table and it will still serialize the operations for you (it has its own locks).

adamu

adamu

Nice blog! Does it have an RSS feed?

martosaur

martosaur OP

Thanks! No, no RSS yet, I need to look into adding it tho

— All posts loaded —

Where Next? Top

Trending in Blog Posts Top

pckrishnadas88
Hey everyone! :waving_hand: I’ve published Part 7 of the Building Distributed Systems in Elixir series, where we build core distributed ...
New
mudasobwa
So, instead of wasting my afternoon arguing with anonymous handles on X, I turned to my trusty, soulless assistant and said: “Listen, ple...
New
zorn
An educational side project in Elixir, Phoenix, and Tauri. I share what I learned while wiring Automerge into the BEAM, including how I s...
New
abreujp
New article: Elixir Project Structure — From mix new to a Growing Codebase I’ve published a new article in my Elixir learning series on d...
New
zorn
:pencil: Phoenix’s built-in LiveView test helpers require you to hand-build the form payload and start a fresh pipe after every click. Wo...
New
jola
Wrote about how to safely run a globally unique process in an Elixir cluster, and a scary story from the past! Learn about :global for r...
New
nathanl
Process labels are useful for visualization and debugging. Here’s why you should use them.
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews