paint-brush
Prevent Decision Paralysis With These Battle-tested Elixir Librariesby@artfreshcode
389 reads
389 reads

Prevent Decision Paralysis With These Battle-tested Elixir Libraries

by Artem BarminDecember 6th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Instead of evaluating 15 different libraries for each function, Elixir typically offers one or two battle-tested solutions per problem domain.
featured image - Prevent Decision Paralysis With These Battle-tested Elixir Libraries
Artem Barmin HackerNoon profile picture

After years in JavaScript's endless sea of competing packages, Elixir's ecosystem feels like a breath of fresh air. Instead of evaluating 15 different libraries for each function, Elixir typically offers one or two battle-tested solutions per problem domain. This focused approach means each tool is well-maintained, thoroughly documented, and production-proven.


Let me share my favorite libraries that make Elixir development a joy, especially from the npm world of decision paralysis. Each tool solves a problem elegantly without trying to be everything to everyone, and I’m here for that. Anyone else?

The Game-Changers

Background Jobs: All the Love to Oban

Coming from Sidekiq in Ruby and Bull in Node.js, Oban was a revelation. It's the only job processor I've used that leverages PostgreSQL instead of requiring Redis – this architectural choice means your jobs are transactionally consistent with your data. With 3.4k GitHub stars, it's clear I'm not alone in appreciating this solution.


I particularly love how it handles job persistence. When our application crashed in Node.js, we'd lose in-memory jobs. With Oban, they survive restarts because they're stored right in PostgreSQL. The recent MySQL support shows they're thinking about broader adoption too.

GraphQL Done Right: Absinthe

Absinthe feels like coming home if you've wrestled with GraphQL implementations in other languages. With 4.3k GitHub stars, it's not just popular – it's the standard. What makes it special isn't just the comprehensive feature set but how naturally it integrates with Elixir's concurrency model. Field resolution can be async by default, and the N+1 query problem just... disappears.

The Daily Workhorses

Data Handling: God Bless Flop

Remember writing custom pagination and filtering over and over? Flop ended that tedium for me. With both offset and cursor-based pagination built-in and a filtering system that makes sense, it's become my go-to for any data-heavy interface. The fact that it works seamlessly with Phoenix makes it even better – the pre-built components save hours of development time.

Data Encryption: Cloak's Practical Magic

After struggling with attr_encrypted in Ruby and TypeORM encryption in Node.js, I found exactly what I needed in Cloak. What sets it apart (and earned it that 9.0/6.3 rating on LibHunt) is how it makes encrypted data actually usable. You can search through encrypted fields – a feature that blew my mind when I first discovered it. The GDPR compliance support isn't just a checkbox feature; it's deeply integrated into how Cloak handles data. And when you need to rotate encryption keys (and you will), Cloak makes it painless instead of panic-inducing.

Multi-tenancy: Triplex Is My Painkiller

Multi-tenancy used to give me nightmares until I found Triplex. Its use of PostgreSQL schemas for tenant isolation is brilliant – it's like each tenant gets their private database but without the operational overhead. The way it maintains the familiar Ecto query interface means you barely have to think about the multi-tenant aspect while coding.

The Quality-of-Life Improvers

Caching: Why Cachex Stands Out

After trying various caching solutions across different languages, Cachex's approach just clicks. For a good reason, it's the highest-rated caching solution on LibHunt (9.7/10). The combination of time-based expiration, size limits, and transaction support covers every caching scenario I've encountered. The cache warming strategies have saved us during high-traffic events multiple times.

JWT Handling: Joken's Focused Approach

Joken is a perfect example of the Elixir ecosystem's philosophy: do one thing and do it well. It's not trying to be a complete auth solution – instead, it focuses on JWT handling and does it perfectly. The built-in security features and flexible integration options make token management a piece of cake.

HTTP Client: Req Is Battery-Included

While HTTPoison dominates the LibHunt ratings, I've fallen in love with Req's approach. Its batteries-included philosophy means I spend less time configuring and more time building. The automatic retries and response handling just work, and the pluggable architecture makes customization straightforward when needed.

AWS Integration: ExAws Makes Cloud Simple

ExAws (1.3k stars) transformed my thoughts about AWS integration in Elixir. Its modular approach means you only include the services you need, keeping your dependencies lean. The consistent API patterns across different AWS services make it feel like you're working with native Elixir code rather than wrestling with AWS peculiarities.


9 open-source Elixir tools to build your SaaS


Why This Matters

The beauty of Elixir's ecosystem isn't just in the individual tools but in how they work together.  I absolutely love that I can build a complete, production-ready application using only Elixir. There's no decision fatigue, no compatibility nightmares, just solid, focused solutions that solve real problems. Coming from ecosystems where you might spend days just choosing packages, this clarity is refreshing.


What's your experience with these tools? Have they changed how you think about building Elixir applications? I'd love to hear your stories and discoveries in the comments.