Posts tagged with #rails

#architecture#monolith#rails#refactoring#software-design

From Monolith to Modulith: A Pragmatic Guide to Deconstruction

Everyone wants to break the monolith, but jumping straight to microservices is a fast track to a distributed mess. The Modulith is a more pragmatic step: a single application with strong, enforced internal boundaries. This post explores how to use tools like Packwerk in Rails to achieve modularity without the operational overhead of a distributed system.

#patterns#distributed-systems#rails#reliability#architecture

The Outbox Pattern: Reliable Event Publishing Without Distributed Transactions

How do you guarantee that an event is sent if, and only if, a database transaction succeeds? The dual-write problem plagues distributed systems, leading to inconsistency and bugs. This post dives deep into the Outbox Pattern, a simple yet powerful solution in Rails to ensure atomic, at-least-once delivery for your critical events.

#postgres#search#database#rails#ruby

Postgres Full-Text Search vs. Embeddings: A Practical Guide

Most teams reach for embeddings before they need them, wiring up pgvector when Postgres’s full-text search would have done the job. If your users are just looking for “caching” and expect to find “Rails caching strategies,” full-text search is fast, precise, and already built in. Where embeddings shine is when meaning matters more than exact words, like an e-commerce query for “summer outfit” that should return linen shirts and beach dresses. The key isn’t choosing one tool over the other, but knowing when Postgres alone is enough and when a hybrid approach gives you the semantic nuance users actually need.

#redis#caching#performance#architecture#rails

How I Reduced API Latency by 50% Using Strategic Redis Architecture

Peak traffic was crushing our API—P95 latency at 450ms, dashboards taking 5 seconds to load, and users complaining of “slow mornings.” By introducing a Redis caching layer designed around real access patterns, not just generic key-value storage, we cut P95 latency in half, reduced DB CPU load from 85% to 45%, and eliminated the majority of timeouts. This is the story of how intentional caching turned a struggling system into one that scaled gracefully.

#ai#rails#ruby#open-source#prompt-engineering

How I Built Promptly: Solving AI Prompt Management at Scale

The moment I realized we had a problem was when our QA engineer asked, 'How do we know if someone accidentally changed how the AI behaves?' We had prompts scattered across a dozen files, each slightly different, with no way to test or version them. It hit me: we were making the same mistakes Rails solved 15 years ago with hardcoded strings. AI prompts aren't just text, they're critical business logic that shapes user experience. So I built Promptly to bring Rails conventions to AI development, treating prompts like the first-class citizens they should be. The result? 60% faster AI feature development and actual regression testing for AI behavior. Sometimes the best solutions aren't about new technology; they're about applying proven patterns to new problems.

#ai#rails#rag#postgres#ruby

How I Built a RAG System in Rails Using Nomic Embeddings and OpenAI

RAG doesn’t have to mean heavyweight infrastructure. In this post, I show how I wired up a lean Retrieval-Augmented Generation pipeline inside a Rails app using Nomic for embeddings, PgVector for search, and OpenAI for generation. The result is a flexible system: open-source at the embedding layer, powerful where it counts, and simple enough to extend without vendor lock-in.

#ruby#rails#performance#algorithms#search

Autocomplete at Scale - How Tries and Partitioning Can Unlock Blazing-Fast Search in Ruby on Rails

Scalable autocomplete functionality achieving sub-millisecond response times with millions of records employs trie data structures and advanced partitioning strategies in Ruby on Rails. Performance optimization techniques include memory management, database partitioning patterns, and efficient prefix-based search algorithms.