Blog Post: Building a replicated cache in 65 lines using ConCache and Phoenix.PubSub

In the realm of software development, we often stand on the shoulders of giants. Abstractions layer upon abstractions as we harness powerful tools crafted by others. Today, we’ll delve into two such tools: ConCache and Phoenix.PubSub.

ConCache is a lightweight, performant caching library on top of ETS. But it is confined to a single Elixir node. Phoenix.PubSub is a Publisher/Subscriber service that lets you broadcast messages to all nodes of your Elixir cluster. Building on the two libraries, we can create a replicated cache in only 65 lines of code.

3 Likes